Revert weapon conversion

This patch reverts first step of global weapon conversion
that would have halted the release of the next version for too long.
This commit is contained in:
Anton Tarasenko 2020-04-17 23:06:41 +07:00
commit 12d95e387e
757 changed files with 10788 additions and 4046 deletions

View file

@ -0,0 +1,4 @@
class NiceDamTypeFlareProjectileFire extends NiceDamTypeFire;
defaultproperties
{ HeadShotDamageMult=2.000000 WeaponClass=Class'NicePack.NiceFlareRevolver'
}

View file

@ -0,0 +1,4 @@
class NiceDamTypeFlareProjectileImpact extends ScrnDamTypeFlareProjectileImpact;
defaultproperties
{
}

View file

@ -0,0 +1,42 @@
class NiceDualFlareRevolver extends ScrnDualFlareRevolver;
function bool HandlePickupQuery( pickup Item )
{
if ( Item.InventoryType==Class'NicePack.NiceFlareRevolver' )
{ if( LastHasGunMsgTime < Level.TimeSeconds && PlayerController(Instigator.Controller) != none ) { LastHasGunMsgTime = Level.TimeSeconds + 0.5; PlayerController(Instigator.Controller).ReceiveLocalizedMessage(Class'KFMainMessages', 1); }
return True;
}
return Super.HandlePickupQuery(Item);
}
function DropFrom(vector StartLocation)
{
local int m;
local KFWeaponPickup Pickup;
local int AmmoThrown, OtherAmmo;
local KFWeapon SinglePistol;
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; SinglePistol = Spawn(Class'NicePack.NiceFlareRevolver'); SinglePistol.SellValue = SellValue / 2; SinglePistol.GiveTo(Instigator); SinglePistol.Ammo[0].AmmoAmount = OtherAmmo; SinglePistol.MagAmmoRemaining = MagAmmoRemaining / 2; MagAmmoRemaining = Max(MagAmmoRemaining-SinglePistol.MagAmmoRemaining,0);
}
Pickup = Spawn(class'NicePack.NiceFlareRevolverPickup',,, StartLocation);
if ( Pickup != none )
{ Pickup.InitDroppedPickupFor(self); Pickup.DroppedBy = PlayerController(Instigator.Controller); Pickup.Velocity = Velocity; //fixing dropping exploit Pickup.SellValue = SellValue / 2; Pickup.Cost = Pickup.SellValue / 0.75; Pickup.AmmoAmount[0] = AmmoThrown; Pickup.MagAmmoRemaining = MagAmmoRemaining; if (Instigator.Health > 0) Pickup.bThrown = true;
}
Destroyed();
Destroy();
}
simulated function bool PutDown()
{
if ( Instigator.PendingWeapon == none || Instigator.PendingWeapon.class == class'NicePack.NiceFlareRevolver' )
{ bIsReloading = false;
}
return super.PutDown();
}
defaultproperties
{ AppID=0 FireModeClass(0)=Class'NicePack.NiceDualFlareRevolverFire' DemoReplacement=Class'NicePack.NiceFlareRevolver' PickupClass=Class'NicePack.NiceDualFlareRevolverPickup' ItemName="Dual Flare revolvers NW"
}

View file

@ -0,0 +1,4 @@
class NiceDualFlareRevolverAmmo extends ScrnDualFlareRevolverAmmo;
defaultproperties
{ PickupClass=Class'NicePack.NiceDualFlareRevolverAmmoPickup'
}

View file

@ -0,0 +1,4 @@
class NiceDualFlareRevolverAmmoPickup extends ScrnDualFlareRevolverAmmoPickup;
defaultproperties
{ InventoryType=Class'NicePack.NiceDualFlareRevolverAmmo'
}

View file

@ -0,0 +1,4 @@
class NiceDualFlareRevolverFire extends ScrnDualFlareRevolverFire;
defaultproperties
{ AmmoClass=Class'NicePack.NiceDualFlareRevolverAmmo' ProjectileClass=Class'NicePack.NiceFlareRevolverProjectile'
}

View file

@ -0,0 +1,4 @@
class NiceDualFlareRevolverPickup extends ScrnDualFlareRevolverPickup;
defaultproperties
{ ItemName="Dual Flare Revolvers NW" ItemShortName="Dual Flare Rev. NW" InventoryType=Class'NicePack.NiceDualFlareRevolver'
}

View file

@ -0,0 +1,23 @@
class NiceFlareRevolver extends ScrnFlareRevolver;
simulated function bool PutDown()
{
if ( Instigator.PendingWeapon.class == class'NicePack.NiceDualFlareRevolver' )
{ bIsReloading = false;
}
return super(KFWeapon).PutDown();
}
function GiveTo( pawn Other, optional Pickup Pickup )
{
local KFPlayerReplicationInfo KFPRI;
local KFWeaponPickup WeapPickup;
KFPRI = KFPlayerReplicationInfo(Other.PlayerReplicationInfo);
WeapPickup = KFWeaponPickup(Pickup);
//pick the lowest sell value
if ( WeapPickup != none && KFPRI != none && KFPRI.ClientVeteranSkill != none ) { SellValue = 0.75 * min(WeapPickup.Cost, WeapPickup.default.Cost * KFPRI.ClientVeteranSkill.static.GetCostScaling(KFPRI, WeapPickup.class));
}
Super.GiveTo(Other,Pickup);
}
defaultproperties
{ AppID=0 FireModeClass(0)=Class'NicePack.NiceFlareRevolverFire' PickupClass=Class'NicePack.NiceFlareRevolverPickup' ItemName="Flare Revolver NW"
}

View file

@ -0,0 +1,4 @@
class NiceFlareRevolverAmmo extends ScrnFlareRevolverAmmo;
defaultproperties
{ PickupClass=Class'NicePack.NiceFlareRevolverAmmoPickup'
}

View file

@ -0,0 +1,4 @@
class NiceFlareRevolverAmmoPickup extends ScrnFlareRevolverAmmoPickup;
defaultproperties
{ InventoryType=Class'NicePack.NiceFlareRevolverAmmo'
}

View file

@ -0,0 +1,4 @@
class NiceFlareRevolverFire extends ScrnFlareRevolverFire;
defaultproperties
{ AmmoClass=Class'NicePack.NiceFlareRevolverAmmo' ProjectileClass=Class'NicePack.NiceFlareRevolverProjectile'
}

View file

@ -0,0 +1,24 @@
class NiceFlareRevolverPickup extends ScrnFlareRevolverPickup;
function inventory SpawnCopy( pawn Other ) {
local Inventory CurInv;
local KFWeapon PistolInInventory;
For( CurInv=Other.Inventory; CurInv!=none; CurInv=CurInv.Inventory ) { PistolInInventory = KFWeapon(CurInv); if( PistolInInventory != none && PistolInInventory.class == default.InventoryType ) { // destroy the inventory to force parent SpawnCopy() to make a new instance of class // we specified below if( Inventory!=none ) Inventory.Destroy(); // spawn dual guns instead of another instance of single InventoryType = DualInventoryType; // Make dualies to cost twice of lowest value in case of PERKED+UNPERKED pistols SellValue = 2 * min(SellValue, PistolInInventory.SellValue); AmmoAmount[0]+= PistolInInventory.AmmoAmount(0); MagAmmoRemaining+= PistolInInventory.MagAmmoRemaining; CurInv.Destroyed(); CurInv.Destroy(); Return Super(KFWeaponPickup).SpawnCopy(Other); }
}
InventoryType = Default.InventoryType;
Return Super(KFWeaponPickup).SpawnCopy(Other);
}
function bool CheckCanCarry(KFHumanPawn Hm) {
local Inventory CurInv;
local bool bHasSinglePistol;
local float AddWeight;
AddWeight = class<KFWeapon>(default.InventoryType).default.Weight;
for ( CurInv = Hm.Inventory; CurInv != none; CurInv = CurInv.Inventory ) { if ( CurInv.class == default.DualInventoryType ) { //already have duals, can't carry a single if ( LastCantCarryTime < Level.TimeSeconds && PlayerController(Hm.Controller) != none ) { LastCantCarryTime = Level.TimeSeconds + 0.5; PlayerController(Hm.Controller).ReceiveLocalizedMessage(Class'KFMainMessages', 2); } return false; } else if ( CurInv.class == default.InventoryType ) { bHasSinglePistol = true; AddWeight = default.DualInventoryType.default.Weight - AddWeight; break; }
}
if ( !Hm.CanCarry(AddWeight) ) { if ( LastCantCarryTime < Level.TimeSeconds && PlayerController(Hm.Controller) != none ) { LastCantCarryTime = Level.TimeSeconds + 0.5; PlayerController(Hm.Controller).ReceiveLocalizedMessage(Class'KFMainMessages', 2); }
return false;
}
return true;
}
defaultproperties
{ DualInventoryType=Class'NicePack.NiceDualFlareRevolver' ItemName="Flare Revolver NW" ItemShortName="Flare Rev. NW" InventoryType=Class'NicePack.NiceFlareRevolver'
}

View file

@ -0,0 +1,43 @@
class NiceFlareRevolverProjectile extends ScrnFlareRevolverProjectile;
//overrided to use alternate burning mechanism
simulated function HurtRadius( float DamageAmount, float DamageRadius, class<DamageType> DamageType, float Momentum, vector HitLocation )
{
local actor Victims;
local float damageScale, dist;
local vector dirs;
local int NumKilled;
local KFMonster KFMonsterVictim;
local Pawn P;
local KFPawn KFP;
local array<Pawn> CheckedPawns;
local int i;
local bool bAlreadyChecked;
if ( bHurtEntry ) return;
bHurtEntry = true;
foreach CollidingActors (class 'Actor', Victims, DamageRadius, HitLocation) { // null pawn variables here just to be sure they didn't left from previous iteration // and waste another day of my life to looking for this fucking bug -- PooSH /totallyPissedOff!!! P = none; KFMonsterVictim = none; KFP = none; // don't let blast damage affect fluid - VisibleCollisingActors doesn't really work for them - jag if( (Victims != self) && (Victims != Instigator) &&(Hurtwall != Victims) && (Victims.Role == ROLE_Authority) && !Victims.IsA('FluidSurfaceInfo') && ExtendedZCollision(Victims)==none && KFBulletWhipAttachment(Victims)==none ) { dirs = Victims.Location - HitLocation; dist = FMax(1,VSize(dirs)); dirs = dirs/dist; damageScale = 1 - FMax(0,(dist - Victims.CollisionRadius)/DamageRadius); if ( Instigator == none || Instigator.Controller == none ) Victims.SetDelayedDamageInstigatorController( InstigatorController ); if ( Victims == LastTouched ) LastTouched = none;
P = Pawn(Victims);
if( P != none ) { for (i = 0; i < CheckedPawns.Length; i++) { if (CheckedPawns[i] == P) { bAlreadyChecked = true; break; } }
if( bAlreadyChecked ) { bAlreadyChecked = false; P = none; continue; }
KFMonsterVictim = KFMonster(Victims);
if( KFMonsterVictim != none && KFMonsterVictim.Health <= 0 ) { KFMonsterVictim = none; }
KFP = KFPawn(Victims);
if( KFMonsterVictim != none ) { damageScale *= KFMonsterVictim.GetExposureTo(HitLocation); } else if( KFP != none ) { damageScale *= KFP.GetExposureTo(HitLocation); }
CheckedPawns[CheckedPawns.Length] = P;
if ( damageScale <= 0) { P = none; continue; } else { P = none; } }
Victims.TakeDamage ( damageScale * DamageAmount, Instigator, Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dirs, (damageScale * Momentum * dirs), DamageType//Class'NicePack.NiceDamTypeFlareProjectileFire' ); if (Vehicle(Victims) != none && Vehicle(Victims).Health > 0) Vehicle(Victims).DriverRadiusDamage(DamageAmount, DamageRadius, InstigatorController, DamageType,//Class'NicePack.NiceDamTypeFlareProjectileFire', Momentum, HitLocation);
if( Role == ROLE_Authority && KFMonsterVictim != none && KFMonsterVictim.Health <= 0 ) { NumKilled++; } }
}
/*
if ( (LastTouched != none) && (LastTouched != self) && (LastTouched != Instigator) && (LastTouched.Role == ROLE_Authority) && !LastTouched.IsA('FluidSurfaceInfo') )
{ Victims = LastTouched; LastTouched = none; dirs = Victims.Location - HitLocation; dist = FMax(1,VSize(dirs)); dirs = dirs/dist; damageScale = FMax(Victims.CollisionRadius/(Victims.CollisionRadius + Victims.CollisionHeight),1 - FMax(0,(dist - Victims.CollisionRadius)/DamageRadius)); if ( Instigator == none || Instigator.Controller == none ) Victims.SetDelayedDamageInstigatorController(InstigatorController);
log("Part 2 Doing "$(damageScale * DamageAmount)$" damage to "$Victims); Victims.TakeDamage ( damageScale * DamageAmount, Instigator, Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dirs, (damageScale * Momentum * dirs), DamageType ); if (Vehicle(Victims) != none && Vehicle(Victims).Health > 0) Vehicle(Victims).DriverRadiusDamage(DamageAmount, DamageRadius, InstigatorController, DamageType, Momentum, HitLocation);
}
*/
if( Role == ROLE_Authority )
{ if( NumKilled >= 4 ) { KFGameType(Level.Game).DramaticEvent(0.05); } else if( NumKilled >= 2 ) { KFGameType(Level.Game).DramaticEvent(0.03); }
}
bHurtEntry = false;
}
defaultproperties
{ ImpactDamageType=Class'NicePack.NiceDamTypeFlareProjectileImpact' MyDamageType=Class'NicePack.NiceDamTypeFlareProjectileFire'
}