Skip to content

Commit

Permalink
scrake update wip
Browse files Browse the repository at this point in the history
  • Loading branch information
theengineertcr committed Nov 4, 2023
1 parent e07b313 commit cbb84f3
Show file tree
Hide file tree
Showing 7 changed files with 1,025 additions and 55 deletions.
96 changes: 96 additions & 0 deletions Classes/AdvSawZombieController.uc
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 {
}
2 changes: 1 addition & 1 deletion Classes/AdvZombieHusk.uc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AdvZombieHusk extends AdvZombieHuskBase
Add an avoidmarker that stretches out infront of this zed so others don't cross his line of fire(excludes big zeds)
Make immune to self damage from flamethrower
Flamethrower tendril explodes in a larger radius at closer range
Doesn't attack when Fleshpound/Scrake is near players
Doesn't attack when Fleshpound/Scrake is near him
*/

Expand Down
Loading

0 comments on commit cbb84f3

Please sign in to comment.