Prepare fixtures
This commit is contained in:
parent
797e5ea192
commit
9c94356263
6021 changed files with 722805 additions and 22 deletions
57
kf_sources/KFPatcher/Classes/Mut.uc
Normal file
57
kf_sources/KFPatcher/Classes/Mut.uc
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
class Mut extends Mutator
|
||||
config(KFPatcher);
|
||||
|
||||
|
||||
//=============================================================================
|
||||
struct FunctionRecord
|
||||
{
|
||||
var config string Info, Replace, With;
|
||||
};
|
||||
var config array<FunctionRecord> List;
|
||||
|
||||
|
||||
//=============================================================================
|
||||
event PreBeginPlay()
|
||||
{
|
||||
super.PreBeginPlay();
|
||||
|
||||
// temp hack fix for tosscahs!
|
||||
class'stub_Pawn'.default.cashtimer = 0.0f;
|
||||
|
||||
// replacing vanilla functions with ours
|
||||
ReplaceFunctions();
|
||||
}
|
||||
|
||||
|
||||
final function ReplaceFunctions()
|
||||
{
|
||||
local uFunction A, B;
|
||||
local int i;
|
||||
|
||||
for (i = 0; i < List.Length; i++)
|
||||
{
|
||||
// This removes the need to declare variables for every new class we make.
|
||||
DynamicLoadObject(class.outer.name $ "." $ Left(List[i].With,InStr(List[i].With,".")), class'class', true);
|
||||
|
||||
A = class'UFunction'.static.CastFunction(FindObject(List[i].Replace, class'function'));
|
||||
B = class'UFunction'.static.CastFunction(FindObject(List[i].With, class'function'));
|
||||
|
||||
if (A == none)
|
||||
{
|
||||
log("> Failed to process " $ List[i].Replace);
|
||||
continue;
|
||||
}
|
||||
if (B == none)
|
||||
{
|
||||
log("> Failed to process " $ List[i].With);
|
||||
continue;
|
||||
}
|
||||
|
||||
A.Script = B.Script;
|
||||
log("> Processing: " $ List[i].Replace $ " ----> " $ List[i].With);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
defaultproperties{}
|
||||
36
kf_sources/KFPatcher/Classes/index.html
Normal file
36
kf_sources/KFPatcher/Classes/index.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<html>
|
||||
<head><title>Index of /kf_sources/KFPatcher/Classes/</title></head>
|
||||
<body>
|
||||
<h1>Index of /kf_sources/KFPatcher/Classes/</h1><hr><pre><a href="../">../</a>
|
||||
<a href="Mut.uc">Mut.uc</a> 28-Jun-2021 13:12 1468
|
||||
<a href="o_Helper.uc">o_Helper.uc</a> 28-Jun-2021 13:12 12444
|
||||
<a href="o_Settings.uc">o_Settings.uc</a> 28-Jun-2021 13:12 460
|
||||
<a href="stub_CashPickup.uc">stub_CashPickup.uc</a> 28-Jun-2021 13:12 1111
|
||||
<a href="stub_Door.uc">stub_Door.uc</a> 28-Jun-2021 13:12 645
|
||||
<a href="stub_DualPistol.uc">stub_DualPistol.uc</a> 28-Jun-2021 13:12 4181
|
||||
<a href="stub_DualiesFire.uc">stub_DualiesFire.uc</a> 28-Jun-2021 13:12 3893
|
||||
<a href="stub_FPAvoidArea.uc">stub_FPAvoidArea.uc</a> 28-Jun-2021 13:12 707
|
||||
<a href="stub_FragFire.uc">stub_FragFire.uc</a> 28-Jun-2021 13:12 1335
|
||||
<a href="stub_GT.uc">stub_GT.uc</a> 28-Jun-2021 13:12 40445
|
||||
<a href="stub_KFWeaponPickup.uc">stub_KFWeaponPickup.uc</a> 28-Jun-2021 13:12 331
|
||||
<a href="stub_LAWProj.uc">stub_LAWProj.uc</a> 28-Jun-2021 13:12 2590
|
||||
<a href="stub_ModelSelect.uc">stub_ModelSelect.uc</a> 28-Jun-2021 13:12 4475
|
||||
<a href="stub_Monster.uc">stub_Monster.uc</a> 28-Jun-2021 13:12 17407
|
||||
<a href="stub_Nade.uc">stub_Nade.uc</a> 28-Jun-2021 13:12 1432
|
||||
<a href="stub_PC.uc">stub_PC.uc</a> 28-Jun-2021 13:12 6972
|
||||
<a href="stub_P_Shotgun.uc">stub_P_Shotgun.uc</a> 28-Jun-2021 13:12 2607
|
||||
<a href="stub_Pawn.uc">stub_Pawn.uc</a> 28-Jun-2021 13:12 9823
|
||||
<a href="stub_Pipe.uc">stub_Pipe.uc</a> 28-Jun-2021 13:12 5730
|
||||
<a href="stub_Rule.uc">stub_Rule.uc</a> 28-Jun-2021 13:12 328
|
||||
<a href="stub_ShopVolume.uc">stub_ShopVolume.uc</a> 28-Jun-2021 13:12 4322
|
||||
<a href="stub_Syringe.uc">stub_Syringe.uc</a> 28-Jun-2021 13:12 560
|
||||
<a href="stub_VotingHandler.uc">stub_VotingHandler.uc</a> 28-Jun-2021 13:12 5484
|
||||
<a href="stub_VotingReplicationInfo.uc">stub_VotingReplicationInfo.uc</a> 28-Jun-2021 13:12 391
|
||||
<a href="stub_Z_Bloat.uc">stub_Z_Bloat.uc</a> 28-Jun-2021 13:12 1576
|
||||
<a href="stub_Z_Boss.uc">stub_Z_Boss.uc</a> 28-Jun-2021 13:12 5725
|
||||
<a href="stub_Z_Husk.uc">stub_Z_Husk.uc</a> 28-Jun-2021 13:12 2500
|
||||
<a href="stub_Z_Scrake.uc">stub_Z_Scrake.uc</a> 28-Jun-2021 13:12 3703
|
||||
<a href="stub_Z_Scrake_Ctrl.uc">stub_Z_Scrake_Ctrl.uc</a> 28-Jun-2021 13:12 230
|
||||
<a href="stub_Z_Siren.uc">stub_Z_Siren.uc</a> 28-Jun-2021 13:12 2460
|
||||
</pre><hr></body>
|
||||
</html>
|
||||
BIN
kf_sources/KFPatcher/Classes/o_Helper.uc
Normal file
BIN
kf_sources/KFPatcher/Classes/o_Helper.uc
Normal file
Binary file not shown.
21
kf_sources/KFPatcher/Classes/o_Settings.uc
Normal file
21
kf_sources/KFPatcher/Classes/o_Settings.uc
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
class o_Settings extends object
|
||||
config(KFPatcher);
|
||||
|
||||
|
||||
var() config bool bBuyEverywhere;
|
||||
|
||||
// player info
|
||||
var() config string sAlive, sDead, sSpectator, sReady, sNotReady, sAwaiting;
|
||||
var() config string sTagHP, sTagKills;
|
||||
var() config bool bShowPerk;
|
||||
var() config float fRefreshTime;
|
||||
|
||||
// zedtime
|
||||
var() config bool bAllowZedTime;
|
||||
|
||||
// all traders
|
||||
var() config bool bAllTradersOpen;
|
||||
var() config string bAllTradersMessage;
|
||||
|
||||
|
||||
defaultproperties{}
|
||||
25
kf_sources/KFPatcher/Classes/stub_CashPickup.uc
Normal file
25
kf_sources/KFPatcher/Classes/stub_CashPickup.uc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
class stub_CashPickup extends CashPickup;
|
||||
|
||||
|
||||
function GiveCashTo( Pawn Other )
|
||||
{
|
||||
// mental-mad typecasting one love from TWI
|
||||
if (!bDroppedCash)
|
||||
CashAmount = (rand(0.5 * default.CashAmount) + default.CashAmount) * (KFGameReplicationInfo(Level.GRI).GameDiff * 0.5) ;
|
||||
|
||||
// FIX!
|
||||
// added DroppedBy none check
|
||||
else if ( Other.PlayerReplicationInfo != none && DroppedBy != none && DroppedBy.PlayerReplicationInfo != none &&
|
||||
((DroppedBy.PlayerReplicationInfo.Score + float(CashAmount)) / Other.PlayerReplicationInfo.Score) >= 0.50 &&
|
||||
PlayerController(DroppedBy) != none && KFSteamStatsAndAchievements(PlayerController(DroppedBy).SteamStatsAndAchievements) != none )
|
||||
{
|
||||
if (Other.PlayerReplicationInfo != DroppedBy.PlayerReplicationInfo)
|
||||
KFSteamStatsAndAchievements(PlayerController(DroppedBy).SteamStatsAndAchievements).AddDonatedCash(CashAmount);
|
||||
}
|
||||
|
||||
if (Other.Controller != none && Other.Controller.PlayerReplicationInfo != none)
|
||||
Other.Controller.PlayerReplicationInfo.Score += CashAmount;
|
||||
|
||||
AnnouncePickup(Other);
|
||||
SetRespawn();
|
||||
}
|
||||
24
kf_sources/KFPatcher/Classes/stub_Door.uc
Normal file
24
kf_sources/KFPatcher/Classes/stub_Door.uc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
class stub_Door extends KFDoorMover;
|
||||
|
||||
|
||||
// Forces zeds to actually ignore doors instead of just standing at them if bZombiesIgnore is true
|
||||
function Tick(float Delta)
|
||||
{
|
||||
if (DoorPathNode != none && PathUdpTimer < Level.TimeSeconds)
|
||||
{
|
||||
PathUdpTimer = Level.TimeSeconds + 0.5;
|
||||
DoorPathNode.ExtraCost = InitExtraCost;
|
||||
|
||||
if (bSealed && MyTrigger != none)
|
||||
{
|
||||
// Zeds will always ignore the path node associated with this door.
|
||||
if (bZombiesIgnore)
|
||||
DoorPathNode.ExtraCost = 9999999;
|
||||
else
|
||||
DoorPathNode.ExtraCost += 500 + MyTrigger.WeldStrength * 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defaultproperties{}
|
||||
146
kf_sources/KFPatcher/Classes/stub_DualPistol.uc
Normal file
146
kf_sources/KFPatcher/Classes/stub_DualPistol.uc
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
class stub_DualPistol extends DualDeagle;
|
||||
|
||||
|
||||
var KFWeaponPickup WPickup;
|
||||
var KFWeapon SingleKFW;
|
||||
var class<KFWeapon> SingleClass;
|
||||
|
||||
|
||||
function DropFrom(vector StartLocation)
|
||||
{
|
||||
local int m;
|
||||
local Pickup Pickup;
|
||||
// local Inventory I;
|
||||
local int AmmoThrown, OtherAmmo;
|
||||
|
||||
if (!bCanThrow)
|
||||
return;
|
||||
|
||||
AmmoThrown = AmmoAmount(0);
|
||||
ClientWeaponThrown();
|
||||
|
||||
for (m = 0; m < NUM_FIRE_MODES; m++)
|
||||
{
|
||||
if (FireMode[m].bIsFiring)
|
||||
StopFire(m);
|
||||
}
|
||||
|
||||
if (Instigator != none)
|
||||
DetachFromPawn(Instigator);
|
||||
|
||||
if (Instigator.Health > 0)
|
||||
{
|
||||
OtherAmmo = AmmoThrown / 2;
|
||||
AmmoThrown -= OtherAmmo;
|
||||
// CHANGED HERE
|
||||
class'stub_DualPistol'.default.SingleKFW = Instigator.spawn(class'stub_DualPistol'.static.GetSingleWC(self));
|
||||
if (class'stub_DualPistol'.default.SingleKFW != none)
|
||||
{
|
||||
class'stub_DualPistol'.default.SingleKFW.GiveTo(Instigator);
|
||||
class'stub_DualPistol'.default.SingleKFW.Ammo[0].AmmoAmount = OtherAmmo;
|
||||
// cursed TWI does this check only for left ammo
|
||||
MagAmmoRemaining = max(MagAmmoRemaining / 2, 0);
|
||||
class'stub_DualPistol'.default.SingleKFW.MagAmmoRemaining = MagAmmoRemaining;
|
||||
}
|
||||
else
|
||||
log("ALERT!!!!! WEAPON NOT SPAWNED FOR PAWN!!!");
|
||||
// I = spawn(class'stub_DualPistol'.static.GetSingleWC(self));
|
||||
// if (I == none)
|
||||
// log("ALERT!! NO INVENTORY!!!");
|
||||
// I.GiveTo(Instigator);
|
||||
// if (Weapon(I) == none)
|
||||
// log("ALERT!! NO Weapon(I)!!!");
|
||||
// Weapon(I).Ammo[0].AmmoAmount = OtherAmmo;
|
||||
// CHANGED HERE
|
||||
// OLD: Deagle(I).MagAmmoRemaining = MagAmmoRemaining / 2;
|
||||
// if (KFWeapon(I) == none)
|
||||
// log("ALERT!! NO KFWeapon(I)!!!");
|
||||
// KFWeapon(I).MagAmmoRemaining = MagAmmoRemaining / 2;
|
||||
// CHANGED HERE
|
||||
// OLD: MagAmmoRemaining = Max(MagAmmoRemaining - Deagle(I).MagAmmoRemaining, 0);
|
||||
// MagAmmoRemaining = Max(MagAmmoRemaining - KFWeapon(I).MagAmmoRemaining, 0);
|
||||
}
|
||||
|
||||
// CHANGE HERE
|
||||
// OLD: Pickup = spawn(class'DeaglePickup',,, StartLocation);
|
||||
Pickup = spawn(class'stub_DualPistol'.default.SingleKFW.default.PickupClass,,, StartLocation);
|
||||
|
||||
if (Pickup != none)
|
||||
{
|
||||
Pickup.InitDroppedPickupFor(self);
|
||||
Pickup.Velocity = Velocity;
|
||||
WeaponPickup(Pickup).AmmoAmount[0] = AmmoThrown;
|
||||
if (KFWeaponPickup(Pickup) != none)
|
||||
KFWeaponPickup(Pickup).MagAmmoRemaining = MagAmmoRemaining;
|
||||
if (Instigator.Health > 0)
|
||||
WeaponPickup(Pickup).bThrown = true;
|
||||
}
|
||||
|
||||
class'stub_DualPistol'.default.SingleKFW = none;
|
||||
// class'stub_DualPistol'.default.SingleKFW.Destroy();
|
||||
Destroyed();
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
// static final function class<KFWeapon> GetSingleWC(KFWeapon KFWeapon)
|
||||
// {
|
||||
// if (KFWeapon == none)
|
||||
// {
|
||||
// log("Something is VERY WRONG, couldn't find single weapon class for pistol " $ KFWeapon);
|
||||
// // drop beretas as a fail safe
|
||||
// return class'Single';
|
||||
// }
|
||||
|
||||
// switch (KFWeapon.class.name)
|
||||
// {
|
||||
// case 'Dualies':
|
||||
// return class'Single';
|
||||
// case 'DualDeagle':
|
||||
// return class'Deagle';
|
||||
// case 'GoldenDualDeagle':
|
||||
// return class'GoldenDeagle';
|
||||
// case 'Dual44Magnum':
|
||||
// return class'Magnum44Pistol';
|
||||
// case 'DualMK23Pistol':
|
||||
// return class'MK23Pistol';
|
||||
// case 'DualFlareRevolver':
|
||||
// return class'FlareRevolver';
|
||||
// }
|
||||
// }
|
||||
|
||||
static final function class<KFWeapon> GetSingleWC(KFWeapon KFWeapon)
|
||||
{
|
||||
if (KFWeapon == none)
|
||||
{
|
||||
log("Something is VERY WRONG, couldn't find single weapon class for pistol " $ KFWeapon);
|
||||
// drop beretas as a fail safe
|
||||
return class'Single';
|
||||
}
|
||||
|
||||
switch (KFWeapon.class.name)
|
||||
{
|
||||
case 'Dualies':
|
||||
return class'Single';
|
||||
case 'DualDeagle':
|
||||
return class'Deagle';
|
||||
case 'GoldenDualDeagle':
|
||||
return class'GoldenDeagle';
|
||||
case 'Dual44Magnum':
|
||||
return class'Magnum44Pistol';
|
||||
case 'DualMK23Pistol':
|
||||
return class'MK23Pistol';
|
||||
case 'DualFlareRevolver':
|
||||
return class'FlareRevolver';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// allow variants of weapons to be picked up
|
||||
function bool HandlePickupQuery(pickup Item)
|
||||
{
|
||||
return super(Weapon).HandlePickupQuery(Item);
|
||||
}
|
||||
|
||||
|
||||
defaultproperties{}
|
||||
131
kf_sources/KFPatcher/Classes/stub_DualiesFire.uc
Normal file
131
kf_sources/KFPatcher/Classes/stub_DualiesFire.uc
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
class stub_DualiesFire extends DualiesFire;
|
||||
|
||||
|
||||
var int penValue;
|
||||
|
||||
|
||||
function DoTrace(Vector Start, Rotator Dir)
|
||||
{
|
||||
local Vector X,Y,Z, End, HitLocation, HitNormal, ArcEnd;
|
||||
local Actor Other;
|
||||
local byte HitCount,HCounter;
|
||||
local float HitDamage;
|
||||
local array<int> HitPoints;
|
||||
local KFPawn HitPawn;
|
||||
local array<Actor> IgnoreActors;
|
||||
local Actor DamageActor;
|
||||
local int i;
|
||||
|
||||
MaxRange();
|
||||
|
||||
Weapon.GetViewAxes(X, Y, Z);
|
||||
if ( Weapon.WeaponCentered() )
|
||||
{
|
||||
ArcEnd = (Instigator.Location + Weapon.EffectOffset.X * X + 1.5 * Weapon.EffectOffset.Z * Z);
|
||||
}
|
||||
else
|
||||
{
|
||||
ArcEnd = (Instigator.Location + Instigator.CalcDrawOffset(Weapon) + Weapon.EffectOffset.X * X +
|
||||
Weapon.Hand * Weapon.EffectOffset.Y * Y + Weapon.EffectOffset.Z * Z);
|
||||
}
|
||||
|
||||
X = Vector(Dir);
|
||||
End = Start + TraceRange * X;
|
||||
HitDamage = DamageMax;
|
||||
|
||||
// MK23Fire, DualMK23Fire = 3
|
||||
// DeagleFire, DualDeagleFire, Magnum44Fire, Dual44MagnumFire = 10
|
||||
if (self.class.name == 'MK23Fire' || self.class.name == 'DualMK23Fire')
|
||||
class'stub_DualiesFire'.default.penValue = 3;
|
||||
else
|
||||
class'stub_DualiesFire'.default.penValue = 10;
|
||||
|
||||
while( (HitCount++) < class'stub_DualiesFire'.default.penValue ) // there was fixed value here per parent class
|
||||
{
|
||||
DamageActor = none;
|
||||
|
||||
Other = Instigator.HitPointTrace(HitLocation, HitNormal, End, HitPoints, Start,, 1);
|
||||
if( Other==None )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if( Other==Instigator || Other.Base == Instigator )
|
||||
{
|
||||
IgnoreActors[IgnoreActors.Length] = Other;
|
||||
Other.SetCollision(false);
|
||||
Start = HitLocation;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( ExtendedZCollision(Other)!=None && Other.Owner!=None )
|
||||
{
|
||||
IgnoreActors[IgnoreActors.Length] = Other;
|
||||
IgnoreActors[IgnoreActors.Length] = Other.Owner;
|
||||
Other.SetCollision(false);
|
||||
Other.Owner.SetCollision(false);
|
||||
DamageActor = Pawn(Other.Owner);
|
||||
}
|
||||
|
||||
if ( !Other.bWorldGeometry && Other!=Level )
|
||||
{
|
||||
HitPawn = KFPawn(Other);
|
||||
|
||||
if ( HitPawn != none )
|
||||
{
|
||||
// Hit detection debugging
|
||||
/*log("PreLaunchTrace hit "$HitPawn.PlayerReplicationInfo.PlayerName);
|
||||
HitPawn.HitStart = Start;
|
||||
HitPawn.HitEnd = End;*/
|
||||
if(!HitPawn.bDeleteMe)
|
||||
HitPawn.ProcessLocationalDamage(int(HitDamage), Instigator, HitLocation, Momentum*X,DamageType,HitPoints);
|
||||
|
||||
// Hit detection debugging
|
||||
/*if( Level.NetMode == NM_Standalone)
|
||||
HitPawn.DrawBoneLocation();*/
|
||||
|
||||
IgnoreActors[IgnoreActors.Length] = Other;
|
||||
IgnoreActors[IgnoreActors.Length] = HitPawn.AuxCollisionCylinder;
|
||||
Other.SetCollision(false);
|
||||
HitPawn.AuxCollisionCylinder.SetCollision(false);
|
||||
DamageActor = Other;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( KFMonster(Other)!=None )
|
||||
{
|
||||
IgnoreActors[IgnoreActors.Length] = Other;
|
||||
Other.SetCollision(false);
|
||||
DamageActor = Other;
|
||||
}
|
||||
else if ( DamageActor == none )
|
||||
{
|
||||
DamageActor = Other;
|
||||
}
|
||||
Other.TakeDamage(int(HitDamage), Instigator, HitLocation, Momentum*X, DamageType);
|
||||
}
|
||||
if ( (HCounter++) >= 4 || Pawn(DamageActor) == None )
|
||||
{
|
||||
break;
|
||||
}
|
||||
HitDamage/=2;
|
||||
Start = HitLocation;
|
||||
}
|
||||
else if ( HitScanBlockingVolume(Other) == None )
|
||||
{
|
||||
if ( KFWeaponAttachment(Weapon.ThirdPersonActor) != none )
|
||||
KFWeaponAttachment(Weapon.ThirdPersonActor).UpdateHit(Other,HitLocation,HitNormal);
|
||||
Break;
|
||||
}
|
||||
}
|
||||
|
||||
// Turn the collision back on for any actors we turned it off
|
||||
// FIXED accessed none IgnoreActors !
|
||||
if (IgnoreActors.Length <= 0)
|
||||
return;
|
||||
|
||||
for (i=0; i<IgnoreActors.Length; i++)
|
||||
{
|
||||
if (IgnoreActors[i] != none)
|
||||
IgnoreActors[i].SetCollision(true);
|
||||
}
|
||||
}
|
||||
20
kf_sources/KFPatcher/Classes/stub_FPAvoidArea.uc
Normal file
20
kf_sources/KFPatcher/Classes/stub_FPAvoidArea.uc
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class stub_FPAvoidArea extends FleshPoundAvoidArea;
|
||||
|
||||
|
||||
// added KFMonsterController check
|
||||
function Touch(actor Other)
|
||||
{
|
||||
if ((Pawn(Other) != none) && KFMonsterController(Pawn(Other).Controller) != none && RelevantTo(Pawn(Other)))
|
||||
KFMonsterController(Pawn(Other).Controller).AvoidThisMonster(KFMonst);
|
||||
}
|
||||
|
||||
|
||||
// added health check, 1500 is FP's base health
|
||||
function bool RelevantTo(Pawn P)
|
||||
{
|
||||
if (KFMonster(p) != none && KFMonster(p).default.Health >= 1500) // || KFMonster(p).IsInState('')) )
|
||||
return false;
|
||||
|
||||
return ( KFMonst != none && VSizeSquared(KFMonst.Velocity) >= 75 && super(AvoidMarker).RelevantTo(P)
|
||||
&& KFMonst.Velocity dot (P.Location - KFMonst.Location) > 0 );
|
||||
}
|
||||
43
kf_sources/KFPatcher/Classes/stub_FragFire.uc
Normal file
43
kf_sources/KFPatcher/Classes/stub_FragFire.uc
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
class stub_FragFire extends FragFire;
|
||||
|
||||
|
||||
var transient float PrevAmmo;
|
||||
|
||||
|
||||
function DoFireEffect()
|
||||
{
|
||||
local float MaxAmmo, CurAmmo;
|
||||
local Vector StartProj, StartTrace, X,Y,Z;
|
||||
local Rotator Aim;
|
||||
local Vector HitLocation, HitNormal;
|
||||
local Actor Other;
|
||||
local int Hand;
|
||||
|
||||
// added working ammo check
|
||||
Weapon.GetAmmoCount(MaxAmmo,CurAmmo);
|
||||
if (CurAmmo == 0 && class'stub_FragFire'.default.PrevAmmo == 0)
|
||||
return;
|
||||
class'stub_FragFire'.default.PrevAmmo = CurAmmo;
|
||||
|
||||
Instigator.MakeNoise(1.0);
|
||||
Weapon.GetViewAxes(X,Y,Z);
|
||||
|
||||
StartTrace = Instigator.Location + Instigator.EyePosition();// + X*Instigator.CollisionRadius;
|
||||
StartProj = StartTrace + X*ProjSpawnOffset.X;
|
||||
|
||||
if( PlayerController(Instigator.Controller)!=None )
|
||||
{ // We must do this as server dosen't get a chance to set weapon handedness.
|
||||
Hand = int(PlayerController(Instigator.Controller).Handedness);
|
||||
if( Hand==-1 || Hand==1 )
|
||||
StartProj = StartProj + Hand * Y*ProjSpawnOffset.Y + Z*ProjSpawnOffset.Z;
|
||||
}
|
||||
|
||||
// check if projectile would spawn through a wall and adjust start location accordingly
|
||||
Other = Weapon.Trace(HitLocation, HitNormal, StartProj, StartTrace, false);
|
||||
if (Other != None)
|
||||
StartProj = HitLocation;
|
||||
|
||||
Aim = AdjustAim(StartProj, AimError);
|
||||
|
||||
SpawnProjectile(StartProj, Aim);
|
||||
}
|
||||
1338
kf_sources/KFPatcher/Classes/stub_GT.uc
Normal file
1338
kf_sources/KFPatcher/Classes/stub_GT.uc
Normal file
File diff suppressed because it is too large
Load diff
11
kf_sources/KFPatcher/Classes/stub_KFWeaponPickup.uc
Normal file
11
kf_sources/KFPatcher/Classes/stub_KFWeaponPickup.uc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class stub_KFWeaponPickup extends KFWeaponPickup;
|
||||
|
||||
|
||||
// fix accessed none Inventory for destroyed weapon pickups
|
||||
function Destroyed()
|
||||
{
|
||||
if ( bDropped && Inventory != none && KFGameType(Level.Game) != none )
|
||||
KFGameType(Level.Game).WeaponDestroyed(class<Weapon>(Inventory.Class));
|
||||
|
||||
super(WeaponPickup).Destroyed();
|
||||
}
|
||||
72
kf_sources/KFPatcher/Classes/stub_LAWProj.uc
Normal file
72
kf_sources/KFPatcher/Classes/stub_LAWProj.uc
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
class stub_LAWProj extends LAWProj;
|
||||
|
||||
|
||||
// removed SirenScream damage type check since 90% of the time they don't disentigrate anyway...
|
||||
// also prevents detonation from fire or other explosives
|
||||
function TakeDamage(int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex)
|
||||
{
|
||||
if(!bDud
|
||||
&& DamageType != class'DamTypeFlamethrower'
|
||||
&& DamageType != class'DamTypeFrag'
|
||||
&& DamageType != class'DamTypeLaw'
|
||||
&& DamageType != class'DamTypeM203Grenade'
|
||||
&& DamageType != class'DamTypeM32Grenade'
|
||||
&& DamageType != class'DamTypeM79Grenade'
|
||||
&& DamageType != class'DamTypePipeBomb'
|
||||
&& DamageType != class'DamTypeSealSquealExplosion'
|
||||
&& DamageType != class'DamTypeSeekerSixRocket'
|
||||
&& DamageType != class'DamTypeSPGrenade'
|
||||
&& DamageType != class'SirenScreamDamage'
|
||||
&& !ClassIsChildOf(damageType, class'DamTypeBurned'))
|
||||
{
|
||||
Explode(HitLocation, vect(0,0,0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// RepInfo == none fix
|
||||
simulated function ProcessTouch(Actor Other, Vector HitLocation)
|
||||
{
|
||||
// Don't let it hit this player, or blow up on another player
|
||||
// added bBlockHitPointTraces check
|
||||
if (Other == none || Other == Instigator || Other.Base == Instigator || !Other.bBlockHitPointTraces)
|
||||
return;
|
||||
|
||||
// Don't collide with bullet whip attachments
|
||||
if (KFBulletWhipAttachment(Other) != none)
|
||||
return;
|
||||
|
||||
// Don't allow hits on poeple on the same team
|
||||
// fixing RepInfo == none error, and using KFPawn instead of KFHumanPawn
|
||||
if (KFPawn(Other) != none && Instigator != none && KFPawn(Other).GetTeamNum() == Instigator.GetTeamNum())
|
||||
return;
|
||||
|
||||
// Use the instigator's location if it exists. This fixes issues with
|
||||
// the original location of the projectile being really far away from
|
||||
// the real Origloc due to it taking a couple of milliseconds to
|
||||
// replicate the location to the client and the first replicated location has
|
||||
// already moved quite a bit.
|
||||
if (Instigator != none)
|
||||
OrigLoc = Instigator.Location;
|
||||
|
||||
if (!bDud && ((VSizeSquared(Location - OrigLoc) < ArmDistSquared) || OrigLoc == vect(0,0,0)))
|
||||
{
|
||||
if( Role == ROLE_Authority )
|
||||
{
|
||||
AmbientSound = none;
|
||||
PlaySound(sound'ProjectileSounds.PTRD_deflect04',,2.0);
|
||||
Other.TakeDamage(ImpactDamage, Instigator, HitLocation, Normal(Velocity), ImpactDamageType);
|
||||
}
|
||||
|
||||
bDud = true;
|
||||
Velocity = vect(0,0,0);
|
||||
LifeSpan = 1.0;
|
||||
SetPhysics(PHYS_Falling);
|
||||
}
|
||||
|
||||
if (!bDud)
|
||||
Explode(HitLocation,Normal(HitLocation-Other.Location));
|
||||
}
|
||||
|
||||
|
||||
defaultproperties{}
|
||||
169
kf_sources/KFPatcher/Classes/stub_ModelSelect.uc
Normal file
169
kf_sources/KFPatcher/Classes/stub_ModelSelect.uc
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
class stub_ModelSelect extends KFModelSelect;
|
||||
|
||||
|
||||
// // Overridden to get rid of the Race combo
|
||||
// function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
// {
|
||||
// super(LockedFloatingWindow).Initcomponent(MyController, MyOwner);
|
||||
|
||||
// sb_Main.SetPosition(0.040000,0.075000,0.680742,0.555859);
|
||||
// sb_Main.RightPadding = 0.5;
|
||||
// sb_Main.ManageComponent(CharList);
|
||||
|
||||
// class'xUtil'.static.GetPlayerList(PlayerList);
|
||||
// RefreshCharacterList("DUP");
|
||||
|
||||
// // Spawn spinning character actor
|
||||
// if ( SpinnyDude == None )
|
||||
// SpinnyDude = PlayerOwner().spawn(class'XInterface.SpinnyWeap');
|
||||
|
||||
// SpinnyDude.SetDrawType(DT_Mesh);
|
||||
// SpinnyDude.SetDrawScale(0.9);
|
||||
// SpinnyDude.SpinRate = 0;
|
||||
// }
|
||||
|
||||
function RefreshCharacterList(string ExcludedChars, optional string Race)
|
||||
{
|
||||
local int i, j;
|
||||
local array<string> Excluded;
|
||||
|
||||
// Prevent list from calling OnChange events
|
||||
CharList.List.bNotify = False;
|
||||
CharList.Clear();
|
||||
|
||||
Split(ExcludedChars, ";", Excluded);
|
||||
for ( i = 0; i < PlayerList.Length; i++ )
|
||||
{
|
||||
// Check that this character is selectable
|
||||
if ( PlayerList[i].Menu != "" )
|
||||
{
|
||||
for (j = 0; j < Excluded.Length; j++)
|
||||
if ( InStr(";" $ Playerlist[i].Menu $ ";", ";" $ Excluded[j] $ ";") != -1 )
|
||||
break;
|
||||
|
||||
if ( j < Excluded.Length )
|
||||
continue;
|
||||
}
|
||||
|
||||
// if ( IsUnLocked(PlayerList[i]) )
|
||||
// {
|
||||
CharList.List.Add(Playerlist[i].Portrait, i, 0);
|
||||
// }
|
||||
// else if ( Playerlist[i].LockedPortrait == none )
|
||||
// {
|
||||
// CharList.List.Add(Playerlist[i].Portrait, i, 1);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// CharList.List.Add(Playerlist[i].LockedPortrait, i, 1);
|
||||
// }
|
||||
}
|
||||
|
||||
CharList.List.LockedMat = LockedImage;
|
||||
CharList.List.bNotify = True;
|
||||
}
|
||||
|
||||
|
||||
function HandleParameters( string Who, string Team )
|
||||
{
|
||||
local int i;
|
||||
|
||||
for ( i = 0; i < PlayerList.Length; i++)
|
||||
{
|
||||
if ( PlayerList[i].DefaultName ~= Who )
|
||||
{
|
||||
CharList.List.SetIndex(CharList.List.FindItem(i));
|
||||
}
|
||||
}
|
||||
|
||||
UpdateSpinnyDude();
|
||||
}
|
||||
|
||||
// // Overridden to set Idle Animation
|
||||
// function UpdateSpinnyDude()
|
||||
// {
|
||||
// local int idx;
|
||||
// local xUtil.PlayerRecord Rec;
|
||||
// local Mesh PlayerMesh;
|
||||
// local Material BodySkin, HeadSkin;
|
||||
// local string BodySkinName, HeadSkinName, TeamSuffix;
|
||||
|
||||
// idx = CharList.List.GetItem();
|
||||
// if ( idx < 0 || idx >= Playerlist.Length )
|
||||
// return;
|
||||
|
||||
// Rec = PlayerList[idx];
|
||||
|
||||
// if (Rec.Race ~= "Juggernaut" || Rec.DefaultName~="Axon" || Rec.DefaultName~="Cyclops" || Rec.DefaultName ~="Virus" )
|
||||
// SpinnyDudeOffset=vect(250.0,1.00,-14.00);
|
||||
// else
|
||||
// SpinnyDudeOffset=vect(250.0,1.00,-24.00);
|
||||
|
||||
// PlayerMesh = Mesh(DynamicLoadObject(Rec.MeshName, class'Mesh'));
|
||||
// if(PlayerMesh == None)
|
||||
// {
|
||||
// Log("Could not load mesh: "$Rec.MeshName$" For player: "$Rec.DefaultName);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // Get the body skin
|
||||
// BodySkinName = Rec.BodySkinName;
|
||||
|
||||
// // Get the head skin
|
||||
// HeadSkinName = Rec.FaceSkinName;
|
||||
// if ( Rec.TeamFace )
|
||||
// HeadSkinName $= TeamSuffix;
|
||||
|
||||
// BodySkin = Material(DynamicLoadObject(BodySkinName, class'Material'));
|
||||
// if(BodySkin == None)
|
||||
// {
|
||||
// Log("Could not load body material: "$Rec.BodySkinName$" For player: "$Rec.DefaultName);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// HeadSkin = Material(DynamicLoadObject(HeadSkinName, class'Material'));
|
||||
// if(HeadSkin == None)
|
||||
// {
|
||||
// Log("Could not load head material: "$HeadSkinName$" For player: "$Rec.DefaultName);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// SpinnyDude.LinkMesh(PlayerMesh);
|
||||
// SpinnyDude.Skins[0] = BodySkin;
|
||||
// SpinnyDude.Skins[1] = HeadSkin;
|
||||
// SpinnyDude.LoopAnim('Profile_idle');
|
||||
// }
|
||||
|
||||
// // Overridden to stop log spam
|
||||
// function PopulateRaces()
|
||||
// {
|
||||
// }
|
||||
|
||||
|
||||
// function HandleLockedCharacterClicked(int NewIndex)
|
||||
// {
|
||||
// if ( PlayerOwner() != none && PlayerOwner().PurchaseCharacter(Playerlist[NewIndex].DefaultName) )
|
||||
// {
|
||||
// Controller.CloseMenu(true);
|
||||
// }
|
||||
// }
|
||||
|
||||
// defaultproperties
|
||||
// {
|
||||
// co_Race=none
|
||||
|
||||
// Begin Object class=KFGUIVertImageListBox name=vil_CharList
|
||||
// bScaleToParent=true
|
||||
// bBoundToParent=true
|
||||
// WinWidth=0.403407
|
||||
// WinHeight=0.658125
|
||||
// WinLeft=0.102888
|
||||
// WinTop=0.185119
|
||||
// CellStyle=Cell_FixedCount
|
||||
// NoVisibleRows=3
|
||||
// NoVisibleCols=4
|
||||
// TabOrder=0
|
||||
// OnChange=ListChange
|
||||
// End Object
|
||||
// CharList=vil_CharList
|
||||
// }
|
||||
503
kf_sources/KFPatcher/Classes/stub_Monster.uc
Normal file
503
kf_sources/KFPatcher/Classes/stub_Monster.uc
Normal file
|
|
@ -0,0 +1,503 @@
|
|||
class stub_Monster extends KFMonster;
|
||||
|
||||
|
||||
var transient float fLastAttackTime;
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// controller == none fix
|
||||
//=============================================================================
|
||||
|
||||
// when you kill zeds before they fall into stun
|
||||
// should i check it before whole function body??
|
||||
function bool FlipOver()
|
||||
{
|
||||
if (Physics == PHYS_Falling)
|
||||
SetPhysics(PHYS_Walking);
|
||||
|
||||
bShotAnim = true;
|
||||
SetAnimAction('KnockDown');
|
||||
Acceleration = vect(0, 0, 0);
|
||||
Velocity.X = 0;
|
||||
Velocity.Y = 0;
|
||||
|
||||
// fix!
|
||||
if (Controller != none && KFMonsterController(Controller) != none)
|
||||
{
|
||||
Controller.GoToState('WaitForAnim');
|
||||
KFMonsterController(Controller).bUseFreezeHack = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
simulated function HandleBumpGlass()
|
||||
{
|
||||
Acceleration = vect(0,0,0);
|
||||
Velocity = vect(0,0,0);
|
||||
|
||||
SetAnimAction(MeleeAnims[0]);
|
||||
bShotAnim = true;
|
||||
|
||||
// fix!
|
||||
if (Controller != none)
|
||||
controller.GotoState('WaitForAnim');
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// instigatedBy == none fix
|
||||
//=============================================================================
|
||||
|
||||
function TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, class<DamageType> damageType, optional int HitIndex )
|
||||
{
|
||||
local bool bIsHeadshot;
|
||||
local KFPlayerReplicationInfo KFPRI;
|
||||
local float HeadShotCheckScale;
|
||||
|
||||
// if (InstigatedBy == none || class<KFWeaponDamageType>(DamType) == none)
|
||||
|
||||
LastDamagedBy = instigatedBy;
|
||||
LastDamagedByType = damageType;
|
||||
HitMomentum = VSize(momentum);
|
||||
LastHitLocation = hitlocation;
|
||||
LastMomentum = momentum;
|
||||
|
||||
if ( instigatedBy != none && KFPawn(instigatedBy) != none && instigatedBy.PlayerReplicationInfo != none )
|
||||
KFPRI = KFPlayerReplicationInfo(instigatedBy.PlayerReplicationInfo);
|
||||
|
||||
// Scale damage if the Zed has been zapped
|
||||
if ( bZapped )
|
||||
Damage *= ZappedDamageMod;
|
||||
|
||||
// Zeds and fire dont mix.
|
||||
if ( class<KFWeaponDamageType>(damageType) != none && class<KFWeaponDamageType>(damageType).default.bDealBurningDamage )
|
||||
{
|
||||
if( BurnDown<=0 || Damage > LastBurnDamage )
|
||||
{
|
||||
// LastBurnDamage variable is storing last burn damage (unperked) received,
|
||||
// which will be used to make additional damage per every burn tick (second).
|
||||
LastBurnDamage = Damage;
|
||||
|
||||
// FireDamageClass variable stores damage type, which started zed's burning
|
||||
// and will be passed to this function again every next burn tick (as damageType argument)
|
||||
if ( class<DamTypeTrenchgun>(damageType) != none ||
|
||||
class<DamTypeFlareRevolver>(damageType) != none ||
|
||||
class<DamTypeMAC10MPInc>(damageType) != none)
|
||||
{
|
||||
FireDamageClass = damageType;
|
||||
}
|
||||
else
|
||||
{
|
||||
FireDamageClass = class'DamTypeFlamethrower';
|
||||
}
|
||||
}
|
||||
|
||||
if ( class<DamTypeMAC10MPInc>(damageType) == none )
|
||||
Damage *= 1.5; // Increase burn damage 1.5 times, except MAC10.
|
||||
|
||||
// BurnDown variable indicates how many ticks are remaining for zed to burn.
|
||||
// It is 0, when zed isn't burning (or stopped burning).
|
||||
// So all the code below will be executed only, if zed isn't already burning
|
||||
if ( BurnDown <= 0 )
|
||||
{
|
||||
if( HeatAmount > 4 || Damage >= 15 )
|
||||
{
|
||||
bBurnified = true;
|
||||
BurnDown = 10; // Inits burn tick count to 10
|
||||
SetGroundSpeed(GroundSpeed *= 0.80); // Lowers movement speed by 20%
|
||||
BurnInstigator = instigatedBy;
|
||||
SetTimer(1.0,false); // Sets timer function to be executed each second
|
||||
}
|
||||
else
|
||||
HeatAmount++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !bDecapitated && class<KFWeaponDamageType>(damageType)!=none &&
|
||||
class<KFWeaponDamageType>(damageType).default.bCheckForHeadShots )
|
||||
{
|
||||
HeadShotCheckScale = 1.0;
|
||||
|
||||
// Do larger headshot checks if it is a melee attach
|
||||
if( class<DamTypeMelee>(damageType) != none )
|
||||
HeadShotCheckScale *= 1.25;
|
||||
|
||||
bIsHeadShot = IsHeadShot(hitlocation, normal(momentum), HeadShotCheckScale);
|
||||
bLaserSightedEBRM14Headshotted = bIsHeadshot && M14EBRBattleRifle(instigatedBy.Weapon) != none && M14EBRBattleRifle(instigatedBy.Weapon).bLaserActive;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
bLaserSightedEBRM14Headshotted = bLaserSightedEBRM14Headshotted && bDecapitated;
|
||||
}
|
||||
|
||||
if ( KFPRI != none )
|
||||
{
|
||||
if ( KFPRI.ClientVeteranSkill != none )
|
||||
{
|
||||
Damage = KFPRI.ClientVeteranSkill.Static.AddDamage(KFPRI, self, KFPawn(instigatedBy), Damage, DamageType);
|
||||
}
|
||||
}
|
||||
|
||||
if ( LastDamagedBy != none && damageType != none && LastDamagedBy.IsPlayerPawn() && LastDamagedBy.Controller != none )
|
||||
{
|
||||
if ( KFMonsterController(Controller) != none )
|
||||
{
|
||||
KFMonsterController(Controller).AddKillAssistant(LastDamagedBy.Controller, FMin(Health, Damage));
|
||||
}
|
||||
}
|
||||
|
||||
if ( (bDecapitated || bIsHeadShot) && class<DamTypeBurned>(DamageType) == none && class<DamTypeFlamethrower>(DamageType) == none )
|
||||
{
|
||||
if(class<KFWeaponDamageType>(damageType)!=none)
|
||||
Damage = Damage * class<KFWeaponDamageType>(damageType).default.HeadShotDamageMult;
|
||||
|
||||
if ( class<DamTypeMelee>(damageType) == none && KFPRI != none &&
|
||||
KFPRI.ClientVeteranSkill != none )
|
||||
{
|
||||
Damage = float(Damage) * KFPRI.ClientVeteranSkill.Static.GetHeadShotDamMulti(KFPRI, KFPawn(instigatedBy), DamageType);
|
||||
}
|
||||
|
||||
LastDamageAmount = Damage;
|
||||
|
||||
if( !bDecapitated )
|
||||
{
|
||||
if( bIsHeadShot )
|
||||
{
|
||||
// Play a sound when someone gets a headshot TODO: Put in the real sound here
|
||||
if( bIsHeadShot )
|
||||
{
|
||||
PlaySound(sound'KF_EnemyGlobalSndTwo.Impact_Skull', SLOT_None,2.0,true,500);
|
||||
}
|
||||
HeadHealth -= LastDamageAmount;
|
||||
if( HeadHealth <= 0 || Damage > Health )
|
||||
{
|
||||
RemoveHead();
|
||||
}
|
||||
}
|
||||
|
||||
// Award headshot here, not when zombie died.
|
||||
if( bDecapitated && Class<KFWeaponDamageType>(damageType) != none && instigatedBy != none && KFPlayerController(instigatedBy.Controller) != none )
|
||||
{
|
||||
bLaserSightedEBRM14Headshotted = M14EBRBattleRifle(instigatedBy.Weapon) != none && M14EBRBattleRifle(instigatedBy.Weapon).bLaserActive;
|
||||
Class<KFWeaponDamageType>(damageType).Static.ScoredHeadshot(KFSteamStatsAndAchievements(PlayerController(instigatedBy.Controller).SteamStatsAndAchievements), self.Class, bLaserSightedEBRM14Headshotted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Client check for Gore FX
|
||||
// BodyPartRemoval(Damage,instigatedBy,hitlocation,momentum,damageType);
|
||||
|
||||
if( Health-Damage > 0 && DamageType!=class'DamTypeFrag' && DamageType!=class'DamTypePipeBomb'
|
||||
&& DamageType!=class'DamTypeM79Grenade' && DamageType!=class'DamTypeM32Grenade'
|
||||
&& DamageType!=class'DamTypeM203Grenade' && DamageType!=class'DamTypeDwarfAxe'
|
||||
&& DamageType!=class'DamTypeSPGrenade' && DamageType!=class'DamTypeSealSquealExplosion'
|
||||
&& DamageType!=class'DamTypeSeekerSixRocket')
|
||||
{
|
||||
Momentum = vect(0,0,0);
|
||||
}
|
||||
|
||||
if(class<DamTypeVomit>(DamageType) != none) // Same rules apply to zombies as players.
|
||||
{
|
||||
BileCount=7;
|
||||
if (instigatedBy != none)
|
||||
BileInstigator = instigatedBy;
|
||||
else
|
||||
BileInstigator = self;
|
||||
LastBileDamagedByType=class<DamTypeVomit>(DamageType);
|
||||
if(NextBileTime< Level.TimeSeconds )
|
||||
NextBileTime = Level.TimeSeconds+BileFrequency;
|
||||
}
|
||||
|
||||
if ( KFPRI != none && Health-Damage <= 0 && KFPRI.ClientVeteranSkill != none && KFPRI.ClientVeteranSkill.static.KilledShouldExplode(KFPRI, KFPawn(instigatedBy)) )
|
||||
{
|
||||
Super(Monster).takeDamage(Damage + 600, instigatedBy, hitLocation, momentum, damageType);
|
||||
HurtRadius(500, 1000, class'DamTypeFrag', 100000, Location);
|
||||
}
|
||||
else
|
||||
{
|
||||
Super(Monster).takeDamage(Damage, instigatedBy, hitLocation, momentum, damageType);
|
||||
}
|
||||
|
||||
// if (Damage*1.5 >= default.Health || (Damage > 200 && KFDamType != none && KFDamType.default.bSniperWeapon && ZedVictim.IsA('ZombieHusk') ))
|
||||
// {
|
||||
// ZedVictim.Controller.Focus = none;
|
||||
// ZedVictim.Controller.FocalPoint = ZedVictim.Location + 512 * vector(ZedVictim.Rotation);
|
||||
// }
|
||||
|
||||
// block yet another zed time call
|
||||
// if( bIsHeadShot && Health <= 0 )
|
||||
// {
|
||||
// KFGameType(Level.Game).DramaticEvent(0.03);
|
||||
// }
|
||||
|
||||
bBackstabbed = false;
|
||||
}
|
||||
|
||||
|
||||
// attempt to fix ground speed bugs
|
||||
function TakeFireDamage(int Damage,pawn Instigator)
|
||||
{
|
||||
local Vector DummyHitLoc,DummyMomentum;
|
||||
|
||||
TakeDamage(Damage, BurnInstigator, DummyHitLoc, DummyMomentum, FireDamageClass);
|
||||
|
||||
if ( BurnDown > 0 )
|
||||
{
|
||||
// Decrement the number of FireDamage calls left before our Zombie is extinguished :)
|
||||
BurnDown --;
|
||||
}
|
||||
|
||||
// Melt em' :)
|
||||
if ( BurnDown < CrispUpThreshhold )
|
||||
{
|
||||
ZombieCrispUp();
|
||||
}
|
||||
|
||||
if ( BurnDown == 0 )
|
||||
{
|
||||
bBurnified = false;
|
||||
if( !bZapped )
|
||||
{
|
||||
// was `default.GroundSpeed`
|
||||
SetGroundSpeed(GetOriginalGroundSpeed());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// fix for zed corpse collision shit
|
||||
//=============================================================================
|
||||
|
||||
//Stops the green shit when a player dies.
|
||||
simulated function PlayDying(class<DamageType> DamageType, vector HitLoc)
|
||||
{
|
||||
local float frame, rate;
|
||||
local name seq;
|
||||
local LavaDeath LD;
|
||||
local MiscEmmiter BE;
|
||||
|
||||
AmbientSound = None;
|
||||
bCanTeleport = false; // sjs - fix karma going crazy when corpses land on teleporters
|
||||
bReplicateMovement = false;
|
||||
bTearOff = true;
|
||||
bPlayedDeath = true;
|
||||
StopBurnFX();
|
||||
|
||||
if (CurrentCombo != None)
|
||||
CurrentCombo.Destroy();
|
||||
|
||||
HitDamageType = DamageType; // these are replicated to other clients
|
||||
TakeHitLocation = HitLoc;
|
||||
|
||||
bSTUNNED = false;
|
||||
bMovable = true;
|
||||
|
||||
if ( class<DamTypeBurned>(DamageType) != none || class<DamTypeFlamethrower>(DamageType) != none )
|
||||
{
|
||||
ZombieCrispUp();
|
||||
}
|
||||
|
||||
ProcessHitFX() ;
|
||||
|
||||
if ( DamageType != None )
|
||||
{
|
||||
if ( DamageType.default.bSkeletize )
|
||||
{
|
||||
SetOverlayMaterial(DamageType.Default.DamageOverlayMaterial, 4.0, true);
|
||||
if (!bSkeletized)
|
||||
{
|
||||
if ( (Level.NetMode != NM_DedicatedServer) && (SkeletonMesh != None) )
|
||||
{
|
||||
if ( DamageType.default.bLeaveBodyEffect )
|
||||
{
|
||||
BE = spawn(class'MiscEmmiter',self);
|
||||
if ( BE != None )
|
||||
{
|
||||
BE.DamageType = DamageType;
|
||||
BE.HitLoc = HitLoc;
|
||||
bFrozenBody = true;
|
||||
}
|
||||
}
|
||||
GetAnimParams( 0, seq, frame, rate );
|
||||
LinkMesh(SkeletonMesh, true);
|
||||
Skins.Length = 0;
|
||||
PlayAnim(seq, 0, 0);
|
||||
SetAnimFrame(frame);
|
||||
}
|
||||
if (Physics == PHYS_Walking)
|
||||
Velocity = Vect(0,0,0);
|
||||
SetTearOffMomemtum(GetTearOffMomemtum() * 0.25);
|
||||
bSkeletized = true;
|
||||
if ( (Level.NetMode != NM_DedicatedServer) && (DamageType == class'FellLava') )
|
||||
{
|
||||
LD = spawn(class'LavaDeath', , , Location + vect(0, 0, 10), Rotation );
|
||||
if ( LD != None )
|
||||
LD.SetBase(self);
|
||||
//PlaySound( sound'WeaponSounds.BExplosion5', SLOT_None, 1.5*TransientSoundVolume );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( DamageType.Default.DeathOverlayMaterial != None )
|
||||
SetOverlayMaterial(DamageType.Default.DeathOverlayMaterial, DamageType.default.DeathOverlayTime, true);
|
||||
else if ( (DamageType.Default.DamageOverlayMaterial != None) && (Level.DetailMode != DM_Low) && !Level.bDropDetail )
|
||||
SetOverlayMaterial(DamageType.Default.DamageOverlayMaterial, 2*DamageType.default.DamageOverlayTime, true);
|
||||
}
|
||||
|
||||
// stop shooting
|
||||
AnimBlendParams(1, 0.0);
|
||||
FireState = FS_None;
|
||||
|
||||
// Try to adjust around performance
|
||||
//log(Level.DetailMode);
|
||||
|
||||
LifeSpan = RagdollLifeSpan;
|
||||
|
||||
GotoState('ZombieDying');
|
||||
if ( BE != None )
|
||||
return;
|
||||
PlayDyingAnimation(DamageType, HitLoc);
|
||||
|
||||
// ADDITION for collision fix
|
||||
bBlockActors = false;
|
||||
bBlockPlayers = false;
|
||||
bBlockProjectiles = false;
|
||||
bProjTarget = false;
|
||||
bBlockZeroExtentTraces = false;
|
||||
bBlockNonZeroExtentTraces = false;
|
||||
bBlockHitPointTraces = false;
|
||||
}
|
||||
|
||||
|
||||
state ZombieDying
|
||||
{
|
||||
simulated function BeginState()
|
||||
{
|
||||
// ADDITION for collision fix
|
||||
bBlockActors = false;
|
||||
bBlockPlayers = false;
|
||||
bBlockProjectiles = false;
|
||||
bProjTarget = false;
|
||||
bBlockZeroExtentTraces = false;
|
||||
bBlockNonZeroExtentTraces = false;
|
||||
bBlockHitPointTraces = false;
|
||||
|
||||
if (bDestroyNextTick)
|
||||
{
|
||||
// If we've flagged this character to be destroyed next tick, handle that
|
||||
if (TimeSetDestroyNextTickTime < Level.TimeSeconds)
|
||||
Destroy();
|
||||
else
|
||||
SetTimer(0.01, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bTearOff && (Level.NetMode == NM_DedicatedServer) || class'GameInfo'.static.UseLowGore())
|
||||
LifeSpan = 1.0;
|
||||
else
|
||||
SetTimer(2.0, false);
|
||||
}
|
||||
|
||||
SetPhysics(PHYS_Falling);
|
||||
if (Controller != None)
|
||||
Controller.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// lets limit some zeds attack abilities
|
||||
//=============================================================================
|
||||
|
||||
function bool MeleeDamageTarget(int hitdamage, vector pushdir)
|
||||
{
|
||||
local vector HitLocation, HitNormal;
|
||||
local actor HitActor;
|
||||
local Name TearBone;
|
||||
local float dummy;
|
||||
local Emitter BloodHit;
|
||||
// local vector TraceDir;
|
||||
|
||||
// Never should be done on client.
|
||||
if (Level.NetMode == NM_Client || Controller == None)
|
||||
return false;
|
||||
|
||||
// try to limit some zeds
|
||||
if ((ClassIsChildOf(self.class, class'ZombieCrawler') || ClassIsChildOf(self.class, class'ZombieFleshpound')) && (Level.TimeSeconds < class'stub_Monster'.default.fLastAttackTime))
|
||||
return false;
|
||||
|
||||
// ATTENTION!!! is 0.3 secs ok?
|
||||
class'stub_Monster'.default.fLastAttackTime = Level.TimeSeconds + 0.3f;
|
||||
|
||||
if (Controller.Target!=none && Controller.Target.IsA('KFDoorMover'))
|
||||
{
|
||||
Controller.Target.TakeDamage(hitdamage, self ,HitLocation,pushdir, CurrentDamType);
|
||||
return true;
|
||||
}
|
||||
|
||||
// need to uncomment this and check :D
|
||||
// ClearStayingDebugLines();
|
||||
// TraceDir = Normal(Controller.Target.Location - Location);
|
||||
// DrawStayingDebugLine(Location, Location + (TraceDir * (MeleeRange * 1.4 + Controller.Target.CollisionRadius + CollisionRadius)) , 255,255,0);
|
||||
|
||||
// check if still in melee range
|
||||
if ( (Controller.target != None) && (bSTUNNED == false) && (DECAP == false) && (VSize(Controller.Target.Location - Location) <= MeleeRange * 1.4 + Controller.Target.CollisionRadius + CollisionRadius)
|
||||
&& ((Physics == PHYS_Flying) || (Physics == PHYS_Swimming) || (Abs(Location.Z - Controller.Target.Location.Z)
|
||||
<= FMax(CollisionHeight, Controller.Target.CollisionHeight) + 0.5 * FMin(CollisionHeight, Controller.Target.CollisionHeight))) )
|
||||
{
|
||||
// See if a trace would hit a pawn (Have to turn of hit point collision so trace doesn't hit the Human Pawn's bullet whiz cylinder)
|
||||
bBlockHitPointTraces = false;
|
||||
HitActor = Trace(HitLocation, HitNormal, Controller.Target.Location , Location + EyePosition(), true);
|
||||
bBlockHitPointTraces = true;
|
||||
|
||||
// If the trace wouldn't hit a pawn, do the old thing of just checking if there is something blocking the trace
|
||||
if (Pawn(HitActor) == none)
|
||||
{
|
||||
// Have to turn of hit point collision so trace doesn't hit the Human Pawn's bullet whiz cylinder
|
||||
bBlockHitPointTraces = false;
|
||||
HitActor = Trace(HitLocation, HitNormal, Controller.Target.Location, Location, false);
|
||||
bBlockHitPointTraces = true;
|
||||
|
||||
if (HitActor != none)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (KFHumanPawn(Controller.Target) != none)
|
||||
{
|
||||
//TODO - line below was KFPawn. Does this whole block need to be KFPawn, or is it OK as KFHumanPawn?
|
||||
KFHumanPawn(Controller.Target).TakeDamage(hitdamage, Instigator ,HitLocation,pushdir, CurrentDamType); //class 'KFmod.ZombieMeleeDamage');
|
||||
|
||||
if (KFHumanPawn(Controller.Target).Health <=0)
|
||||
{
|
||||
if (!class'GameInfo'.static.UseLowGore())
|
||||
{
|
||||
BloodHit = Spawn(class'KFMod.FeedingSpray',self,,Controller.Target.Location,rotator(pushdir)); //
|
||||
KFHumanPawn(Controller.Target).SpawnGibs(rotator(pushdir), 1);
|
||||
TearBone=KFPawn(Controller.Target).GetClosestBone(HitLocation,Velocity,dummy);
|
||||
KFHumanPawn(Controller.Target).HideBone(TearBone);
|
||||
}
|
||||
|
||||
// Give us some Health back
|
||||
if (Health <= (1.0-FeedThreshold)*HealthMax)
|
||||
{
|
||||
Health += FeedThreshold*HealthMax * Health/HealthMax;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (Controller.target != None)
|
||||
{
|
||||
// Do more damage if you are attacking another zed so that zeds don't just stand there whacking each other forever! - Ramm
|
||||
if (KFMonster(Controller.Target) != none)
|
||||
hitdamage *= DamageToMonsterScale;
|
||||
|
||||
Controller.Target.TakeDamage(hitdamage, self ,HitLocation,pushdir, CurrentDamType); //class 'KFmod.ZombieMeleeDamage');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
51
kf_sources/KFPatcher/Classes/stub_Nade.uc
Normal file
51
kf_sources/KFPatcher/Classes/stub_Nade.uc
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
class stub_Nade extends Nade;
|
||||
|
||||
|
||||
var array<sound> BoomSounds;
|
||||
|
||||
|
||||
// EXPERIMENTAL!!
|
||||
// fixes nade crashes, but obviously we can't use this :yoba:
|
||||
function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex){}
|
||||
|
||||
|
||||
simulated function Explode(vector HitLocation, vector HitNormal)
|
||||
{
|
||||
local PlayerController LocalPlayer;
|
||||
local Projectile P;
|
||||
local byte i;
|
||||
|
||||
bHasExploded = True;
|
||||
BlowUp(HitLocation);
|
||||
|
||||
PlaySound(class'stub_Nade'.default.BoomSounds[rand(3)],,2.0);
|
||||
|
||||
// Shrapnel
|
||||
for( i=Rand(6); i<10; i++ )
|
||||
{
|
||||
P = Spawn(ShrapnelClass,,,,RotRand(True));
|
||||
if( P!=None )
|
||||
P.RemoteRole = ROLE_None;
|
||||
}
|
||||
|
||||
if ( EffectIsRelevant(Location,false) )
|
||||
{
|
||||
Spawn(Class'KFmod.KFNadeExplosion',,, HitLocation, rotator(vect(0,0,1)));
|
||||
Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
|
||||
}
|
||||
|
||||
// Shake nearby players screens
|
||||
LocalPlayer = Level.GetLocalPlayerController();
|
||||
if ( (LocalPlayer != None) && (VSize(Location - LocalPlayer.ViewTarget.Location) < (DamageRadius * 1.5)) )
|
||||
LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
|
||||
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
BoomSounds[0]=SoundGroup'KF_GrenadeSnd.Nade_Explode_1'
|
||||
BoomSounds[1]=SoundGroup'KF_GrenadeSnd.Nade_Explode_2'
|
||||
BoomSounds[2]=SoundGroup'KF_GrenadeSnd.Nade_Explode_3'
|
||||
}
|
||||
212
kf_sources/KFPatcher/Classes/stub_PC.uc
Normal file
212
kf_sources/KFPatcher/Classes/stub_PC.uc
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
class stub_PC extends KFPlayerController_Story;
|
||||
|
||||
|
||||
var byte MaxVoiceMsgIn10s, contsMaxMsg;
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// slomo + voice messages fuckup fix
|
||||
//=============================================================================
|
||||
|
||||
// all 3 functions are from ScrN
|
||||
simulated function ClientEnterZedTime()
|
||||
{
|
||||
// this 'xPlayer' bool is not being used anywhere so let's use it
|
||||
// we need this bool for voice messages
|
||||
autozoom = true;
|
||||
|
||||
CheckZEDMessage();
|
||||
|
||||
if (Pawn != none && Pawn.Weapon != none)
|
||||
Pawn.Weapon.PlaySound(Sound'KF_PlayerGlobalSnd.Zedtime_Enter', SLOT_Talk, 2.0,false,500.0,1.1/Level.TimeDilation,false);
|
||||
else
|
||||
PlaySound(Sound'KF_PlayerGlobalSnd.Zedtime_Enter', SLOT_Talk, 2.0,false,500.0,1.1/Level.TimeDilation,false);
|
||||
}
|
||||
|
||||
|
||||
simulated function ClientExitZedTime()
|
||||
{
|
||||
// this 'xPlayer' bool is not being used anywhere so let's use it
|
||||
// we need this bool for voice messages
|
||||
autozoom = false;
|
||||
|
||||
if (Pawn != none && Pawn.Weapon != none)
|
||||
Pawn.Weapon.PlaySound(Sound'KF_PlayerGlobalSnd.Zedtime_Exit', SLOT_Talk, 2.0,false,500.0,1.1/Level.TimeDilation,false);
|
||||
else
|
||||
PlaySound(Sound'KF_PlayerGlobalSnd.Zedtime_Exit', SLOT_Talk, 2.0,false,500.0,1.1/Level.TimeDilation,false);
|
||||
}
|
||||
|
||||
|
||||
function bool AllowVoiceMessage(name MessageType)
|
||||
{
|
||||
local float TimeSinceLastMsg;
|
||||
|
||||
if (Level.NetMode == NM_Standalone || (PlayerReplicationInfo != none && (PlayerReplicationInfo.bAdmin || PlayerReplicationInfo.bSilentAdmin)))
|
||||
return true;
|
||||
|
||||
TimeSinceLastMsg = Level.TimeSeconds - OldMessageTime;
|
||||
|
||||
if (TimeSinceLastMsg < 3)
|
||||
{
|
||||
if (MessageType == 'TAUNT' || MessageType == 'AUTOTAUNT')
|
||||
return false;
|
||||
if (TimeSinceLastMsg < 1 )
|
||||
return false;
|
||||
}
|
||||
|
||||
// zed time screws up voice messages
|
||||
if (!autozoom && MessageType != 'TRADER' && MessageType != 'AUTO')
|
||||
{
|
||||
OldMessageTime = Level.TimeSeconds;
|
||||
if (TimeSinceLastMsg < 10)
|
||||
{
|
||||
if (class'stub_PC'.default.MaxVoiceMsgIn10s > 0)
|
||||
class'stub_PC'.default.MaxVoiceMsgIn10s--;
|
||||
else
|
||||
{
|
||||
ClientMessage("Keep quiet for " $ ceil(10 - TimeSinceLastMsg) $"s");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
class'stub_PC'.default.MaxVoiceMsgIn10s = class'stub_PC'.default.contsMaxMsg;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// no delay suicide
|
||||
//=============================================================================
|
||||
|
||||
exec function Suicide()
|
||||
{
|
||||
if (Pawn != none)
|
||||
Pawn.Suicide();
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// you will become #perk spam
|
||||
//=============================================================================
|
||||
|
||||
// simulated SendSelectedVeterancyToServer() -> to this
|
||||
// no more "you will become %perk" spam when you join midgame
|
||||
// can change perk unlimited amount of times
|
||||
function SelectVeterancy(class<KFVeterancyTypes> VetSkill, optional bool bForceChange)
|
||||
{
|
||||
if (VetSkill == none || KFPlayerReplicationInfo(PlayerReplicationInfo) == none)
|
||||
return;
|
||||
|
||||
if (KFSteamStatsAndAchievements(SteamStatsAndAchievements) != none)
|
||||
{
|
||||
// sets proper 'BuyMenuFilterIndex'
|
||||
SetSelectedVeterancy(VetSkill);
|
||||
|
||||
if (KFGameReplicationInfo(GameReplicationInfo).bWaveInProgress && VetSkill != KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill)
|
||||
{
|
||||
// FIX!
|
||||
// this 'xPlayer' float is not being used anywhere so let's use it
|
||||
// wait 2 seconds for ClientVeteranSkill replication
|
||||
if (Level.TimeSeconds > MinAdrenalineCost)
|
||||
{
|
||||
// moved this aswell so message and perk switch will happen at the same time
|
||||
// bChangedVeterancyThisWave = false;
|
||||
ClientMessage(Repl(YouWillBecomePerkString, "%Perk%", VetSkill.Default.VeterancyName));
|
||||
}
|
||||
|
||||
MinAdrenalineCost = Level.TimeSeconds + 2.0f;
|
||||
}
|
||||
|
||||
else // if (!bChangedVeterancyThisWave || bForceChange)
|
||||
{
|
||||
if (VetSkill != KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill)
|
||||
ClientMessage(Repl(YouAreNowPerkString, "%Perk%", VetSkill.Default.VeterancyName));
|
||||
|
||||
// if (GameReplicationInfo.bMatchHasBegun)
|
||||
// bChangedVeterancyThisWave = true;
|
||||
|
||||
KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill = VetSkill;
|
||||
KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkillLevel = KFSteamStatsAndAchievements(SteamStatsAndAchievements).PerkHighestLevelAvailable(VetSkill.default.PerkIndex);
|
||||
|
||||
// recalcs weight and ammo
|
||||
if (KFHumanPawn(Pawn) != none)
|
||||
KFHumanPawn(Pawn).VeterancyChanged();
|
||||
}
|
||||
|
||||
// else
|
||||
// ClientMessage(PerkChangeOncePerWaveString);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// blank spectator join message fix
|
||||
//=============================================================================
|
||||
|
||||
// worst case since repInfo creates after this function call
|
||||
// should I check its existance for other parts of this function???
|
||||
function JoinedAsSpectatorOnly()
|
||||
{
|
||||
if (Pawn != none)
|
||||
Pawn.Died(self, class'DamageType', Pawn.Location);
|
||||
|
||||
if (PlayerReplicationInfo.Team != none)
|
||||
PlayerReplicationInfo.Team.RemoveFromTeam(self);
|
||||
|
||||
PlayerReplicationInfo.Team = none;
|
||||
ServerSpectate();
|
||||
|
||||
ClientBecameSpectator();
|
||||
// let's fix blank messages
|
||||
// this 'xPlayer' float is not being used anywhere so let's use it
|
||||
MinAdrenalineCost = Level.TimeSeconds + 10.0f;
|
||||
|
||||
// start a loop and wait 10 secs for repInfo to appear
|
||||
while (Level.TimeSeconds <= MinAdrenalineCost)
|
||||
{
|
||||
if (PlayerReplicationInfo != none)
|
||||
{
|
||||
// BroadcastLocalizedMessage(Level.Game.GameMessageClass, 14, PlayerReplicationInfo);
|
||||
class'o_Helper'.static.BroadcastText(Level, "^b" $ PlayerReplicationInfo.PlayerName $ "^w joined as spectator.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function BecomeSpectator()
|
||||
{
|
||||
if (Role < ROLE_Authority)
|
||||
return;
|
||||
|
||||
if (!Level.Game.BecomeSpectator(self))
|
||||
return;
|
||||
|
||||
if (Pawn != none)
|
||||
Pawn.Died(self, class'DamageType', Pawn.Location);
|
||||
|
||||
if (PlayerReplicationInfo.Team != none)
|
||||
PlayerReplicationInfo.Team.RemoveFromTeam(self);
|
||||
PlayerReplicationInfo.Team = none;
|
||||
ServerSpectate();
|
||||
|
||||
// no repInfo checks since player is not leaving atm, just moving around
|
||||
// change the text a bit, this is an other case
|
||||
class'o_Helper'.static.BroadcastText(Level, "^b" $ PlayerReplicationInfo.PlayerName $ "^w moved to spectator slot.");
|
||||
|
||||
ClientBecameSpectator();
|
||||
}
|
||||
|
||||
|
||||
function bool IsInInventory(class<Pickup> PickupToCheck, bool bCheckForEquivalent, bool bCheckForVariant)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
MaxVoiceMsgIn10s=7
|
||||
contsMaxMsg=7
|
||||
}
|
||||
74
kf_sources/KFPatcher/Classes/stub_P_Shotgun.uc
Normal file
74
kf_sources/KFPatcher/Classes/stub_P_Shotgun.uc
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
class stub_P_Shotgun extends ShotgunBullet;
|
||||
|
||||
|
||||
var Pawn Victim;
|
||||
|
||||
|
||||
simulated function ProcessTouch (Actor Other, vector HitLocation)
|
||||
{
|
||||
local vector X;
|
||||
local Vector TempHitLocation, HitNormal;
|
||||
local array<int> HitPoints;
|
||||
local KFPawn HitPawn;
|
||||
|
||||
|
||||
if ( Other == none || Other == Instigator || Other.Base == Instigator || !Other.bBlockHitPointTraces )
|
||||
return;
|
||||
|
||||
X = Vector(Rotation);
|
||||
|
||||
if ( Instigator != none && ROBulletWhipAttachment(Other) != none )
|
||||
{
|
||||
// we touched player's auxilary collision cylinder, not let's trace to the player himself
|
||||
// Other.Base = KFPawn
|
||||
if( Other.Base == none || Other.Base.bDeleteMe )
|
||||
return;
|
||||
|
||||
Other = Instigator.HitPointTrace(TempHitLocation, HitNormal, HitLocation + (200 * X), HitPoints, HitLocation,, 1);
|
||||
|
||||
// bullet didn't hit a pawn
|
||||
if( Other == none || HitPoints.Length == 0 || Other.bDeleteMe)
|
||||
return;
|
||||
|
||||
HitPawn = KFPawn(Other);
|
||||
if ( HitPawn != none )
|
||||
{
|
||||
class'stub_P_Shotgun'.default.Victim = HitPawn;
|
||||
// fixed point blank penetration -> X vector
|
||||
HitPawn.ProcessLocationalDamage(Damage, Instigator, TempHitLocation, MomentumTransfer * X, MyDamageType,HitPoints);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ( Pawn(Other) != none )
|
||||
class'stub_P_Shotgun'.default.Victim = Pawn(Other);
|
||||
|
||||
// fixed point blank penetration -> X vector
|
||||
if ( class'stub_P_Shotgun'.default.Victim != none && Victim.IsHeadShot(HitLocation, X, 1.0))
|
||||
class'stub_P_Shotgun'.default.Victim.TakeDamage(Damage * HeadShotDamageMult, Instigator, HitLocation, MomentumTransfer * X, MyDamageType);
|
||||
else
|
||||
Other.TakeDamage(Damage, Instigator, HitLocation, MomentumTransfer * X, MyDamageType);
|
||||
}
|
||||
|
||||
if ( Instigator != none && KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo) != none && KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill != none )
|
||||
{
|
||||
PenDamageReduction = KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.static.GetShotgunPenetrationDamageMulti(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo),default.PenDamageReduction);
|
||||
}
|
||||
else
|
||||
{
|
||||
PenDamageReduction = default.PenDamageReduction;
|
||||
}
|
||||
|
||||
// dead bodies reduce damage less
|
||||
if ( class'stub_P_Shotgun'.default.Victim != none && class'stub_P_Shotgun'.default.Victim.Health <= 0 )
|
||||
{
|
||||
PenDamageReduction += (1.0 - PenDamageReduction) * 0.5;
|
||||
}
|
||||
|
||||
Damage *= PenDamageReduction; // Keep going, but lose effectiveness each time.
|
||||
|
||||
// 10 is for tests, may be changed
|
||||
if ( Damage < 10 )
|
||||
Destroy();
|
||||
}
|
||||
336
kf_sources/KFPatcher/Classes/stub_Pawn.uc
Normal file
336
kf_sources/KFPatcher/Classes/stub_Pawn.uc
Normal file
|
|
@ -0,0 +1,336 @@
|
|||
class stub_Pawn extends KFHumanPawn_Story;
|
||||
|
||||
|
||||
struct FDualList
|
||||
{
|
||||
var class<KFWeapon> Single,Dual;
|
||||
};
|
||||
var array<FDualList> DualMap;
|
||||
|
||||
var int OtherPrice;
|
||||
var class<KFWeapon> SecType;
|
||||
|
||||
|
||||
var transient float cashtimer;
|
||||
var transient byte CashCount;
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// weapon == none fix
|
||||
//=============================================================================
|
||||
|
||||
function ServerChangedWeapon(Weapon OldWeapon, Weapon NewWeapon)
|
||||
{
|
||||
local float InvisTime;
|
||||
|
||||
if (bInvis)
|
||||
{
|
||||
if ( (OldWeapon != none) && (OldWeapon.OverlayMaterial == InvisMaterial) )
|
||||
InvisTime = OldWeapon.ClientOverlayCounter;
|
||||
else
|
||||
InvisTime = 20000;
|
||||
}
|
||||
if (HasUDamage() || bInvis)
|
||||
SetWeaponOverlay(None, 0.f, true);
|
||||
|
||||
super(Pawn).ServerChangedWeapon(OldWeapon, NewWeapon);
|
||||
|
||||
if (bInvis)
|
||||
SetWeaponOverlay(InvisMaterial, InvisTime, true);
|
||||
else if (HasUDamage())
|
||||
SetWeaponOverlay(UDamageWeaponMaterial, UDamageTime - Level.TimeSeconds, false);
|
||||
|
||||
// the fix
|
||||
if (weapon == none)
|
||||
return;
|
||||
|
||||
if (bBerserk)
|
||||
Weapon.StartBerserk();
|
||||
else if ( Weapon.bBerserk )
|
||||
Weapon.StopBerserk();
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Dosh shit
|
||||
//=============================================================================
|
||||
|
||||
// toss some of your cash away. (to help a cash-strapped ally or perhaps just to party like its 1994)
|
||||
exec function TossCash(int Amount)
|
||||
{
|
||||
local Vector X,Y,Z;
|
||||
local CashPickup CashPickup;
|
||||
local Vector TossVel;
|
||||
local Actor A;
|
||||
|
||||
// NEW check! and 0.3 sec delay between throws
|
||||
if (Level.TimeSeconds < class'stub_Pawn'.default.cashtimer || PlayerReplicationInfo == none)
|
||||
return;
|
||||
class'stub_Pawn'.default.cashtimer = Level.TimeSeconds + 0.3f;
|
||||
|
||||
// 30 dosh at min
|
||||
Amount = clamp(Amount, 30, int(Controller.PlayerReplicationInfo.Score));
|
||||
// if (Amount<=0)
|
||||
// Amount = 50;
|
||||
|
||||
Controller.PlayerReplicationInfo.Score = int(Controller.PlayerReplicationInfo.Score); // To fix issue with throwing 0 pounds.
|
||||
if (Controller.PlayerReplicationInfo.Score<=0 || Amount<=0)
|
||||
return;
|
||||
Amount = Min(Amount, int(Controller.PlayerReplicationInfo.Score));
|
||||
|
||||
GetAxes(Rotation,X,Y,Z);
|
||||
|
||||
TossVel = Vector(GetViewRotation());
|
||||
TossVel = TossVel * ((Velocity Dot TossVel) + 500) + Vect(0,0,200);
|
||||
|
||||
// added owner to cash pickup, 2020 finally
|
||||
CashPickup = spawn(class'CashPickup', self,, Location + 0.8 * CollisionRadius * X - 0.5 * CollisionRadius * Y);
|
||||
|
||||
if (CashPickup != none)
|
||||
{
|
||||
CashPickup.CashAmount = Amount;
|
||||
CashPickup.bDroppedCash = true;
|
||||
CashPickup.RespawnTime = 0; // Dropped cash doesnt respawn. For obvious reasons.
|
||||
CashPickup.Velocity = TossVel;
|
||||
CashPickup.DroppedBy = Controller;
|
||||
CashPickup.InitDroppedPickupFor(None);
|
||||
Controller.PlayerReplicationInfo.Score -= Amount;
|
||||
|
||||
if ( Level.Game.NumPlayers > 1 && Level.TimeSeconds - LastDropCashMessageTime > DropCashMessageDelay )
|
||||
{
|
||||
PlayerController(Controller).Speech('AUTO', 4, "");
|
||||
}
|
||||
|
||||
// Hack to get Slot machines to accept dosh that's thrown inside their collision cylinder.
|
||||
foreach CashPickup.TouchingActors(class 'Actor', A)
|
||||
{
|
||||
if(A.IsA('KF_Slot_Machine'))
|
||||
{
|
||||
A.Touch(Cashpickup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Sound none on player death
|
||||
//=============================================================================
|
||||
|
||||
// fix for none soundgroup calls on death
|
||||
function Sound GetSound(xPawnSoundGroup.ESoundType soundType)
|
||||
{
|
||||
local int SurfaceTypeID;
|
||||
local actor A;
|
||||
local vector HL,HN,Start,End;
|
||||
local material FloorMat;
|
||||
|
||||
// added this in case when player joins using a custom skin with a custom SoundGroupClass,
|
||||
// which not present on the server
|
||||
if ( SoundGroupClass == none )
|
||||
SoundGroupClass = class'KFMod.KFMaleSoundGroup';
|
||||
|
||||
if( soundType == EST_Land || soundType == EST_Jump )
|
||||
{
|
||||
if ( (Base!=None) && (!Base.IsA('LevelInfo')) && (Base.SurfaceType!=0) )
|
||||
{
|
||||
SurfaceTypeID = Base.SurfaceType;
|
||||
}
|
||||
else
|
||||
{
|
||||
Start = Location - Vect(0,0,1)*CollisionHeight;
|
||||
End = Start - Vect(0,0,16);
|
||||
A = Trace(hl,hn,End,Start,false,,FloorMat);
|
||||
if (FloorMat !=None)
|
||||
SurfaceTypeID = FloorMat.SurfaceType;
|
||||
}
|
||||
}
|
||||
|
||||
return SoundGroupClass.static.GetSound(soundType, SurfaceTypeID);
|
||||
}
|
||||
|
||||
|
||||
// allows us to buy from trader menu from anywhere
|
||||
function bool CanBuyNow()
|
||||
{
|
||||
local ShopVolume Sh;
|
||||
|
||||
if (class'o_Settings'.default.bBuyEverywhere)
|
||||
return true;
|
||||
|
||||
if (KFGameType(Level.Game) == none || KFGameType(Level.Game).bWaveInProgress || PlayerReplicationInfo == none)
|
||||
return false;
|
||||
foreach TouchingActors(class'ShopVolume', Sh)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Dualies Print Fix
|
||||
//=============================================================================
|
||||
|
||||
function ServerBuyWeapon( class<Weapon> WClass, float ItemWeight )
|
||||
{
|
||||
local Inventory I, J;
|
||||
local float Price;
|
||||
|
||||
if ( !CanBuyNow() || class<KFWeapon>(WClass) == none || class<KFWeaponPickup>(WClass.Default.PickupClass) == none || class'stub_Pawn'.static.HasWeaponClass(WClass) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Price = class<KFWeaponPickup>(WClass.default.PickupClass).default.Cost;
|
||||
|
||||
if ( KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill != none )
|
||||
Price *= KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill.static.GetCostScaling(KFPlayerReplicationInfo(PlayerReplicationInfo), WClass.Default.PickupClass);
|
||||
|
||||
// N.B. addition !
|
||||
// ItemWeight = class<KFWeapon>(WClass).default.Weight;
|
||||
|
||||
if ( class'stub_Pawn'.static.IsDualWeapon(WClass,SecType) )
|
||||
{
|
||||
if ( WClass != class'Dualies' && class'stub_Pawn'.static.HasWeaponClass(class'stub_Pawn'.default.SecType, J) )
|
||||
{
|
||||
// ItemWeight -= class'stub_Pawn'.default.SecType.default.Weight;
|
||||
Price *= 0.5f;
|
||||
class'stub_Pawn'.default.OtherPrice = KFWeapon(J).SellValue;
|
||||
if ( class'stub_Pawn'.default.OtherPrice == -1 )
|
||||
{
|
||||
class'stub_Pawn'.default.OtherPrice = class<KFWeaponPickup>(class'stub_Pawn'.default.SecType.Default.PickupClass).Default.Cost * 0.75;
|
||||
if ( KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill != none )
|
||||
class'stub_Pawn'.default.OtherPrice *= KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill.static.GetCostScaling(KFPlayerReplicationInfo(PlayerReplicationInfo), SecType.Default.PickupClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( class'stub_Pawn'.static.HasDualies(WClass,Inventory) )
|
||||
return;
|
||||
|
||||
// add
|
||||
Price = int(Price); // Truncuate price.
|
||||
|
||||
if ( !CanCarry(ItemWeight) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( PlayerReplicationInfo.Score < Price )
|
||||
{
|
||||
ClientMessage("Error: "$WClass.Name$" is too expensive ("$int(Price)$">"$int(PlayerReplicationInfo.Score)$")");
|
||||
return; // Not enough CASH.
|
||||
}
|
||||
|
||||
I = Spawn(WClass);
|
||||
|
||||
if ( I != none )
|
||||
{
|
||||
if ( KFGameType(Level.Game) != none )
|
||||
KFGameType(Level.Game).WeaponSpawned(I);
|
||||
|
||||
KFWeapon(I).UpdateMagCapacity(PlayerReplicationInfo);
|
||||
KFWeapon(I).FillToInitialAmmo();
|
||||
KFWeapon(I).SellValue = Price * 0.75;
|
||||
if (class'stub_Pawn'.default.OtherPrice > 0)
|
||||
KFWeapon(I).SellValue += class'stub_Pawn'.default.OtherPrice;
|
||||
|
||||
I.GiveTo(self);
|
||||
PlayerReplicationInfo.Score -= Price;
|
||||
ClientForceChangeWeapon(I);
|
||||
}
|
||||
else
|
||||
ClientMessage("Error: "$WClass.Name$" failed to spawn.");
|
||||
|
||||
SetTraderUpdate();
|
||||
}
|
||||
|
||||
|
||||
static final function bool HasWeaponClass( class<Inventory> IC, optional out Inventory Res )
|
||||
{
|
||||
local Inventory I;
|
||||
|
||||
for ( I=default.Inventory; I!=None; I=I.default.Inventory )
|
||||
{
|
||||
if( I.Class == IC )
|
||||
{
|
||||
Res = I;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static final function bool IsDualWeapon(class<Weapon> W, optional out class<KFWeapon> SingleType )
|
||||
{
|
||||
local int i;
|
||||
|
||||
if (W.Default.DemoReplacement != none)
|
||||
{
|
||||
SingleType = class<KFWeapon>(W.Default.DemoReplacement);
|
||||
return true;
|
||||
}
|
||||
|
||||
for( i=(Default.DualMap.Length-1); i>=0; --i )
|
||||
{
|
||||
if( W==Default.DualMap[i].Dual )
|
||||
{
|
||||
SingleType = Default.DualMap[i].Single;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static final function bool HasDualies( class<Weapon> W, Inventory InvList, optional out class<KFWeapon> DualType )
|
||||
{
|
||||
local int i;
|
||||
local Inventory In;
|
||||
|
||||
for ( In=InvList; In!=None; In=In.Inventory )
|
||||
{
|
||||
if( Weapon(In)!=None && Weapon(In).DemoReplacement==W )
|
||||
{
|
||||
DualType = class<KFWeapon>(In.Class);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for ( i=(Default.DualMap.Length-1); i>=0; --i )
|
||||
{
|
||||
if ( W == Default.DualMap[i].Single )
|
||||
{
|
||||
DualType = Default.DualMap[i].Dual;
|
||||
W = Default.DualMap[i].Dual;
|
||||
for ( In=InvList; In!=None; In=In.Inventory )
|
||||
{
|
||||
if (In.Class == W)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function AddDefaultInventory()
|
||||
{
|
||||
CreateInventory("KFMod.Knife");
|
||||
CreateInventory("KFMod.Single");
|
||||
CreateInventory("KFMod.Frag");
|
||||
CreateInventory("KFMod.Syringe");
|
||||
CreateInventory("KFMod.Welder");
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DualMap[0]=(Single=class'Single',Dual=class'Dualies')
|
||||
DualMap[1]=(Single=class'Magnum44Pistol',Dual=class'Dual44Magnum')
|
||||
DualMap[2]=(Single=class'Deagle',Dual=class'DualDeagle')
|
||||
DualMap[3]=(Single=class'FlareRevolver',Dual=class'DualFlareRevolver')
|
||||
DualMap[4]=(Single=class'MK23Pistol',Dual=class'DualMK23Pistol')
|
||||
}
|
||||
208
kf_sources/KFPatcher/Classes/stub_Pipe.uc
Normal file
208
kf_sources/KFPatcher/Classes/stub_Pipe.uc
Normal file
|
|
@ -0,0 +1,208 @@
|
|||
class stub_Pipe extends PipeBombProjectile;
|
||||
|
||||
|
||||
var sound BoomSound;
|
||||
|
||||
|
||||
static function PreloadAssets()
|
||||
{
|
||||
UpdateDefaultStaticMesh(StaticMesh(DynamicLoadObject(default.StaticMeshRef, class'StaticMesh', true)));
|
||||
}
|
||||
|
||||
|
||||
static function bool UnloadAssets()
|
||||
{
|
||||
UpdateDefaultStaticMesh(none);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// fix insane damage while being triggered with m1 spam
|
||||
function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex)
|
||||
{
|
||||
// added bTriggered check and moved damage check for siren scream
|
||||
if ( bTriggered || Damage < 5 || damageType == class'DamTypePipeBomb' ||
|
||||
ClassIsChildOf(damageType, class'DamTypeMelee') ||
|
||||
(Damage < 25 && damageType.IsA('SirenScreamDamage')) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't let our own explosives blow this up!!!
|
||||
if ( InstigatedBy == none || InstigatedBy != none &&
|
||||
InstigatedBy.PlayerReplicationInfo != none &&
|
||||
InstigatedBy.PlayerReplicationInfo.Team != none &&
|
||||
InstigatedBy.PlayerReplicationInfo.Team.TeamIndex == PlacedTeam &&
|
||||
Class<KFWeaponDamageType>(damageType) != none &&
|
||||
(Class<KFWeaponDamageType>(damageType).default.bIsExplosive ||
|
||||
InstigatedBy != Instigator) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( damageType == class'SirenScreamDamage')
|
||||
{
|
||||
Disintegrate(HitLocation, vect(0,0,1));
|
||||
}
|
||||
else
|
||||
{
|
||||
Explode(HitLocation, vect(0,0,1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// NPC, dead players trigger fix
|
||||
function Timer()
|
||||
{
|
||||
local Pawn CheckPawn;
|
||||
local float ThreatLevel;
|
||||
// still not sure about creating new local vars
|
||||
// but welp, it works fine
|
||||
local vector DetectLocation;
|
||||
|
||||
// raise a detection poin half a meter up to prevent small objects on the ground bloking the trace
|
||||
DetectLocation = Location;
|
||||
DetectLocation.Z += 25;
|
||||
|
||||
if( !bHidden && !bTriggered )
|
||||
{
|
||||
if( ArmingCountDown >= 0 )
|
||||
{
|
||||
ArmingCountDown -= 0.1;
|
||||
if( ArmingCountDown <= 0 )
|
||||
{
|
||||
SetTimer(1.0, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check for enemies
|
||||
if( !bEnemyDetected )
|
||||
{
|
||||
bAlwaysRelevant = false;
|
||||
PlaySound(BeepSound,,0.5,,50.0);
|
||||
|
||||
foreach VisibleCollidingActors( class 'Pawn', CheckPawn, DetectionRadius, DetectLocation )
|
||||
{
|
||||
// don't trigger pipes on NPC -- PooSH
|
||||
if( CheckPawn == Instigator || KF_StoryNPC(CheckPawn) != none && KFGameType(Level.Game).FriendlyFireScale > 0 &&
|
||||
CheckPawn.PlayerReplicationInfo != none &&
|
||||
CheckPawn.PlayerReplicationInfo.Team.TeamIndex == PlacedTeam )
|
||||
{
|
||||
// Make the thing beep if someone on our team is within the detection radius
|
||||
// This gives them a chance to get out of the way
|
||||
ThreatLevel += 0.001;
|
||||
}
|
||||
else
|
||||
{
|
||||
// don't trigger pipes by dead bodies -- PooSH
|
||||
if( CheckPawn.Health > 0 && CheckPawn != Instigator && (CheckPawn.Role == ROLE_Authority) &&
|
||||
((CheckPawn.PlayerReplicationInfo != none && CheckPawn.PlayerReplicationInfo.Team.TeamIndex != PlacedTeam) ||
|
||||
CheckPawn.GetTeamNum() != PlacedTeam))
|
||||
{
|
||||
if( KFMonster(CheckPawn) != none )
|
||||
{
|
||||
ThreatLevel += KFMonster(CheckPawn).MotionDetectorThreat;
|
||||
if( ThreatLevel >= ThreatThreshhold )
|
||||
{
|
||||
bEnemyDetected = true;
|
||||
SetTimer(0.15, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bEnemyDetected = true;
|
||||
SetTimer(0.15, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( ThreatLevel >= ThreatThreshhold )
|
||||
{
|
||||
bEnemyDetected = true;
|
||||
SetTimer(0.15, true);
|
||||
}
|
||||
else if( ThreatLevel > 0 )
|
||||
{
|
||||
SetTimer(0.5, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTimer(1.0, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Play some fast beeps and blow up
|
||||
else
|
||||
{
|
||||
bAlwaysRelevant = true;
|
||||
Countdown--;
|
||||
|
||||
if ( CountDown > 0 )
|
||||
{
|
||||
PlaySound(BeepSound, SLOT_Misc, 2.0,, 150.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Explode(DetectLocation, vector(Rotation));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// explode sounds none fix
|
||||
simulated function Explode(vector HitLocation, vector HitNormal)
|
||||
{
|
||||
local PlayerController LocalPlayer;
|
||||
local Projectile P;
|
||||
local byte i;
|
||||
|
||||
bHasExploded = true;
|
||||
BlowUp(HitLocation);
|
||||
|
||||
bTriggered = true;
|
||||
|
||||
if ( Role == ROLE_Authority )
|
||||
{
|
||||
SetTimer(0.1, false);
|
||||
NetUpdateTime = Level.TimeSeconds - 1;
|
||||
}
|
||||
|
||||
PlaySound(class'stub_Pipe'.default.BoomSound,,2.0);
|
||||
|
||||
// Shrapnel
|
||||
for( i=Rand(6); i<10; i++ )
|
||||
{
|
||||
P = Spawn(ShrapnelClass,,,,RotRand(true));
|
||||
if( P!=None )
|
||||
P.RemoteRole = ROLE_None;
|
||||
}
|
||||
if ( EffectIsRelevant(Location,false) )
|
||||
{
|
||||
Spawn(Class'KFMod.KFNadeLExplosion',,, HitLocation, rotator(vect(0,0,1)));
|
||||
Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
|
||||
}
|
||||
|
||||
// Shake nearby players screens
|
||||
LocalPlayer = Level.GetLocalPlayerController();
|
||||
if ( (LocalPlayer != None) && (VSize(Location - LocalPlayer.ViewTarget.Location) < (DamageRadius * 1.5)) )
|
||||
LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
|
||||
|
||||
if( Role < ROLE_Authority )
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
BoomSound=SoundGroup'Inf_Weapons.antitankmine.antitankmine_explode01'
|
||||
}
|
||||
14
kf_sources/KFPatcher/Classes/stub_Rule.uc
Normal file
14
kf_sources/KFPatcher/Classes/stub_Rule.uc
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class stub_Rule extends GameRules;
|
||||
|
||||
|
||||
// no map switch if we leave from lobby
|
||||
function bool CheckEndGame(PlayerReplicationInfo Winner, string Reason)
|
||||
{
|
||||
if (Level.Game.IsInState('PendingMatch'))
|
||||
return false;
|
||||
|
||||
if (NextGameRules != none)
|
||||
return NextGameRules.CheckEndGame(Winner, Reason);
|
||||
|
||||
return true;
|
||||
}
|
||||
149
kf_sources/KFPatcher/Classes/stub_ShopVolume.uc
Normal file
149
kf_sources/KFPatcher/Classes/stub_ShopVolume.uc
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
// imagine almost all main functions of this class are bugged
|
||||
// amazing, i cummed twice
|
||||
class stub_ShopVolume extends KFShopVolume_Story;
|
||||
|
||||
|
||||
var string shopTag;
|
||||
|
||||
|
||||
// fix for accessed nones
|
||||
function Touch(Actor Other)
|
||||
{
|
||||
// to prevent accessed none warnings
|
||||
if (Other == none)
|
||||
return;
|
||||
|
||||
if ( Pawn(Other) != none && PlayerController(Pawn(Other).Controller) != none && KFGameType(Level.Game) != none && !KFGameType(Level.Game).bWaveInProgress )
|
||||
{
|
||||
if( !bCurrentlyOpen )
|
||||
{
|
||||
BootPlayers();
|
||||
return;
|
||||
}
|
||||
|
||||
// none check
|
||||
if (MyTrader != none)
|
||||
MyTrader.SetOpen(true);
|
||||
|
||||
if( KFPlayerController(Pawn(Other).Controller) !=None )
|
||||
{
|
||||
KFPlayerController(Pawn(Other).Controller).SetShowPathToTrader(false);
|
||||
KFPlayerController(Pawn(Other).Controller).CheckForHint(52);
|
||||
}
|
||||
|
||||
PlayerController(Pawn(Other).Controller).ReceiveLocalizedMessage(class'KFMainMessages',3);
|
||||
|
||||
if ( KFPlayerController(Pawn(Other).Controller) != none && !KFPlayerController(Pawn(Other).Controller).bHasHeardTraderWelcomeMessage )
|
||||
{
|
||||
// Have Trader say Welcome to players
|
||||
if ( KFGameType(Level.Game).WaveCountDown >= 30 )
|
||||
{
|
||||
KFPlayerController(Pawn(Other).Controller).ClientLocationalVoiceMessage(Pawn(Other).PlayerReplicationInfo, none, 'TRADER', 7);
|
||||
KFPlayerController(Pawn(Other).Controller).bHasHeardTraderWelcomeMessage = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if( Other.IsA('KF_StoryInventoryPickup') )
|
||||
{
|
||||
if( !bCurrentlyOpen )
|
||||
{
|
||||
BootPlayers();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function UnTouch( Actor Other )
|
||||
{
|
||||
// to prevent accessed none warnings
|
||||
if (Other == none)
|
||||
return;
|
||||
|
||||
// none check
|
||||
if ( MyTrader != none && Pawn(Other) != none && PlayerController(Pawn(Other).Controller) != none && KFGameType(Level.Game) != none )
|
||||
MyTrader.SetOpen(false);
|
||||
}
|
||||
|
||||
|
||||
function UsedBy(Pawn user)
|
||||
{
|
||||
// to prevent accessed none warnings
|
||||
if (user == none || KFHumanPawn(user) == none)
|
||||
return;
|
||||
|
||||
// Set the pawn to an idle anim so he wont keep making footsteps
|
||||
User.SetAnimAction(User.IdleWeaponAnim);
|
||||
|
||||
// none check
|
||||
if (MyTrader != none)
|
||||
class'stub_ShopVolume'.default.shoptag = string(MyTrader.Tag);
|
||||
|
||||
if (KFPlayerController(user.Controller) != none && KFGameType(Level.Game) != none && !KFGameType(Level.Game).bWaveInProgress)
|
||||
KFPlayerController(user.Controller).ShowBuyMenu(class'stub_ShopVolume'.default.shoptag, KFHumanPawn(user).MaxCarryWeight);
|
||||
}
|
||||
|
||||
|
||||
// touching out of bounds fix
|
||||
function bool BootPlayers()
|
||||
{
|
||||
local KFHumanPawn Bootee;
|
||||
local int i,idx;
|
||||
local bool bResult;
|
||||
local int NumTouching,NumBooted;
|
||||
local array<Teleporter> UnusedSpots;
|
||||
local bool bBooted;
|
||||
|
||||
// really wtf is this
|
||||
if ( !bTelsInit )
|
||||
InitTeleports();
|
||||
if ( !bHasTeles )
|
||||
Return False; // Wtf?
|
||||
|
||||
UnusedSpots = TelList;
|
||||
|
||||
for (idx = 0; idx < Touching.Length; idx++)
|
||||
{
|
||||
// none check so we wont go out of bounds
|
||||
if (Touching[idx] == none)
|
||||
continue;
|
||||
|
||||
if (Touching[idx].IsA('KFHumanPawn'))
|
||||
{
|
||||
Bootee = KFHumanPawn(Touching[idx]);
|
||||
NumTouching ++ ;
|
||||
|
||||
if (PlayerController(Bootee.Controller) != none)
|
||||
{
|
||||
PlayerController(Bootee.Controller).ReceiveLocalizedMessage(class'KFMainMessages');
|
||||
PlayerController(Bootee.Controller).ClientCloseMenu(true, true);
|
||||
}
|
||||
|
||||
// Teleport to a random teleporter in this local area, if more than one pick random.
|
||||
i = Rand(UnusedSpots.Length);
|
||||
|
||||
// removed pawn check coz WE ALREADY CHECKED IT !
|
||||
Bootee.PlayTeleportEffect(false, true);
|
||||
bBooted = UnusedSpots[i].Accept(Bootee, self);
|
||||
if (bBooted)
|
||||
{
|
||||
NumBooted ++;
|
||||
UnusedSpots.Remove(i,1); // someone is being teleported here. We can't have the next guy spawning on top of him.
|
||||
}
|
||||
}
|
||||
|
||||
else if (Touching[idx].IsA('KF_StoryInventoryPickup'))
|
||||
{
|
||||
Touching[idx].SetLocation(TelList[Rand(TelList.length)].Location + (vect(0,0,1) * Touching[idx].CollisionHeight)) ;
|
||||
Touching[idx].SetPhysics(PHYS_Falling);
|
||||
Touching[idx].SetOwner(Touching[idx].Owner); // to force NetDirty
|
||||
}
|
||||
}
|
||||
|
||||
bResult = NumBooted >= NumTouching;
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
defaultproperties{}
|
||||
25
kf_sources/KFPatcher/Classes/stub_Syringe.uc
Normal file
25
kf_sources/KFPatcher/Classes/stub_Syringe.uc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
class stub_Syringe extends Syringe;
|
||||
|
||||
|
||||
// fix syringe heal ammounts when players die
|
||||
simulated function bool HackClientStartFire()
|
||||
{
|
||||
if (StartFire(1))
|
||||
{
|
||||
if (Role < ROLE_Authority)
|
||||
{
|
||||
// best idea i've come to
|
||||
// at least im not running timer like Poosh
|
||||
if (Level.Game.NumPlayers == 1)
|
||||
HealBoostAmount = 50;
|
||||
else
|
||||
HealBoostAmount = default.HealBoostAmount;
|
||||
|
||||
ServerStartFire(1);
|
||||
}
|
||||
|
||||
FireMode[1].ModeDoFire(); // Force to start animating.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
142
kf_sources/KFPatcher/Classes/stub_VotingHandler.uc
Normal file
142
kf_sources/KFPatcher/Classes/stub_VotingHandler.uc
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
class stub_VotingHandler extends xVotingHandler;
|
||||
|
||||
|
||||
// only REAL players are counted. FUCKING IGNORES SPECS AND FAKES. FINALLY!!!!!!
|
||||
function TallyVotes(bool bForceMapSwitch)
|
||||
{
|
||||
local int oldNumPlayers;
|
||||
local Controller c;
|
||||
|
||||
// save the current player count
|
||||
oldNumPlayers = Level.Game.NumPlayers;
|
||||
|
||||
// reset the player count
|
||||
Level.Game.NumPlayers = 0;
|
||||
|
||||
// count real players to prevent fakes from or specs from preventing map switching
|
||||
for (c=level.ControllerList; c!=none; c=c.nextController)
|
||||
{
|
||||
if (c.bIsPlayer && c.PlayerReplicationInfo != none && !c.PlayerReplicationInfo.bOnlySpectator)
|
||||
Level.Game.NumPlayers++;
|
||||
}
|
||||
|
||||
super(xVotingHandler).TallyVotes(bForceMapSwitch);
|
||||
|
||||
// restore the original number of players
|
||||
Level.Game.NumPlayers = oldNumPlayers;
|
||||
}
|
||||
|
||||
|
||||
// this is just here to tell spectators that they can't vote
|
||||
function SubmitMapVote(int MapIndex, int GameIndex, Actor Voter)
|
||||
{
|
||||
local int Index, VoteCount, PrevMapVote, PrevGameVote;
|
||||
local MapHistoryInfo MapInfo;
|
||||
local bool bAdminForce;
|
||||
|
||||
if (bLevelSwitchPending)
|
||||
return;
|
||||
|
||||
Index = GetMVRIIndex(PlayerController(Voter));
|
||||
if (GameIndex < 0)
|
||||
{
|
||||
bAdminForce = true;
|
||||
GameIndex = (-GameIndex) - 1;
|
||||
}
|
||||
if (GameIndex >= GameConfig.Length || MapIndex < 0 || MapIndex >= MapList.Length)
|
||||
return; // Something is wrong...
|
||||
|
||||
// check for invalid vote from unpatch players
|
||||
if (!IsValidVote(MapIndex, GameIndex))
|
||||
return;
|
||||
|
||||
// Administrator Vote
|
||||
if (bAdminForce && (PlayerController(Voter).PlayerReplicationInfo.bAdmin || PlayerController(Voter).PlayerReplicationInfo.bSilentAdmin))
|
||||
{
|
||||
TextMessage = lmsgAdminMapChange;
|
||||
TextMessage = Repl(TextMessage, "%mapname%", MapList[MapIndex].MapName $ "(" $ GameConfig[GameIndex].Acronym $ ")");
|
||||
Level.Game.Broadcast(self,TextMessage);
|
||||
|
||||
log("Admin has forced map switch to " $ MapList[MapIndex].MapName $ "(" $ GameConfig[GameIndex].Acronym $ ")",'MapVote');
|
||||
|
||||
CloseAllVoteWindows();
|
||||
|
||||
bLevelSwitchPending = true;
|
||||
MapInfo = History.PlayMap(MapList[MapIndex].MapName);
|
||||
|
||||
ServerTravelString = SetupGameMap(MapList[MapIndex], GameIndex, MapInfo);
|
||||
log("ServerTravelString = " $ ServerTravelString ,'MapVoteDebug');
|
||||
|
||||
// change the map
|
||||
Level.ServerTravel(ServerTravelString, false);
|
||||
|
||||
settimer(1,true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (PlayerController(Voter).PlayerReplicationInfo.bOnlySpectator)
|
||||
{
|
||||
// Spectators cant vote
|
||||
PlayerController(Voter).ClientMessage(lmsgSpectatorsCantVote);
|
||||
return;
|
||||
}
|
||||
|
||||
// check for invalid map, invalid gametype, player isnt revoting same as previous vote, and map choosen isnt disabled
|
||||
if (MapIndex < 0 || MapIndex >= MapCount || GameIndex >= GameConfig.Length || (MVRI[Index].GameVote == GameIndex && MVRI[Index].MapVote == MapIndex) ||
|
||||
!MapList[MapIndex].bEnabled)
|
||||
return;
|
||||
|
||||
log("___" $ Index $ " - " $ PlayerController(Voter).PlayerReplicationInfo.PlayerName $ " voted for " $ MapList[MapIndex].MapName $ "(" $ GameConfig[GameIndex].Acronym $ ")",'MapVote');
|
||||
|
||||
PrevMapVote = MVRI[Index].MapVote;
|
||||
PrevGameVote = MVRI[Index].GameVote;
|
||||
MVRI[Index].MapVote = MapIndex;
|
||||
MVRI[Index].GameVote = GameIndex;
|
||||
|
||||
if (bAccumulationMode)
|
||||
{
|
||||
if (bScoreMode)
|
||||
{
|
||||
VoteCount = GetAccVote(PlayerController(Voter)) + int(GetPlayerScore(PlayerController(Voter)));
|
||||
TextMessage = lmsgMapVotedForWithCount;
|
||||
TextMessage = repl(TextMessage, "%playername%", PlayerController(Voter).PlayerReplicationInfo.PlayerName );
|
||||
TextMessage = repl(TextMessage, "%votecount%", string(VoteCount) );
|
||||
TextMessage = repl(TextMessage, "%mapname%", MapList[MapIndex].MapName $ "(" $ GameConfig[GameIndex].Acronym $ ")" );
|
||||
Level.Game.Broadcast(self,TextMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
VoteCount = GetAccVote(PlayerController(Voter)) + 1;
|
||||
TextMessage = lmsgMapVotedForWithCount;
|
||||
TextMessage = repl(TextMessage, "%playername%", PlayerController(Voter).PlayerReplicationInfo.PlayerName );
|
||||
TextMessage = repl(TextMessage, "%votecount%", string(VoteCount) );
|
||||
TextMessage = repl(TextMessage, "%mapname%", MapList[MapIndex].MapName $ "(" $ GameConfig[GameIndex].Acronym $ ")" );
|
||||
Level.Game.Broadcast(self,TextMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bScoreMode)
|
||||
{
|
||||
VoteCount = int(GetPlayerScore(PlayerController(Voter)));
|
||||
TextMessage = lmsgMapVotedForWithCount;
|
||||
TextMessage = repl(TextMessage, "%playername%", PlayerController(Voter).PlayerReplicationInfo.PlayerName );
|
||||
TextMessage = repl(TextMessage, "%votecount%", string(VoteCount) );
|
||||
TextMessage = repl(TextMessage, "%mapname%", MapList[MapIndex].MapName $ "(" $ GameConfig[GameIndex].Acronym $ ")" );
|
||||
Level.Game.Broadcast(self,TextMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
VoteCount = 1;
|
||||
TextMessage = lmsgMapVotedFor;
|
||||
TextMessage = repl(TextMessage, "%playername%", PlayerController(Voter).PlayerReplicationInfo.PlayerName );
|
||||
TextMessage = repl(TextMessage, "%mapname%", MapList[MapIndex].MapName $ "(" $ GameConfig[GameIndex].Acronym $ ")" );
|
||||
Level.Game.Broadcast(self,TextMessage);
|
||||
}
|
||||
}
|
||||
UpdateVoteCount(MapIndex, GameIndex, VoteCount);
|
||||
if (PrevMapVote > -1 && PrevGameVote > -1)
|
||||
UpdateVoteCount(PrevMapVote, PrevGameVote, -MVRI[Index].VoteCount); // undo previous vote
|
||||
MVRI[Index].VoteCount = VoteCount;
|
||||
TallyVotes(false);
|
||||
}
|
||||
13
kf_sources/KFPatcher/Classes/stub_VotingReplicationInfo.uc
Normal file
13
kf_sources/KFPatcher/Classes/stub_VotingReplicationInfo.uc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class stub_VotingReplicationInfo extends VotingReplicationInfo;
|
||||
|
||||
|
||||
function SendMapVote(int MapIndex, int p_GameIndex)
|
||||
{
|
||||
local KFPlayerController kfpc;
|
||||
|
||||
kfpc = KFPlayerController(Owner);
|
||||
DebugLog("MVRI.SendMapVote(" $ MapIndex $ ", " $ p_GameIndex $ ")");
|
||||
|
||||
if (kfpc != none && !kfpc.PlayerReplicationInfo.bOnlySpectator)
|
||||
VH.SubmitMapVote(MapIndex,p_GameIndex,Owner);
|
||||
}
|
||||
48
kf_sources/KFPatcher/Classes/stub_Z_Bloat.uc
Normal file
48
kf_sources/KFPatcher/Classes/stub_Z_Bloat.uc
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
class stub_Z_Bloat extends ZombieBloat;
|
||||
|
||||
|
||||
function SpawnTwoShots()
|
||||
{
|
||||
local vector X,Y,Z, FireStart;
|
||||
local rotator FireRotation;
|
||||
|
||||
// check this from the very start to prevent any log spam
|
||||
if (Controller == none || IsInState('ZombieDying'))
|
||||
return;
|
||||
|
||||
if (KFDoorMover(Controller.Target) != none)
|
||||
{
|
||||
Controller.Target.TakeDamage(22, Self, Location, vect(0,0,0), class'DamTypeVomit');
|
||||
return;
|
||||
}
|
||||
|
||||
GetAxes(Rotation,X,Y,Z);
|
||||
FireStart = Location+(vect(30,0,64) >> Rotation)*DrawScale;
|
||||
if (!SavedFireProperties.bInitialized)
|
||||
{
|
||||
SavedFireProperties.AmmoClass = class'SkaarjAmmo';
|
||||
SavedFireProperties.ProjectileClass = class'KFBloatVomit';
|
||||
SavedFireProperties.WarnTargetPct = 1;
|
||||
SavedFireProperties.MaxRange = 500;
|
||||
SavedFireProperties.bTossed = false;
|
||||
SavedFireProperties.bTrySplash = false;
|
||||
SavedFireProperties.bLeadTarget = true;
|
||||
SavedFireProperties.bInstantHit = true;
|
||||
SavedFireProperties.bInitialized = true;
|
||||
}
|
||||
|
||||
// Turn off extra collision before spawning vomit, otherwise spawn fails
|
||||
ToggleAuxCollision(false);
|
||||
FireRotation = Controller.AdjustAim(SavedFireProperties,FireStart,600);
|
||||
Spawn(class'KFBloatVomit',self,,FireStart,FireRotation);
|
||||
|
||||
FireStart -= (0.5*CollisionRadius*Y);
|
||||
FireRotation.Yaw -= 1200;
|
||||
spawn(class'KFBloatVomit',self,,FireStart, FireRotation);
|
||||
|
||||
FireStart += (CollisionRadius*Y);
|
||||
FireRotation.Yaw += 2400;
|
||||
spawn(class'KFBloatVomit', self,, FireStart, FireRotation);
|
||||
// Turn extra collision back on
|
||||
ToggleAuxCollision(true);
|
||||
}
|
||||
182
kf_sources/KFPatcher/Classes/stub_Z_Boss.uc
Normal file
182
kf_sources/KFPatcher/Classes/stub_Z_Boss.uc
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
class stub_Z_Boss extends ZombieBoss;
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ammo class == none fix
|
||||
//=============================================================================
|
||||
|
||||
state FireMissile
|
||||
{
|
||||
function AnimEnd( int Channel )
|
||||
{
|
||||
local vector Start;
|
||||
local Rotator R;
|
||||
|
||||
Start = GetBoneCoords('tip').Origin;
|
||||
|
||||
// at least shoot at someone, not walls
|
||||
if (Controller.Target == none)
|
||||
Controller.Target = Controller.Enemy;
|
||||
|
||||
// fix MyAmmo none logs
|
||||
if (!SavedFireProperties.bInitialized)
|
||||
{
|
||||
SavedFireProperties.AmmoClass = class'SkaarjAmmo';
|
||||
SavedFireProperties.ProjectileClass = class'BossLAWProj';
|
||||
SavedFireProperties.WarnTargetPct = 0.15;
|
||||
SavedFireProperties.MaxRange = 10000;
|
||||
SavedFireProperties.bTossed = false;
|
||||
SavedFireProperties.bTrySplash = false;
|
||||
SavedFireProperties.bLeadTarget = true;
|
||||
SavedFireProperties.bInstantHit = true;
|
||||
SavedFireProperties.bInitialized = true;
|
||||
}
|
||||
|
||||
R = AdjustAim(SavedFireProperties,Start,100);
|
||||
PlaySound(RocketFireSound,SLOT_Interact,2.0,,TransientSoundRadius,,false);
|
||||
// added projectile owner
|
||||
spawn(class'BossLAWProj',self,,Start,R);
|
||||
|
||||
bShotAnim = true;
|
||||
Acceleration = vect(0,0,0);
|
||||
SetAnimAction('FireEndMissile');
|
||||
HandleWaitForAnim('FireEndMissile');
|
||||
|
||||
// Randomly send out a message about Patriarch shooting a rocket(5% chance)
|
||||
if ( FRand() < 0.05 && Controller.Enemy != none && PlayerController(Controller.Enemy.Controller) != none )
|
||||
{
|
||||
PlayerController(Controller.Enemy.Controller).Speech('AUTO', 10, "");
|
||||
}
|
||||
|
||||
GoToState('');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ctrl == none fixes
|
||||
//=============================================================================
|
||||
|
||||
function bool MeleeDamageTarget(int hitdamage, vector pushdir)
|
||||
{
|
||||
// added 'Controller != none' check
|
||||
if (Controller != none && Controller.Target != none && Controller.Target.IsA('NetKActor'))
|
||||
pushdir = Normal(Controller.Target.Location-Location)*100000;
|
||||
|
||||
return super(KFMonster).MeleeDamageTarget(hitdamage, pushdir);
|
||||
}
|
||||
|
||||
|
||||
// non-state one
|
||||
function ClawDamageTarget()
|
||||
{
|
||||
local vector PushDir;
|
||||
local name Anim;
|
||||
local float frame,rate;
|
||||
local float UsedMeleeDamage;
|
||||
local bool bDamagedSomeone;
|
||||
local KFHumanPawn P;
|
||||
local Actor OldTarget;
|
||||
|
||||
// check this from the very start to prevent any log spam
|
||||
if (Controller == none || IsInState('ZombieDying'))
|
||||
return;
|
||||
|
||||
if (MeleeDamage > 1)
|
||||
UsedMeleeDamage = (MeleeDamage - (MeleeDamage * 0.05)) + (MeleeDamage * (FRand() * 0.1));
|
||||
else
|
||||
UsedMeleeDamage = MeleeDamage;
|
||||
|
||||
GetAnimParams(1, Anim,frame,rate);
|
||||
|
||||
if (Controller != none && Controller.Target != none)
|
||||
PushDir = (damageForce * Normal(Controller.Target.Location - Location));
|
||||
else
|
||||
PushDir = damageForce * vector(Rotation);
|
||||
|
||||
// merging 2 similar checks
|
||||
// dick animation
|
||||
if (Anim == 'MeleeImpale')
|
||||
{
|
||||
MeleeRange = ImpaleMeleeDamageRange;
|
||||
bDamagedSomeone = MeleeDamageTarget(UsedMeleeDamage, PushDir);
|
||||
}
|
||||
// the hand animation
|
||||
else
|
||||
{
|
||||
MeleeRange = ClawMeleeDamageRange;
|
||||
OldTarget = Controller.Target;
|
||||
|
||||
foreach DynamicActors(class'KFHumanPawn', P)
|
||||
{
|
||||
if ( (P.Location - Location) dot PushDir > 0.0 ) // Added dot Product check in Balance Round 3
|
||||
{
|
||||
Controller.Target = P;
|
||||
bDamagedSomeone = bDamagedSomeone || MeleeDamageTarget(UsedMeleeDamage, damageForce * Normal(P.Location - Location)); // Always pushing players away added in Balance Round 3
|
||||
}
|
||||
}
|
||||
|
||||
Controller.Target = OldTarget;
|
||||
}
|
||||
|
||||
MeleeRange = default.MeleeRange;
|
||||
|
||||
if (bDamagedSomeone)
|
||||
{
|
||||
if (Anim == 'MeleeImpale')
|
||||
PlaySound(MeleeImpaleHitSound, SLOT_Interact, 2.0);
|
||||
else
|
||||
PlaySound(MeleeAttackHitSound, SLOT_Interact, 2.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// headshot fix while he is machinegunning
|
||||
//=============================================================================
|
||||
|
||||
state FireChaingun
|
||||
{
|
||||
function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex)
|
||||
{
|
||||
local float EnemyDistSq, DamagerDistSq;
|
||||
|
||||
// changed vect(0,0,0) with Momentum
|
||||
global.TakeDamage(Damage,instigatedBy,hitlocation,Momentum,damageType);
|
||||
|
||||
// if someone close up is shooting us, just charge them
|
||||
if (InstigatedBy != none)
|
||||
{
|
||||
DamagerDistSq = VSizeSquared(Location - InstigatedBy.Location);
|
||||
|
||||
if ( (ChargeDamage > 200 && DamagerDistSq < (500 * 500)) || DamagerDistSq < (100 * 100) )
|
||||
{
|
||||
SetAnimAction('transition');
|
||||
GoToState('Charging');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Controller.Enemy != none && InstigatedBy != none && InstigatedBy != Controller.Enemy)
|
||||
{
|
||||
EnemyDistSq = VSizeSquared(Location - Controller.Enemy.Location);
|
||||
DamagerDistSq = VSizeSquared(Location - InstigatedBy.Location);
|
||||
}
|
||||
|
||||
if (InstigatedBy != none && (DamagerDistSq < EnemyDistSq || Controller.Enemy == none) )
|
||||
{
|
||||
MonsterController(Controller).ChangeEnemy(InstigatedBy,Controller.CanSee(InstigatedBy));
|
||||
Controller.Target = InstigatedBy;
|
||||
Controller.Focus = InstigatedBy;
|
||||
|
||||
if( DamagerDistSq < (500 * 500) )
|
||||
{
|
||||
SetAnimAction('transition');
|
||||
GoToState('Charging');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defaultproperties{}
|
||||
74
kf_sources/KFPatcher/Classes/stub_Z_Husk.uc
Normal file
74
kf_sources/KFPatcher/Classes/stub_Z_Husk.uc
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
class stub_Z_Husk extends ZombieHusk_HALLOWEEN;
|
||||
|
||||
|
||||
function SpawnTwoShots()
|
||||
{
|
||||
local vector X,Y,Z, FireStart;
|
||||
local rotator FireRotation;
|
||||
local KFMonsterController KFMonstControl;
|
||||
|
||||
if (Controller == none || IsInState('ZombieDying') || IsInState('GettingOutOfTheWayOfShot') || Physics == PHYS_Falling)
|
||||
return;
|
||||
|
||||
if (KFDoorMover(Controller.Target) != none)
|
||||
{
|
||||
Controller.Target.TakeDamage(22, Self, Location,vect(0,0,0), Class'DamTypeVomit');
|
||||
return;
|
||||
}
|
||||
|
||||
GetAxes(Rotation,X,Y,Z);
|
||||
FireStart = GetBoneCoords('Barrel').Origin;
|
||||
|
||||
// detect outer and change projectile class
|
||||
// since we use this function for all husk classes
|
||||
if (ClassIsChildOf(self.class, class'ZombieHusk_HALLOWEEN'))
|
||||
HuskFireProjClass = class'KFChar.HuskFireProjectile_HALLOWEEN';
|
||||
else
|
||||
HuskFireProjClass = class'KFChar.HuskFireProjectile';
|
||||
|
||||
// if (self.class.name == 'ZombieHusk_HALLOWEEN')
|
||||
// HuskFireProjClass = class'KFChar.HuskFireProjectile_HALLOWEEN';
|
||||
// else
|
||||
// HuskFireProjClass = class'KFChar.HuskFireProjectile';
|
||||
|
||||
if (!SavedFireProperties.bInitialized)
|
||||
{
|
||||
SavedFireProperties.AmmoClass = class'SkaarjAmmo';
|
||||
SavedFireProperties.ProjectileClass = HuskFireProjClass;
|
||||
SavedFireProperties.WarnTargetPct = 1;
|
||||
SavedFireProperties.MaxRange = 65535;
|
||||
SavedFireProperties.bTossed = false;
|
||||
SavedFireProperties.bTrySplash = true;
|
||||
SavedFireProperties.bLeadTarget = true;
|
||||
SavedFireProperties.bInstantHit = false;
|
||||
SavedFireProperties.bInitialized = true;
|
||||
}
|
||||
|
||||
// Turn off extra collision before spawning projectile, otherwise spawn fails
|
||||
ToggleAuxCollision(false);
|
||||
|
||||
FireRotation = Controller.AdjustAim(SavedFireProperties, FireStart, 600);
|
||||
|
||||
// do not move fleshpounds !
|
||||
foreach DynamicActors(class'KFMonsterController', KFMonstControl)
|
||||
{
|
||||
// I gotta love this one, Jaby
|
||||
// ignore zeds that the husk can't see...
|
||||
if (KFMonstControl== none || !LineOfSightTo(KFMonstControl))
|
||||
continue;
|
||||
|
||||
if (KFMonstControl != Controller && !ClassIsChildOf(KFMonstControl, class'FleshpoundZombieController'))
|
||||
{
|
||||
if (PointDistToLine(KFMonstControl.Pawn.Location, vector(FireRotation), FireStart) < 75 )
|
||||
{
|
||||
KFMonstControl.GetOutOfTheWayOfShot(vector(FireRotation),FireStart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// added projectile owner...
|
||||
Spawn(HuskFireProjClass,self,,FireStart,FireRotation);
|
||||
|
||||
// Turn extra collision back on
|
||||
ToggleAuxCollision(true);
|
||||
}
|
||||
142
kf_sources/KFPatcher/Classes/stub_Z_Scrake.uc
Normal file
142
kf_sources/KFPatcher/Classes/stub_Z_Scrake.uc
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
class stub_Z_Scrake extends ZombieScrake;
|
||||
|
||||
|
||||
var ZombieScrake sc;
|
||||
|
||||
|
||||
// vector HeadOffset = vect(0,0,0)
|
||||
// KFMonster = M
|
||||
// Poosh (c) coz i was lazy to do lame hack
|
||||
function bool IsHeadShot(vector HitLoc, vector ray, float AdditionalScale)
|
||||
{
|
||||
local coords C;
|
||||
// we are not gonna use some local vars, sooo... lets hope it wont crash
|
||||
local vector HeadLoc, diff; // B, M, not using these two
|
||||
// local float t, DotMM, Distance;
|
||||
local int look;
|
||||
local bool bUseAltHeadShotLocation;
|
||||
local bool bWasAnimating;
|
||||
|
||||
if (HeadBone == '')
|
||||
return false;
|
||||
|
||||
if (Level.NetMode == NM_DedicatedServer && !bShotAnim) // addition!
|
||||
{
|
||||
// If we are a dedicated server estimate what animation is most likely playing on the client
|
||||
switch (Physics)
|
||||
{
|
||||
case PHYS_Walking:
|
||||
bWasAnimating = IsAnimating(0) || IsAnimating(1);
|
||||
if (!bWasAnimating)
|
||||
{
|
||||
if (bIsCrouched)
|
||||
{
|
||||
PlayAnim(IdleCrouchAnim, 1.0, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
bUseAltHeadShotLocation=true;
|
||||
}
|
||||
}
|
||||
if (bDoTorsoTwist && !bUseAltHeadShotLocation)
|
||||
{
|
||||
SmoothViewYaw = Rotation.Yaw;
|
||||
SmoothViewPitch = ViewPitch;
|
||||
look = (256 * ViewPitch) & 65535;
|
||||
if (look > 32768)
|
||||
look -= 65536;
|
||||
|
||||
SetTwistLook(0, look);
|
||||
}
|
||||
break;
|
||||
|
||||
case PHYS_Falling:
|
||||
case PHYS_Flying:
|
||||
PlayAnim(AirAnims[0], 1.0, 0.0);
|
||||
break;
|
||||
|
||||
case PHYS_Swimming:
|
||||
PlayAnim(SwimAnims[0], 1.0, 0.0);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bWasAnimating && !bUseAltHeadShotLocation)
|
||||
{
|
||||
SetAnimFrame(0.5);
|
||||
}
|
||||
}
|
||||
|
||||
if (bUseAltHeadShotLocation)
|
||||
{
|
||||
HeadLoc = Location + (OnlineHeadshotOffset >> Rotation);
|
||||
AdditionalScale *= OnlineHeadshotScale;
|
||||
}
|
||||
else
|
||||
{
|
||||
diff = vect(0,0,0);
|
||||
C = GetBoneCoords(HeadBone);
|
||||
HeadLoc = C.Origin + (HeadHeight * HeadScale * AdditionalScale * C.XAxis) + diff.X * C.XAxis + diff.Y * C.YAxis + diff.Z * C.ZAxis;
|
||||
}
|
||||
|
||||
return class'stub_Z_Scrake'.static.TestHitboxSphere(HitLoc, Ray, HeadLoc, HeadRadius * HeadScale * AdditionalScale);
|
||||
}
|
||||
|
||||
|
||||
// Poosh (c) coz i was lazy to do lame hack
|
||||
static final function bool TestHitboxSphere(vector HitLoc, vector Ray, vector SphereLoc, float SphereRadius)
|
||||
{
|
||||
local vector HitToSphere; // vector from HitLoc to SphereLoc
|
||||
local vector P;
|
||||
|
||||
SphereRadius *= SphereRadius; // square it to avoid doing sqrt()
|
||||
|
||||
HitToSphere = SphereLoc - HitLoc;
|
||||
if (VSizeSquared(HitToSphere) < SphereRadius)
|
||||
{
|
||||
// HitLoc is already inside the sphere - no projection needed
|
||||
return true;
|
||||
}
|
||||
|
||||
// HitToSphere dot Ray = cos(A) * VSize(HitToSphere) = VSize(P - HitLoc)
|
||||
P = HitLoc + Ray * (HitToSphere dot Ray);
|
||||
|
||||
return VSizeSquared(P - SphereLoc) < SphereRadius;
|
||||
}
|
||||
|
||||
|
||||
// Getter for the Original groundspeed of the zed (adjusted for difficulty, etc)
|
||||
simulated function float GetOriginalGroundSpeed()
|
||||
{
|
||||
if (owner != none && owner.class.name == 'SawZombieController')
|
||||
{
|
||||
if (IsInState('RunningState'))
|
||||
return OriginalGroundSpeed *= OriginalGroundSpeed;
|
||||
else if (IsInState('SawingLoop'))
|
||||
return OriginalGroundSpeed *= AttackChargeRate;
|
||||
else if (IsInState(''))
|
||||
return OriginalGroundSpeed;
|
||||
}
|
||||
|
||||
if( bZedUnderControl )
|
||||
{
|
||||
return OriginalGroundSpeed * 1.25;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return OriginalGroundSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function EndState()
|
||||
{
|
||||
log("FUCK YEA!");
|
||||
if( !bZapped )
|
||||
{
|
||||
SetGroundSpeed(GetOriginalGroundSpeed());
|
||||
}
|
||||
bCharging = False;
|
||||
if( Level.NetMode!=NM_DedicatedServer )
|
||||
PostNetReceive();
|
||||
}
|
||||
11
kf_sources/KFPatcher/Classes/stub_Z_Scrake_Ctrl.uc
Normal file
11
kf_sources/KFPatcher/Classes/stub_Z_Scrake_Ctrl.uc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class stub_Z_Scrake_Ctrl extends SawZombieController;
|
||||
|
||||
|
||||
function EndState()
|
||||
{
|
||||
if (Pawn != None)
|
||||
{
|
||||
Pawn.AccelRate = Pawn.Default.AccelRate;
|
||||
Pawn.GroundSpeed = ZombieScrake(Pawn).GetOriginalGroundSpeed();
|
||||
}
|
||||
}
|
||||
67
kf_sources/KFPatcher/Classes/stub_Z_Siren.uc
Normal file
67
kf_sources/KFPatcher/Classes/stub_Z_Siren.uc
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
class stub_Z_Siren extends ZombieSiren;
|
||||
|
||||
|
||||
// if decapped no scream
|
||||
simulated function SpawnTwoShots()
|
||||
{
|
||||
// added bDecapitated check
|
||||
// headless chickens can't cry
|
||||
if (bZapped || bDecapitated)
|
||||
return;
|
||||
|
||||
DoShakeEffect();
|
||||
|
||||
if (Level.NetMode != NM_Client)
|
||||
{
|
||||
if (Controller != none && KFDoorMover(Controller.Target) != none)
|
||||
Controller.Target.TakeDamage(ScreamDamage*0.6,Self,Location,vect(0,0,0),ScreamDamageType);
|
||||
else
|
||||
HurtRadius(ScreamDamage ,ScreamRadius, ScreamDamageType, ScreamForce, Location);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
simulated function HurtRadius( float DamageAmount, float DamageRadius, class<DamageType> DamageType, float Momentum, vector HitLocation )
|
||||
{
|
||||
local actor Victims;
|
||||
local float damageScale, dist;
|
||||
local vector dir;
|
||||
local float UsedDamageAmount;
|
||||
|
||||
if (bHurtEntry)
|
||||
return;
|
||||
|
||||
bHurtEntry = true;
|
||||
foreach VisibleCollidingActors(class'Actor', Victims, DamageRadius, HitLocation)
|
||||
{
|
||||
// don't let blast damage affect fluid - VisibleCollisingActors doesn't really work for them - jag
|
||||
// Or Karma actors in this case. Self inflicted Death due to flying chairs is uncool for a zombie of your stature.
|
||||
if ( (Victims != self) && !Victims.IsA('FluidSurfaceInfo') && !Victims.IsA('KFMonster') && !Victims.IsA('ExtendedZCollision') )
|
||||
{
|
||||
Momentum = ScreamForce; // bugfix, when pull wasn't applied always -- PooSH
|
||||
dir = Victims.Location - HitLocation;
|
||||
dist = FMax(1,VSize(dir));
|
||||
dir = dir/dist;
|
||||
damageScale = 1 - FMax(0,(dist - Victims.CollisionRadius)/DamageRadius);
|
||||
|
||||
if (!Victims.IsA('KFHumanPawn')) // If it aint human, don't pull the vortex crap on it.
|
||||
Momentum = 0;
|
||||
|
||||
if (Victims.IsA('KFGlassMover')) // Hack for shattering in interesting ways.
|
||||
{
|
||||
UsedDamageAmount = 100000; // Siren always shatters glass
|
||||
}
|
||||
else
|
||||
{
|
||||
UsedDamageAmount = DamageAmount;
|
||||
}
|
||||
|
||||
// fixed instigator not set to self!
|
||||
Victims.TakeDamage(damageScale * UsedDamageAmount, self, Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dir,(damageScale * Momentum * dir),DamageType);
|
||||
|
||||
if (Instigator != None && Vehicle(Victims) != None && Vehicle(Victims).Health > 0)
|
||||
Vehicle(Victims).DriverRadiusDamage(UsedDamageAmount, DamageRadius, Instigator.Controller, DamageType, Momentum, HitLocation);
|
||||
}
|
||||
}
|
||||
bHurtEntry = false;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue