-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e07b313
commit cbb84f3
Showing
7 changed files
with
1,025 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
class AdvSawZombieController extends KFMonsterController; | ||
// Custom Zombie Thinkerating | ||
// By : Alex | ||
|
||
var bool bDoneSpottedCheck; | ||
var bool bFacingTarget; | ||
|
||
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); | ||
} | ||
|
||
function bool FireWeaponAt(Actor A) { | ||
local vector aFacing, aToB, TargetFacing, BToa; | ||
local float RelativeDir, TargetRelativeDir; | ||
|
||
if (A == none) { | ||
A = Enemy; | ||
} | ||
if (A == none || Focus != A) { | ||
return false; | ||
} | ||
|
||
if (VSize(Pawn.Location - A.Location) < 300) { | ||
aFacing = Normal(Vector(Pawn.Rotation)); | ||
TargetFacing = Normal(Vector(A.Rotation)); | ||
|
||
// Get the vector from A to B | ||
aToB = A.Location - Pawn.Location; | ||
BToa = Pawn.Location - A.Location; | ||
|
||
RelativeDir = aFacing dot aToB; | ||
TargetRelativeDir = TargetFacing dot BToa; | ||
|
||
if (RelativeDir < -15) { | ||
bFacingTarget = false; | ||
} else { | ||
bFacingTarget = true; | ||
} | ||
} | ||
|
||
if (CanAttack(A)) { | ||
Target = A; | ||
Monster(Pawn).RangedAttack(Target); | ||
} | ||
return false; | ||
} | ||
|
||
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 { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.