|
17 | 17 | #include "tier0/memdbgon.h"
|
18 | 18 |
|
19 | 19 | #define SENTRY_BASE_MODEL "models/sentry_gun/sentry_base.mdl"
|
20 |
| -//#define SENTRY_BASE_MODEL "models/swarm/droneprops/DronePropIdle.mdl" |
21 | 20 |
|
22 | 21 | extern int g_sModelIndexFireball; // (in combatweapon.cpp) holds the index for the smoke cloud
|
23 | 22 |
|
24 |
| - |
25 | 23 | ConVar asw_sentry_gun_type("asw_sentry_gun_type", "-1", FCVAR_CHEAT, "Force the type of sentry guns built to this. -1, the default, reads from the marine attributes.");
|
26 | 24 | ConVar asw_sentry_infinite_ammo( "asw_sentry_infinite_ammo", "0", FCVAR_CHEAT );
|
27 | 25 | ConVar asw_sentry_health_base( "asw_sentry_health_base", "300", FCVAR_CHEAT );
|
@@ -53,12 +51,14 @@ END_SEND_TABLE()
|
53 | 51 | BEGIN_DATADESC( CASW_Sentry_Base )
|
54 | 52 | DEFINE_THINKFUNC( AnimThink ),
|
55 | 53 | DEFINE_FIELD( m_hSentryTop, FIELD_EHANDLE ),
|
56 |
| - DEFINE_FIELD( m_bAssembled, FIELD_BOOLEAN ), |
| 54 | + DEFINE_KEYFIELD( m_bAssembled, FIELD_BOOLEAN, "IsAssembled" ), |
57 | 55 | DEFINE_FIELD( m_bIsInUse, FIELD_BOOLEAN ),
|
58 |
| - DEFINE_FIELD( m_fAssembleProgress, FIELD_FLOAT ), |
| 56 | + DEFINE_KEYFIELD( m_fAssembleProgress, FIELD_FLOAT, "AssembleProgress" ), |
59 | 57 | DEFINE_FIELD( m_fAssembleCompleteTime, FIELD_TIME ),
|
60 | 58 | DEFINE_FIELD( m_hDeployer, FIELD_EHANDLE ),
|
61 | 59 | DEFINE_FIELD( m_hLastDisassembler, FIELD_EHANDLE ),
|
| 60 | + DEFINE_KEYFIELD( m_iAmmo, FIELD_INTEGER, "Ammo" ), |
| 61 | + DEFINE_KEYFIELD( m_nGunType, FIELD_INTEGER, "GunType" ), |
62 | 62 | END_DATADESC()
|
63 | 63 |
|
64 | 64 | BEGIN_ENT_SCRIPTDESC( CASW_Sentry_Base, CBaseAnimating, "sentry" )
|
@@ -156,6 +156,24 @@ void CASW_Sentry_Base::Spawn( void )
|
156 | 156 | {
|
157 | 157 | m_iAmmo = m_iMaxAmmo;
|
158 | 158 | }
|
| 159 | + |
| 160 | + // mapper-placed sentries |
| 161 | + SetGunType( m_nGunType ); // set skin |
| 162 | + if ( m_bAssembled ) |
| 163 | + { |
| 164 | + Assert( !m_hSentryTop ); |
| 165 | + m_fAssembleProgress = 1.0f; |
| 166 | + m_fAssembleCompleteTime = gpGlobals->curtime; |
| 167 | + |
| 168 | + CASW_Sentry_Top *pSentryTop = dynamic_cast< CASW_Sentry_Top * >( CreateEntityByName( GetEntityNameForGunType( GetGunType() ) ) ); |
| 169 | + m_hSentryTop = pSentryTop; |
| 170 | + if ( pSentryTop ) |
| 171 | + { |
| 172 | + pSentryTop->SetSentryBase( this ); |
| 173 | + pSentryTop->SetAbsAngles( GetAbsAngles() ); |
| 174 | + DispatchSpawn( pSentryTop ); |
| 175 | + } |
| 176 | + } |
159 | 177 | }
|
160 | 178 |
|
161 | 179 | void CASW_Sentry_Base::PlayDeploySound()
|
@@ -328,30 +346,6 @@ void CASW_Sentry_Base::NPCStartedUsing( CASW_Inhabitable_NPC *pNPC )
|
328 | 346 | {
|
329 | 347 | EmitSound( "ASW_Sentry.SetupLoop" );
|
330 | 348 |
|
331 |
| - if ( GetModelPtr() && GetModelPtr()->numskinfamilies() >= kGUNTYPE_MAX + 2 ) // modeller guy says 2 first textures are a must |
332 |
| - { |
333 |
| - switch ( GetGunType() ) |
334 |
| - { |
335 |
| - case kAUTOGUN: |
336 |
| - this->m_nSkin = 2; |
337 |
| - break; |
338 |
| - case kCANNON: |
339 |
| - this->m_nSkin = 5; |
340 |
| - break; |
341 |
| - case kFLAME: |
342 |
| - this->m_nSkin = 4; |
343 |
| - break; |
344 |
| - case kICE: |
345 |
| - this->m_nSkin = 3; |
346 |
| - break; |
347 |
| -#ifdef RD_7A_WEAPONS |
348 |
| - case kRAILGUN: |
349 |
| - this->m_nSkin = 6; |
350 |
| - break; |
351 |
| -#endif |
352 |
| - } |
353 |
| - } |
354 |
| - |
355 | 349 | if ( !m_bIsInUse && m_fAssembleProgress < 1.0f )
|
356 | 350 | {
|
357 | 351 | IGameEvent *event = gameeventmanager->CreateEvent( "sentry_start_building" );
|
|
0 commit comments