64 lines
1.7 KiB
Ucode
64 lines
1.7 KiB
Ucode
class NiceZombieScrakeController extends NiceMonsterController;
|
|
// Custom Zombie Thinkerating
|
|
// By : Alex
|
|
var bool bDoneSpottedCheck;
|
|
// Never do that, you too cool
|
|
function GetOutOfTheWayOfShot(vector ShotDirection, vector ShotOrigin){}
|
|
state ZombieHunt
|
|
{
|
|
event SeePlayer(Pawn SeenPlayer)
|
|
{
|
|
if ( !bDoneSpottedCheck && PlayerController(SeenPlayer.Controller) != none )
|
|
{
|
|
// 25% chance of first player to see this Scrake saying something
|
|
if ( !KFGameType(Level.Game).bDidSpottedScrakeMessage && FRand() < 0.25 )
|
|
{
|
|
PlayerController(SeenPlayer.Controller).Speech('AUTO', 14, "");
|
|
KFGameType(Level.Game).bDidSpottedScrakeMessage = true;
|
|
}
|
|
|
|
bDoneSpottedCheck = true;
|
|
}
|
|
|
|
super.SeePlayer(SeenPlayer);
|
|
}
|
|
}
|
|
function TimedFireWeaponAtEnemy()
|
|
{
|
|
if ( (Enemy == none) || FireWeaponAt(Enemy) )
|
|
SetCombatTimer();
|
|
else SetTimer(0.01, True);
|
|
}
|
|
state ZombieCharge
|
|
{
|
|
// Don't do this in this state
|
|
function GetOutOfTheWayOfShot(vector ShotDirection, vector ShotOrigin){}
|
|
function bool StrafeFromDamage(float Damage, class<DamageType> DamageType, bool bFindDest)
|
|
{
|
|
return false;
|
|
}
|
|
function bool TryStrafe(vector sideDir)
|
|
{
|
|
return false;
|
|
}
|
|
function Timer()
|
|
{
|
|
Disable('NotifyBump');
|
|
Target = Enemy;
|
|
TimedFireWeaponAtEnemy();
|
|
}
|
|
WaitForAnim:
|
|
While( Monster(Pawn).bShotAnim )
|
|
Sleep(0.25);
|
|
if ( !FindBestPathToward(Enemy, false,true) )
|
|
GotoState('ZombieRestFormation');
|
|
Moving:
|
|
MoveToward(Enemy);
|
|
WhatToDoNext(17);
|
|
if ( bSoaking )
|
|
SoakStop("STUCK IN CHARGING!");
|
|
}
|
|
defaultproperties
|
|
{
|
|
}
|