Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 |
//----------------------------------------------------------- // //----------------------------------------------------------- class FleshpoundZombieController extends KFMonsterController; var float RageAnimTimeout; // How long until the RageAnim is completed; Hack so the server doesn't get stuck in idle when its doing the Rage anim var bool bDoneSpottedCheck; var float RageFrustrationTimer; // Tracks how long we have been walking toward a visible enemy var float RageFrustrationThreshhold; // Base value for how long the FP should walk torward an enemy without reaching them before getting frustrated and raging state ZombieHunt { event SeePlayer(Pawn SeenPlayer) { if ( !bDoneSpottedCheck && PlayerController(SeenPlayer.Controller) != none ) { // 25% chance of first player to see this Fleshpound saying something if ( !KFGameType(Level.Game).bDidSpottedFleshpoundMessage && FRand() < 0.25 ) { PlayerController(SeenPlayer.Controller).Speech('AUTO', 12, ""); KFGameType(Level.Game).bDidSpottedFleshpoundMessage = true; } bDoneSpottedCheck = true; } super.SeePlayer(SeenPlayer); } } function TimedFireWeaponAtEnemy() { if ( (Enemy == None) || FireWeaponAt(Enemy) ) SetCombatTimer(); else SetTimer(0.01, True); } state SpinAttack { ignores EnemyNotVisible; // Don't do this in this state function GetOutOfTheWayOfShot(vector ShotDirection, vector ShotOrigin){} function DoSpinDamage() { local Actor A; //log("FLESHPOUND DOSPINDAMAGE!"); foreach CollidingActors(class'actor', A, (ZombieFleshpound(pawn).MeleeRange * 1.5)+pawn.CollisionRadius, pawn.Location) zombiefleshpound(pawn).SpinDamage(A); } Begin: WaitForAnim: While( KFM.bShotAnim ) { Sleep(0.1); DoSpinDamage(); } WhatToDoNext(152); if ( bSoaking ) SoakStop("STUCK IN SPINATTACK!!!"); } state ZombieCharge { function Tick( float Delta ) { local ZombieFleshPound ZFP; Global.Tick(Delta); // Make the FP rage if we haven't reached our enemy after a certain amount of time if( RageFrustrationTimer < RageFrustrationThreshhold ) { RageFrustrationTimer += Delta; if( RageFrustrationTimer >= RageFrustrationThreshhold ) { ZFP = ZombieFleshPound(Pawn); if( ZFP != none && !ZFP.bChargingPlayer ) { ZFP.StartCharging(); ZFP.bFrustrated = true; } } } } function bool StrafeFromDamage(float Damage, class<DamageType> DamageType, bool bFindDest) { return false; } // I suspect this function causes bloats to get confused function bool TryStrafe(vector sideDir) { return false; } function Timer() { Disable('NotifyBump'); Target = Enemy; TimedFireWeaponAtEnemy(); } function BeginState() { super.BeginState(); RageFrustrationThreshhold = default.RageFrustrationThreshhold + (Frand() * 5); RageFrustrationTimer = 0; } WaitForAnim: if ( Monster(Pawn).bShotAnim ) { Goto('Moving'); } if ( !FindBestPathToward(Enemy, false,true) ) GotoState('ZombieRestFormation'); Moving: MoveToward(Enemy); WhatToDoNext(17); if ( bSoaking ) SoakStop("STUCK IN CHARGING!"); } // Used to set a timeout for the WaitForAnim state. This is a bit of a hack fix // for the FleshPound getting stuck in its idle anim on a dedicated server when it // is supposed to be raging. For some reason, on a dedicated server only, it // never gets an animend call for the PoundRage anim, instead the anim gets // interrupted by the PoundIdle anim. If we figure that bug out, we can // probably take this out in the future. But for now the fix works - Ramm function SetPoundRageTimout(float NewRageTimeOut) { RageAnimTimeout = NewRageTimeOut; } state WaitForAnim { Ignores SeePlayer,HearNoise,Timer,EnemyNotVisible,NotifyBump; // Don't do this in this state function GetOutOfTheWayOfShot(vector ShotDirection, vector ShotOrigin){} function BeginState() { bUseFreezeHack = False; } // The rage anim has ended, clear the flags and let the AI do its thing function RageTimeout() { if( bUseFreezeHack ) { if( Pawn!=None ) { Pawn.AccelRate = Pawn.Default.AccelRate; Pawn.GroundSpeed = Pawn.Default.GroundSpeed; } bUseFreezeHack = False; AnimEnd(0); } } function Tick( float Delta ) { Global.Tick(Delta); if( RageAnimTimeout > 0 ) { RageAnimTimeout -= Delta; if( RageAnimTimeout <= 0 ) { RageAnimTimeout = 0; RageTimeout(); } } if( bUseFreezeHack ) { MoveTarget = None; MoveTimer = -1; Pawn.Acceleration = vect(0,0,0); Pawn.GroundSpeed = 1; Pawn.AccelRate = 0; } } function EndState() { if( Pawn!=None ) { Pawn.AccelRate = Pawn.Default.AccelRate; Pawn.GroundSpeed = Pawn.Default.GroundSpeed; } bUseFreezeHack = False; } Begin: While( KFM.bShotAnim ) { Sleep(0.15); } WhatToDoNext(99); } defaultproperties { RageFrustrationThreshhold=10.000000 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |