169 lines
4.9 KiB
Ucode
169 lines
4.9 KiB
Ucode
//=============================================================================
|
|
// Magnum44Fire
|
|
//=============================================================================
|
|
// 44 Magnum primary fire class
|
|
//=============================================================================
|
|
// Killing Floor Source
|
|
// Copyright (C) 2011 Tripwire Interactive LLC
|
|
// - John "Ramm-Jaeger" Gibson
|
|
//=============================================================================
|
|
class Magnum44Fire extends KFFire;
|
|
|
|
// Weapon penetrates zeds
|
|
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;
|
|
While( (HitCount++)<10 )
|
|
{
|
|
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
|
|
if ( IgnoreActors.Length > 0 )
|
|
{
|
|
for (i=0; i<IgnoreActors.Length; i++)
|
|
{
|
|
IgnoreActors[i].SetCollision(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
defaultproperties
|
|
{
|
|
DamageType=Class'KFMod.DamTypeMagnum44Pistol'
|
|
DamageMin=85
|
|
DamageMax=105
|
|
Momentum=15000.000000
|
|
bPawnRapidFireAnim=false
|
|
bAttachSmokeEmitter=True
|
|
TransientSoundVolume=1.8
|
|
FireLoopAnim=
|
|
FireEndAnim=
|
|
FireAnimRate=1.000000
|
|
FireSoundRef="KF_RevolverSnd.Revolver_Fire_M"
|
|
StereoFireSoundRef="KF_RevolverSnd.Revolver_Fire_S"
|
|
NoAmmoSoundRef="KF_HandcannonSnd.50AE_DryFire"
|
|
AmmoClass=Class'KFMod.Magnum44Ammo'
|
|
AmmoPerFire=1
|
|
BotRefireRate=0.650000
|
|
FlashEmitterClass=Class'ROEffects.MuzzleFlash1stKar'
|
|
aimerror=40.000000
|
|
FireAimedAnim=Iron_Fire
|
|
|
|
Spread=0.009
|
|
SpreadStyle=SS_Random
|
|
|
|
FireRate=0.15
|
|
RecoilRate=0.07
|
|
maxVerticalRecoilAngle=1200
|
|
maxHorizontalRecoilAngle=200
|
|
bWaitForRelease=true
|
|
TweenTime=0.025
|
|
|
|
//** View shake **//
|
|
ShakeOffsetMag=(X=6.0,Y=1.0,Z=8.0)
|
|
ShakeOffsetRate=(X=1000.0,Y=1000.0,Z=1000.0)
|
|
ShakeOffsetTime=2.5
|
|
ShakeRotMag=(X=75.0,Y=75.0,Z=400.0)
|
|
ShakeRotRate=(X=12500.0,Y=12500.0,Z=10000.0)
|
|
ShakeRotTime=3.5
|
|
}
|