Buff enforcer

This commit is contained in:
Anton Tarasenko 2023-01-23 02:03:36 +07:00
commit 2135c0b46b
20 changed files with 288 additions and 156 deletions

View file

@ -1098,21 +1098,35 @@ function DealBodyDamage(int damage,
MakeNoise(1.0);
}
function Died( Controller killer,
function Died( Controller killer,
class<DamageType> damageType,
vector HitLocation)
{
local bool bHasManiac;
local NiceHumanPawn nicePawn;
local bool bHasManiac;
local NiceHumanPawn nicePawn;
local class<NiceVeterancyTypes> niceVet;
if (killer != none || (Controller != none && killer != Controller))
{
// Maniac stuff
bHasManiac = class'NiceVeterancyTypes'.static.
HasSkill(NicePlayerController(killer), class'NiceSkillDemoManiac');
nicePawn = NiceHumanPawn(killer.pawn);
if (bHasManiac && nicePawn != none)
nicePawn.maniacTimeout =
class'NiceSkillDemoManiac'.default.reloadBoostTime;
// Enforcer's invincibility
if (nicePawn != none)
{
niceVet = class'NiceVeterancyTypes'.static.
GetVeterancy(nicePawn.playerReplicationInfo);
}
if ( niceVet != none
&& niceVet == class'NiceVetEnforcer'
&& nicePawn.invincibilityTimer > 0)
{
nicePawn.invincibilityTimer += default.healthMax / 500.0;
}
}
super.Died(killer, damageType, HitLocation);

View file

@ -14,6 +14,9 @@
// E-mail: dkanus@gmail.com
//==============================================================================
class NiceMonsterController extends KFMonsterController;
var float startleTimeLeft;
// Just reset threat assesment flag, since it's not used in NicePack
function PostBeginPlay(){
super.PostBeginPlay();
@ -34,12 +37,35 @@ event bool NotifyBump(Actor other){
CancelCampFor(otherPawn.controller);
return false;
}
function Startle(Actor Feared)
{
if ( Monster(Pawn) != none)
{
GoalString = "STARTLED!";
StartleActor = Feared;
GotoState('Startled');
}
}
function StartleFor(Actor feared, float startleDuration)
{
startleTimeLeft = startleDuration;
Startle(feared);
}
state Startled{
ignores EnemyNotVisible,SeePlayer,HearNoise;
function Startle(Actor Feared){
goalString = "STARTLED!";
startleActor = feared;
BeginState();
function Startle(Actor feared)
{
goalString = "STARTLED!";
startleActor = feared;
BeginState();
}
function StartleFor(Actor feared, float startleDuration)
{
startleTimeLeft = startleDuration;
Startle(feared);
}
function BeginState(){
if(startleActor == none){
@ -55,7 +81,7 @@ state Startled{
pawn.acceleration = pawn.accelRate * Normal(pawn.acceleration);
}
Begin:
if( NiceHumanPawn(StartleActor) == none
/*if( NiceHumanPawn(StartleActor) == none
|| KFGameType(Level.Game) == none
|| KFGameType(Level.Game).bZEDTimeActive ){
Sleep(0.5);
@ -64,6 +90,14 @@ Begin:
else{
Sleep(0.25);
Goto('Begin');
}*/
startleTimeLeft -= 0.5;
if (startleTimeLeft <= 0) {
WhatToDoNext(11);
}
else {
Sleep(0.5);
Goto('Begin');
}
}
function bool IsMonsterDecapitated(){