First commit
This commit is contained in:
commit
5b48414900
263 changed files with 24830 additions and 0 deletions
10
sources/Weapons/BaseWeaponClasses/NiceAmmo.uc
Normal file
10
sources/Weapons/BaseWeaponClasses/NiceAmmo.uc
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class NiceAmmo extends KFAmmunition;
|
||||
var class<NiceWeaponPickup> WeaponPickupClass;
|
||||
function UpdateAmmoAmount(){
|
||||
MaxAmmo = Default.MaxAmmo;
|
||||
if(KFPawn(Owner) != none && KFPlayerReplicationInfo(KFPawn(Owner).PlayerReplicationInfo) != none &&
KFPlayerReplicationInfo(KFPawn(Owner).PlayerReplicationInfo).ClientVeteranSkill != none)
MaxAmmo = float(MaxAmmo) * KFPlayerReplicationInfo(KFPawn(Owner).PlayerReplicationInfo).ClientVeteranSkill.Static.AddExtraAmmoFor(KFPlayerReplicationInfo(KFPawn(Owner).PlayerReplicationInfo), Class);
|
||||
AmmoAmount = Min(AmmoAmount, MaxAmmo);
|
||||
}
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
15
sources/Weapons/BaseWeaponClasses/NiceAmmoPickup.uc
Normal file
15
sources/Weapons/BaseWeaponClasses/NiceAmmoPickup.uc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class NiceAmmoPickup extends ScrnAmmoPickup;
|
||||
state Pickup
|
||||
{
|
||||
// When touched by an actor.
|
||||
function Touch(Actor Other){
local Inventory CurInv;
local bool bPickedUp;
local int AmmoPickupAmount;
if(Pawn(Other) != none && Pawn(Other).bCanPickupInventory && Pawn(Other).Controller != none && FastTrace(Other.Location, Location)){
for(CurInv = Other.Inventory;CurInv != none;CurInv = CurInv.Inventory){
|
||||
if(KFAmmunition(CurInv) != none && KFAmmunition(CurInv).bAcceptsAmmoPickups){
if(KFAmmunition(CurInv).AmmoPickupAmount > 0){
if(KFAmmunition(CurInv).AmmoAmount < KFAmmunition(CurInv).MaxAmmo){
if(KFPlayerReplicationInfo(Pawn(Other).PlayerReplicationInfo) != none && KFPlayerReplicationInfo(Pawn(Other).PlayerReplicationInfo).ClientVeteranSkill != none)
AmmoPickupAmount = float(KFAmmunition(CurInv).AmmoPickupAmount) * KFPlayerReplicationInfo(Pawn(Other).PlayerReplicationInfo).ClientVeteranSkill.static.GetAmmoPickupMod(KFPlayerReplicationInfo(Pawn(Other).PlayerReplicationInfo), KFAmmunition(CurInv));
else
AmmoPickupAmount = KFAmmunition(CurInv).AmmoPickupAmount;
|
||||
KFAmmunition(CurInv).AmmoAmount = Min(KFAmmunition(CurInv).MaxAmmo, KFAmmunition(CurInv).AmmoAmount + AmmoPickupAmount);
bPickedUp = true;
}
}
else if(KFAmmunition(CurInv).AmmoAmount < KFAmmunition(CurInv).MaxAmmo){
bPickedUp = true;
if(FRand() <= (1.0 / Level.Game.GameDifficulty))
KFAmmunition(CurInv).AmmoAmount++;
}
}
}
|
||||
if(bPickedUp){
|
||||
AnnouncePickup(Pawn(Other));
GotoState('Sleeping', 'Begin');
|
||||
if(KFGameType(Level.Game) != none)
KFGameType(Level.Game).AmmoPickedUp(self);
}
}
|
||||
}
|
||||
}
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
63
sources/Weapons/BaseWeaponClasses/NiceAttachment.uc
Normal file
63
sources/Weapons/BaseWeaponClasses/NiceAttachment.uc
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
class NiceAttachment extends ScrnLaserWeaponAttachment
|
||||
abstract;
|
||||
var array<string> SkinRefs;
|
||||
var bool bSpawnLight;
|
||||
var bool bSecondaryModeNoEffects;
|
||||
static function PreloadAssets(optional KFWeaponAttachment Spawned){
|
||||
local int i;
|
||||
if(default.Mesh == none && default.MeshRef != "")
UpdateDefaultMesh(Mesh(DynamicLoadObject(default.MeshRef, class'Mesh', true)));
|
||||
if(default.AmbientSound == none && default.AmbientSoundRef != "")
default.AmbientSound = sound(DynamicLoadObject(default.AmbientSoundRef, class'Sound', true));
|
||||
if(Spawned != none){
Spawned.LinkMesh(default.Mesh);
Spawned.AmbientSound = default.AmbientSound;
|
||||
}
|
||||
for(i = 0; i < default.SkinRefs.Length;i ++){
if(default.SkinRefs[i] != "" && (default.Skins.Length < i + 1 || default.Skins[i] == none))
default.Skins[i] = Material(DynamicLoadObject(default.SkinRefs[i], class'Material'));
if(Spawned != none)
Spawned.Skins[i] = default.Skins[i];
|
||||
}
|
||||
}
|
||||
static function bool UnloadAssets(){
|
||||
local int i;
|
||||
UpdateDefaultMesh(none);
|
||||
default.AmbientSound = none;
|
||||
for(i = 0;i < default.Skins.Length;i ++)
default.Skins[i] = none;
|
||||
return super.UnloadAssets();
|
||||
}
|
||||
simulated event ThirdPersonEffects(){
|
||||
local NicePlayerController PC;
|
||||
if((Level.NetMode == NM_DedicatedServer) || (Instigator == none))
return;
|
||||
PC = NicePlayerController(Level.GetLocalPlayerController());
|
||||
if(FiringMode == 0){
if(OldSpawnHitCount != SpawnHitCount){
OldSpawnHitCount = SpawnHitCount;
GetHitInfo();
if(((Instigator != none) && (Instigator.Controller == PC)) || (VSize(PC.ViewTarget.Location - mHitLocation) < 4000)){
if(PC != Instigator.Controller){
if(mHitActor != none)
Spawn(class'ROBulletHitEffect',,, mHitLocation, Rotator(-mHitNormal));
CheckForSplash();
SpawnTracer();
}
}
}
|
||||
}
|
||||
if(FlashCount > 0){
if(KFPawn(Instigator) != none){
if(FiringMode == 0)
KFPawn(Instigator).StartFiringX(false, bRapidFire);
else
KFPawn(Instigator).StartFiringX(true, bRapidFire);
}
if(bDoFiringEffects && (!bSecondaryModeNoEffects || FiringMode == 0)){
if((Level.TimeSeconds - LastRenderTime > 0.2) && (Instigator.Controller != PC))
return;
if(bSpawnLight)
WeaponLight();
DoFlashEmitter();
ThirdPersonShellEject();
}
|
||||
}
|
||||
else{
GotoState('');
if(KFPawn(Instigator) != none)
KFPawn(Instigator).StopFiring();
|
||||
}
|
||||
}
|
||||
function UpdateHit(Actor HitActor, vector HitLocation, vector HitNormal){
|
||||
SpawnHitCount++;
|
||||
mHitLocation = HitLocation;
|
||||
mHitActor = HitActor;
|
||||
mHitNormal = HitNormal;
|
||||
NetUpdateTime = Level.TimeSeconds - 1;
|
||||
}
|
||||
simulated function ThirdPersonShellEject(){
|
||||
if((mShellCaseEmitter == none) && (Level.DetailMode != DM_Low) && !Level.bDropDetail){
mShellCaseEmitter = Spawn(mShellCaseEmitterClass);
if(mShellCaseEmitter != none)
AttachToBone(mShellCaseEmitter, 'ShellPort');
|
||||
}
|
||||
if(mShellCaseEmitter != none)
mShellCaseEmitter.mStartParticles++;
|
||||
}
|
||||
simulated function SpawnTracerAtLocation(vector HitLocation){
|
||||
local vector SpawnLoc, SpawnDir, SpawnVel;
|
||||
local float hitDist;
|
||||
if(!bDoFiringEffects)
return;
|
||||
if(mTracer == none)
mTracer = Spawn(mTracerClass);
|
||||
if(mTracer != none){
SpawnLoc = GetTracerStart();
mTracer.SetLocation(SpawnLoc);
hitDist = VSize(HitLocation - SpawnLoc) - mTracerPullback;
SpawnDir = Normal(HitLocation - SpawnLoc);
if(hitDist > mTracerMinDistance){
SpawnVel = SpawnDir * mTracerSpeed;
mTracer.Emitters[0].StartVelocityRange.X.Min = SpawnVel.X;
mTracer.Emitters[0].StartVelocityRange.X.Max = SpawnVel.X;
mTracer.Emitters[0].StartVelocityRange.Y.Min = SpawnVel.Y;
mTracer.Emitters[0].StartVelocityRange.Y.Max = SpawnVel.Y;
mTracer.Emitters[0].StartVelocityRange.Z.Min = SpawnVel.Z;
mTracer.Emitters[0].StartVelocityRange.Z.Max = SpawnVel.Z;
|
||||
mTracer.Emitters[0].LifetimeRange.Min = hitDist / mTracerSpeed;
mTracer.Emitters[0].LifetimeRange.Max = mTracer.Emitters[0].LifetimeRange.Min;
|
||||
mTracer.SpawnParticle(1);
}
|
||||
}
|
||||
}
|
||||
simulated function CheckForSplashAtLocation(vector HitLoc){
|
||||
local Actor HitActor;
|
||||
local vector HitNormal, HitLocation;
|
||||
if(!Level.bDropDetail && (Level.DetailMode != DM_Low) && (SplashEffect != none) && !Instigator.PhysicsVolume.bWaterVolume){
// check for splash
bTraceWater = true;
HitActor = Trace(HitLocation, HitNormal, HitLoc, Instigator.Location, true);
bTraceWater = false;
if((FluidSurfaceInfo(HitActor) != none) || ((PhysicsVolume(HitActor) != none) && PhysicsVolume(HitActor).bWaterVolume))
Spawn(SplashEffect,,,HitLocation, rot(16384,0,0));
|
||||
}
|
||||
}
|
||||
defaultproperties
|
||||
{
bSpawnLight=True
|
||||
}
|
||||
16
sources/Weapons/BaseWeaponClasses/NiceDamTypeFire.uc
Normal file
16
sources/Weapons/BaseWeaponClasses/NiceDamTypeFire.uc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
class NiceDamTypeFire extends NiceWeaponDamageType
|
||||
abstract;
|
||||
static function AwardDamage(KFSteamStatsAndAchievements KFStatsAndAchievements, int Amount)
|
||||
{
|
||||
KFStatsAndAchievements.AddFlameThrowerDamage(Amount * default.heatPart);
|
||||
}
|
||||
defaultproperties
|
||||
{
|
||||
heatPart=1.000000
|
||||
bDealBurningDamage=True
|
||||
bCheckForHeadShots=False
|
||||
//WeaponClass=Class'NicePack.NiceFlame9mm'
|
||||
DeathString="%k incinerated %o."
|
||||
FemaleSuicide="%o roasted herself alive."
|
||||
MaleSuicide="%o roasted himself alive."
|
||||
}
|
||||
5
sources/Weapons/BaseWeaponClasses/NiceDamTypeSPAM.uc
Normal file
5
sources/Weapons/BaseWeaponClasses/NiceDamTypeSPAM.uc
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class NiceDamTypeSPAM extends NiceDamageTypeVetEnforcerBullets
|
||||
abstract;
|
||||
defaultproperties
|
||||
{
bodyDestructionMult=1.000000
HeadShotDamageMult=1.100000
DeathString="%k killed %o (with SPAM)."
FemaleSuicide="%o shot herself in the foot."
MaleSuicide="%o shot himself in the foot."
bRagdollBullet=True
bBulletHit=True
|
||||
}
|
||||
96
sources/Weapons/BaseWeaponClasses/NiceWeaponDamageType.uc
Normal file
96
sources/Weapons/BaseWeaponClasses/NiceWeaponDamageType.uc
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
class NiceWeaponDamageType extends KFProjectileWeaponDamageType
|
||||
abstract;
|
||||
enum DecapitationBehaviour{
|
||||
DB_PERKED, // Decap result depends on whether weapon is perked or not
|
||||
DB_DROP, // Weapon always drops decapped zeds
|
||||
DB_NODROP // Weapon never drops decapped zeds
|
||||
};
|
||||
var DecapitationBehaviour decapType;
|
||||
var float badDecapMod;
|
||||
var float goodDecapMod;
|
||||
var bool bFinisher; // If set to true, target will recieve double damage if that's would kill it
|
||||
var float prReqMultiplier; // How precise must head-shot be for damage multiplier to kick-in?
|
||||
var float prReqPrecise; // How precise must head-shot be to be considered precise?
|
||||
var float lockonTime;
|
||||
var float flinchMultiplier; // How effective is weapon for flinching zeds
|
||||
var float stunMultiplier; // How effective is weapon for stunning zeds
|
||||
var float heatPart; // How much of this damage should be a heat component?
|
||||
var float freezePower; // How good is weapon at freezing?
|
||||
var float bodyDestructionMult; // How much more damage do to body on a head-shot?
|
||||
var float headSizeModifier; // How much bigger (smaller) head should be to be detected by a shot with this damage type
|
||||
var bool bPenetrationHSOnly; // Only allow penetrations on head-shots
|
||||
var int MaxPenetrations; // Maximum of penetrations; 0 = no penetration, -1 = infinite penetration
|
||||
var float BigZedPenDmgReduction; // Additional penetration effect reduction after hitting big zeds. 0.5 = 50% red.
|
||||
var const int BigZedMinHealth; // If zed's base Health >= this value, zed counts as Big
|
||||
var float MediumZedPenDmgReduction; // Additional penetration effect reduction after hitting medium-size zeds. 0.5 = 50% red.
|
||||
var const int MediumZedMinHealth; // If zed's base Health >= this value, zed counts as Medium-size
|
||||
var float PenDmgReduction; // Penetration damage reduction after hitting small zed
|
||||
var float penDecapReduction; // Penetration decapitaion effectiveness reduction after hitting small zed
|
||||
var float penIncapReduction; // Penetration incapacitation (flinch or stun) effectiveness reduction after hitting small zed
|
||||
var bool bIsProjectile; // If original damage type's version was derived from 'KFProjectileWeaponDamageType', then set this to true
|
||||
// Scales exp gain according to given HardcoreLevel
|
||||
static function float getScale(int HL){
|
||||
HL = Max(0, HL);
|
||||
return 0.5 + Float(HL) * 0.1;
|
||||
}
|
||||
static function ScoredNiceHeadshot(KFSteamStatsAndAchievements KFStatsAndAchievements, class<KFMonster> monsterClass, int HL){
|
||||
ScoredHeadshot(KFStatsAndAchievements, monsterClass, false);
|
||||
}
|
||||
// New function for awarding damage to nice perks
|
||||
static function AwardNiceDamage(KFSteamStatsAndAchievements KFStatsAndAchievements, int Amount, int HL){}
|
||||
// New function for awarding kills to nice perks
|
||||
static function AwardNiceKill(KFSteamStatsAndAchievements KFStatsAndAchievements, KFPlayerController Killer, KFMonster Killed, int HL){}
|
||||
// Function that governs damage reduction on penetration
|
||||
// Return false if weapon shouldn't be allowed to penetrate anymore
|
||||
static function bool ReduceDamageAfterPenetration(out float Damage, float origDamage, Actor target, class<NiceWeaponDamageType> niceDmgType, bool bIsHeadshot, KFPlayerReplicationInfo KFPRI){
|
||||
local float penReduction;
|
||||
local NiceMonster niceZed;
|
||||
local NicePlayerController nicePlayer;
|
||||
local class<NiceVeterancyTypes> niceVet;
|
||||
// True if we can penetrate even body, but now penetrating a head and shouldn't reduce damage too much
|
||||
local bool bEasyHeadPenetration;
|
||||
// Init variables
|
||||
niceZed = NiceMonster(target);
|
||||
nicePlayer = NicePlayerController(KFPRI.Owner);
|
||||
niceVet = class'NiceVeterancyTypes'.static.GetVeterancy(KFPRI);
|
||||
bEasyHeadPenetration = bIsHeadshot && !niceDmgType.default.bPenetrationHSOnly;
|
||||
penReduction = niceDmgType.default.PenDmgReduction;
|
||||
// Apply zed reduction and perk reduction of reduction`
|
||||
if(niceZed != none){
|
||||
if(niceZed.default.Health >= default.BigZedMinHealth && (!bEasyHeadPenetration || niceDmgType.default.BigZedPenDmgReduction <= 0.0))
|
||||
penReduction *= niceDmgType.default.BigZedPenDmgReduction;
|
||||
else if(niceZed.default.Health >= default.MediumZedMinHealth && (!bEasyHeadPenetration || niceDmgType.default.MediumZedPenDmgReduction <= 0.0))
|
||||
penReduction *= niceDmgType.default.MediumZedPenDmgReduction;
|
||||
}
|
||||
else
|
||||
penReduction *= niceDmgType.default.BigZedPenDmgReduction;
|
||||
if(niceVet != none)
|
||||
penReduction = niceVet.static.GetPenetrationDamageMulti(KFPRI, penReduction, niceDmgType);
|
||||
// Assign new damage value and tell us if we should stop with penetration
|
||||
Damage *= penReduction;
|
||||
if(!bIsHeadshot && niceDmgType.default.bPenetrationHSOnly)
|
||||
return false;
|
||||
if(niceDmgType.default.MaxPenetrations < 0)
|
||||
return true;
|
||||
if(niceDmgType.default.MaxPenetrations == 0 || Damage / origDamage < (niceDmgType.default.PenDmgReduction ** (niceDmgType.default.MaxPenetrations + 1)) + 0.0001)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
defaultproperties
|
||||
{
|
||||
badDecapMod=0.500000
|
||||
goodDecapMod=1.000000
|
||||
prReqPrecise=0.750000
|
||||
flinchMultiplier=1.000000
|
||||
stunMultiplier=1.000000
|
||||
bodyDestructionMult=1.000000
|
||||
headSizeModifier=1.000000
|
||||
BigZedPenDmgReduction=0.500000
|
||||
BigZedMinHealth=1000
|
||||
MediumZedPenDmgReduction=0.750000
|
||||
MediumZedMinHealth=500
|
||||
PenDmgReduction=0.700000
|
||||
PawnDamageEmitter=None
|
||||
LowGoreDamageEmitter=None
|
||||
LowDetailEmitter=None
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue