Project:
conqueredcastles
Code Location:
http://conqueredcastles.googlecode.com/svn/trunk//trunk
conqueredcastles --username virance/
ConPawn.uc
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
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
class ConPawn extends UTPawn; // Kyle: Idea to replace and rename Pawn.uc's function from BattleTeamArena function bool Pawn_Died(Controller Killer, class<DamageType> damageType, vector HitLocation) { local SeqAct_Latent Action; // Kyle: Flag the pawn as dead ConPRI (PlayerReplicationInfo).bConDead = true; ConPRI (PlayerReplicationInfo).bRecentlyDead = true; // allow the current killer to override with a different one for kill credit if ( Killer != None ) { Killer = Killer.GetKillerController(); } // ensure a valid damagetype if ( damageType == None ) { damageType = class'DamageType'; } // if already destroyed or level transition is occuring then ignore if ( bDeleteMe || WorldInfo.Game == None || WorldInfo.Game.bLevelChange ) { return FALSE; } // if this is an environmental death then refer to the previous killer so that they receive credit (knocked into lava pits, etc) if ( DamageType.default.bCausedByWorld && (Killer == None || Killer == Controller) && LastHitBy != None ) { Killer = LastHitBy; } // gameinfo hook to prevent deaths // WARNING - don't prevent bot suicides - they suicide when really needed if ( WorldInfo.Game.PreventDeath(self, Killer, damageType, HitLocation) ) { Health = max(Health, 1); return false; } Health = Min(0, Health); // activate death events TriggerEventClass( class'SeqEvent_Death', self ); // and abort any latent actions foreach LatentActions(Action) { Action.AbortFor(self); } LatentActions.Length = 0; // notify the vehicle we are currently driving if ( DrivenVehicle != None ) { Velocity = DrivenVehicle.Velocity; DrivenVehicle.DriverDied(); } else if ( Weapon != None ) { Weapon.HolderDied(); ThrowActiveWeapon(); } // notify the gameinfo of the death if ( Controller != None ) { WorldInfo.Game.Killed(Killer, Controller, self, damageType); } else { WorldInfo.Game.Killed(Killer, Controller(Owner), self, damageType); } DrivenVehicle = None; // notify inventory manager if ( InvManager != None ) { InvManager.OwnerEvent('died'); // and destroy InvManager.Destroy(); InvManager = None; } // push the corpse upward (@fixme - somebody please remove this?) Velocity.Z *= 1.3; // if this is a human player then force a replication update if ( IsHumanControlled() ) { PlayerController(Controller).ForceDeathUpdate(); } NetUpdateFrequency = Default.NetUpdateFrequency; PlayDying(DamageType, HitLocation); return TRUE; } function bool Died(Controller Killer, class<DamageType> damageType, vector HitLocation) // Derived from UTPawn.uc { if (Pawn_Died(Killer, DamageType, HitLocation)) { StartFallImpactTime = WorldInfo.TimeSeconds; bCanPlayFallingImpacts=true; if(ArmsMesh[0] != none) { ArmsMesh[0].SetHidden(true); if(ArmsOverlay[0] != none) { ArmsOverlay[0].SetHidden(true); } } if(ArmsMesh[1] != none) { ArmsMesh[1].SetHidden(true); if(ArmsOverlay[1] != none) { ArmsOverlay[1].SetHidden(true); } } SetPawnAmbientSound(None); SetWeaponAmbientSound(None); return true; } return false; } defaultproperties { Name="ConPawn" }
