1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#include "cbase.h"
#include "c_tf_projectile_rocket.h"
#include "particles_new.h"
#include "tf_gamerules.h"
IMPLEMENT_NETWORKCLASS_ALIASED( TFProjectile_Rocket, DT_TFProjectile_Rocket )
BEGIN_NETWORK_TABLE( C_TFProjectile_Rocket, DT_TFProjectile_Rocket )
RecvPropBool( RECVINFO( m_bCritical ) ),
END_NETWORK_TABLE()
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
C_TFProjectile_Rocket::C_TFProjectile_Rocket( void )
{
pEffect = NULL;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
C_TFProjectile_Rocket::~C_TFProjectile_Rocket( void )
{
if ( pEffect )
{
ParticleProp()->StopEmission( pEffect );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_TFProjectile_Rocket::OnDataChanged(DataUpdateType_t updateType)
{
BaseClass::OnDataChanged(updateType);
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_TFProjectile_Rocket::CreateTrails( void )
{
if ( IsDormant() )
return;
bool bUsingCustom = false;
if ( pEffect )
{
ParticleProp()->StopEmission( pEffect );
pEffect = NULL;
}
int iAttachment = LookupAttachment( "trail" );
if ( iAttachment == INVALID_PARTICLE_ATTACHMENT )
return;
if ( enginetrace->GetPointContents( GetAbsOrigin() ) & MASK_WATER )
{
ParticleProp()->Create( "rockettrail_underwater", PATTACH_POINT_FOLLOW, "trail" );
bUsingCustom = true;
}
else if ( GetTeamNumber() == TEAM_UNASSIGNED )
{
ParticleProp()->Create( "rockettrail_underwater", PATTACH_POINT_FOLLOW, "trail" );
bUsingCustom = true;
}
else
{
// Halloween Spell Effect Check
int iHalloweenSpell = 0;
// if the owner is a Sentry, Check its owner
CBaseObject *pSentry = GetOwnerEntity() && GetOwnerEntity()->IsBaseObject() ? assert_cast<CBaseObject*>( GetOwnerEntity() ) : NULL;
if ( TF_IsHolidayActive( kHoliday_HalloweenOrFullMoon ) )
{
if ( pSentry )
{
CALL_ATTRIB_HOOK_INT_ON_OTHER( pSentry->GetOwner(), iHalloweenSpell, halloween_pumpkin_explosions );
}
else
{
CALL_ATTRIB_HOOK_INT_ON_OTHER( GetOwnerEntity(), iHalloweenSpell, halloween_pumpkin_explosions );
}
}
// Mini rockets from airstrike RL
if ( iHalloweenSpell > 0 )
{
ParticleProp()->Create( "halloween_rockettrail", PATTACH_POINT_FOLLOW, iAttachment );
bUsingCustom = true;
}
else if ( !pSentry )
{
if ( GetLauncher() )
{
int iMiniRocket = 0;
CALL_ATTRIB_HOOK_INT_ON_OTHER( GetLauncher(), iMiniRocket, mini_rockets );
if ( iMiniRocket )
{
ParticleProp()->Create( "rockettrail_airstrike", PATTACH_POINT_FOLLOW, iAttachment );
bUsingCustom = true;
// rockettrail_airstrike_line
CTFPlayer *pPlayer = ToTFPlayer( GetOwnerEntity() );
if ( pPlayer && pPlayer->m_Shared.InCond( TF_COND_BLASTJUMPING ) )
{
ParticleProp()->Create( "rockettrail_airstrike_line", PATTACH_POINT_FOLLOW, iAttachment );
}
}
}
}
}
if ( !bUsingCustom )
{
if ( GetTrailParticleName() )
{
ParticleProp()->Create( GetTrailParticleName(), PATTACH_POINT_FOLLOW, iAttachment );
}
}
if ( m_bCritical )
{
switch( GetTeamNumber() )
{
case TF_TEAM_BLUE:
pEffect = ParticleProp()->Create( "critical_rocket_blue", PATTACH_ABSORIGIN_FOLLOW );
break;
case TF_TEAM_RED:
pEffect = ParticleProp()->Create( "critical_rocket_red", PATTACH_ABSORIGIN_FOLLOW );
break;
default:
pEffect = ParticleProp()->Create( "eyeboss_projectile", PATTACH_ABSORIGIN_FOLLOW );
break;
}
}
}
|