Skip to content

Commit

Permalink
[release] v2.6 Public Release
Browse files Browse the repository at this point in the history
- You can now modify AltFire Damage on all weapons, including healing on medic guns!
  • Loading branch information
Vel-San committed Aug 26, 2021
1 parent 117d89c commit 5c84a74
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 35 deletions.
20 changes: 10 additions & 10 deletions Config/WeaponStat_Config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ bDebug=False
# This list will 'Edit' the weapon stats
# If you want to keep default values, simply assign `-1` to the value
# and the script will automatically keep the default value :)! e.g. iMaxAmmo
aWeapon[0]=(sWeaponClassName="KFMod.M99SniperRifle",iInventoryGroup=4,iWeight=10,iCost=2750,iDamageMax=675,iMaxAmmo=-1,iMagCapacity=1,iAmmoCost=100,iImpactDamage=0,iProjPerFire=1,fHeadShotDamageMult=2.25,fSpread=0,fFireRate=3.03,fFireAnimRate=1.0,fReloadRate=2.6,fReloadAnimRate=2.0)
aWeapon[1]=(sWeaponClassName="KFMod.M32GrenadeLauncher",iInventoryGroup=4,iWeight=7,iCost=3250,iDamageMax=350,iMaxAmmo=-1,iMagCapacity=6,iAmmoCost=60,iImpactDamage=200,iProjPerFire=1,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.33,fFireAnimRate=1.0,fReloadRate=1.0,fReloadAnimRate=1.8)
aWeapon[2]=(sWeaponClassName="KFMod.CamoM32GrenadeLauncher",iInventoryGroup=4,iWeight=7,iCost=3250,iDamageMax=350,iMaxAmmo=-1,iMagCapacity=6,iAmmoCost=60,iImpactDamage=200,iProjPerFire=1,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.33,fFireAnimRate=1.0,fReloadRate=1.0,fReloadAnimRate=1.8)
aWeapon[3]=(sWeaponClassName="MGP.MGP",iInventoryGroup=4,iWeight=5,iCost=1500,iDamageMax=0,iMaxAmmo=-1,iMagCapacity=1,iAmmoCost=100,iImpactDamage=100,iProjPerFire=1,fHeadShotDamageMult=1,fSpread=0.01,fFireRate=1.5,fFireAnimRate=1.0,fReloadRate=1,fReloadAnimRate=1.5)
aWeapon[4]=(sWeaponClassName="KFMod.MP5MMedicGun",iInventoryGroup=3,iWeight=3,iCost=1375,iDamageMax=30,iMaxAmmo=-1,iMagCapacity=32,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.08,fFireAnimRate=1.0,fReloadRate=1.5,fReloadAnimRate=2.7)
aWeapon[5]=(sWeaponClassName="KFMod.CamoMP5MMedicGun",iInventoryGroup=3,iWeight=3,iCost=1375,iDamageMax=30,iMaxAmmo=-1,iMagCapacity=32,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.08,fFireAnimRate=1.0,fReloadRate=1.5,fReloadAnimRate=2.7)
aWeapon[6]=(sWeaponClassName="KFMod.KrissMMedicGun",iInventoryGroup=3,iWeight=3,iCost=2750,iDamageMax=40,iMaxAmmo=-1,iMagCapacity=30,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.06,fFireAnimRate=1.0,fReloadRate=1.5,fReloadAnimRate=2.6)
aWeapon[7]=(sWeaponClassName="KFMod.NeonKrissMMedicGun",iInventoryGroup=3,iWeight=3,iCost=2750,iDamageMax=40,iMaxAmmo=-1,iMagCapacity=30,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.06,fFireAnimRate=1.0,fReloadRate=1.5,fReloadAnimRate=2.6)
aWeapon[8]=(sWeaponClassName="KFMod.M7A3MMedicGun",iInventoryGroup=3,iWeight=5,iCost=2050,iDamageMax=70,iMaxAmmo=-1,iMagCapacity=20,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.5,fSpread=0.01,fFireRate=0.12,fFireAnimRate=1.2,fReloadRate=1.3,fReloadAnimRate=2.5)
aWeapon[9]=(sWeaponClassName="KFEnhancedMusket.EnhancedMusket",iInventoryGroup=4,iWeight=5,iCost=1500,iDamageMax=180,iMaxAmmo=-1,iMagCapacity=10,iAmmoCost=20,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=2,fSpread=0,fFireRate=0.94,fFireAnimRate=1.0,fReloadRate=2.87,fReloadAnimRate=1)
aWeapon[0]=(sWeaponClassName="KFMod.M99SniperRifle",iInventoryGroup=4,iWeight=10,iCost=2750,iDamageMax=675,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=1,iAmmoCost=100,iImpactDamage=0,iProjPerFire=1,fHeadShotDamageMult=2.25,fSpread=0,fFireRate=3.03,fFireAnimRate=1.0,fReloadRate=2.6,fReloadAnimRate=2.0)
aWeapon[1]=(sWeaponClassName="KFMod.M32GrenadeLauncher",iInventoryGroup=4,iWeight=7,iCost=3250,iDamageMax=350,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=6,iAmmoCost=60,iImpactDamage=200,iProjPerFire=1,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.33,fFireAnimRate=1.0,fReloadRate=1.0,fReloadAnimRate=1.8)
aWeapon[2]=(sWeaponClassName="KFMod.CamoM32GrenadeLauncher",iInventoryGroup=4,iWeight=7,iCost=3250,iDamageMax=350,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=6,iAmmoCost=60,iImpactDamage=200,iProjPerFire=1,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.33,fFireAnimRate=1.0,fReloadRate=1.0,fReloadAnimRate=1.8)
aWeapon[3]=(sWeaponClassName="MGP.MGP",iInventoryGroup=4,iWeight=5,iCost=1500,iDamageMax=0,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=1,iAmmoCost=100,iImpactDamage=100,iProjPerFire=1,fHeadShotDamageMult=1,fSpread=0.01,fFireRate=1.5,fFireAnimRate=1.0,fReloadRate=1,fReloadAnimRate=1.5)
aWeapon[4]=(sWeaponClassName="KFMod.MP5MMedicGun",iInventoryGroup=3,iWeight=3,iCost=1375,iDamageMax=30,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=32,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.08,fFireAnimRate=1.0,fReloadRate=1.5,fReloadAnimRate=2.7)
aWeapon[5]=(sWeaponClassName="KFMod.CamoMP5MMedicGun",iInventoryGroup=3,iWeight=3,iCost=1375,iDamageMax=30,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=32,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.08,fFireAnimRate=1.0,fReloadRate=1.5,fReloadAnimRate=2.7)
aWeapon[6]=(sWeaponClassName="KFMod.KrissMMedicGun",iInventoryGroup=3,iWeight=3,iCost=2750,iDamageMax=40,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=30,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.06,fFireAnimRate=1.0,fReloadRate=1.5,fReloadAnimRate=2.6)
aWeapon[7]=(sWeaponClassName="KFMod.NeonKrissMMedicGun",iInventoryGroup=3,iWeight=3,iCost=2750,iDamageMax=40,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=30,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.1,fSpread=0.01,fFireRate=0.06,fFireAnimRate=1.0,fReloadRate=1.5,fReloadAnimRate=2.6)
aWeapon[8]=(sWeaponClassName="KFMod.M7A3MMedicGun",iInventoryGroup=3,iWeight=5,iCost=2050,iDamageMax=70,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=20,iAmmoCost=10,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=1.5,fSpread=0.01,fFireRate=0.12,fFireAnimRate=1.2,fReloadRate=1.3,fReloadAnimRate=2.5)
aWeapon[9]=(sWeaponClassName="KFEnhancedMusket.EnhancedMusket",iInventoryGroup=4,iWeight=5,iCost=1500,iDamageMax=180,iAltFireDamageMax=-1,iMaxAmmo=-1,iMagCapacity=10,iAmmoCost=20,iImpactDamage=0,iProjPerFire=0,fHeadShotDamageMult=2,fSpread=0,fFireRate=0.94,fFireAnimRate=1.0,fReloadRate=2.87,fReloadAnimRate=1)

[WeaponStatConfig.Helper]
# This list is to 'Print' default stats for a weapon
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This mutator allows you to configure:

- Max Dmg
- Max Alt Fire Damage (Works for Medic Guns too)
- InventoryGroup
- Max Ammo
- Magazine Size
Expand Down
68 changes: 67 additions & 1 deletion WeaponStatConfig/Classes/Helper.uc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ static function PrintDefaultStats(optional bool bDebug)
MutLog("############## " $string(CurrentWeapon)$ " | " $CurrentWeaponPickup.default.ItemName$ " ##############");
DefaultStats[i].sWeaponClassName = string(CurrentWeapon);
// Modify Weapon AltFireDamage
if(CurrentWeapon.default.FireModeClass[1] != none
&& string(CurrentWeapon.default.FireModeClass[1]) != "KFMod.NoFire")
{
DefaultStats[i].iAltFireDamageMax = ModifyAltFireDmg(string(CurrentWeapon.default.FireModeClass[1]));
}
else
{
DefaultStats[i].iAltFireDamageMax = 0;
}
// Grab Needed Classes & Check WeaponFire types, then proceed to change values accordingly
if (class<KFFire>(DynamicLoadObject(string(CurrentWeapon.default.FireModeClass[0]), class'Class')) != none && class<KFHighROFFire>(DynamicLoadObject(string(CurrentWeapon.default.FireModeClass[0]), class'Class')) == none)
{
Expand Down Expand Up @@ -229,11 +240,66 @@ static function PrintDefaultStats(optional bool bDebug)
{
// Generate a copy-paste ready config for this weapon, with default variables
sReadyMadeConfig = "";
sReadyMadeConfig $= "aWeapon["$i$"]=(sWeaponClassName="$DefaultStats[i].sWeaponClassName$",iInventoryGroup="$DefaultStats[i].iInventoryGroup$",iWeight="$DefaultStats[i].iWeight$",iCost="$DefaultStats[i].iCost$",iDamageMax="$DefaultStats[i].iDamageMax$",iMaxAmmo="$DefaultStats[i].iMaxAmmo$",iMagCapacity="$DefaultStats[i].iMagCapacity$",iAmmoCost="$DefaultStats[i].iAmmoCost$",iImpactDamage="$DefaultStats[i].iImpactDamage$",iProjPerFire="$DefaultStats[i].iProjPerFire$",fHeadShotDamageMult="$DefaultStats[i].fHeadShotDamageMult$",fSpread="$DefaultStats[i].fSpread$",fFireRate="$DefaultStats[i].fFireRate$",fFireAnimRate="$DefaultStats[i].fFireAnimRate$",fReloadRate="$DefaultStats[i].fReloadRate$",fReloadAnimRate="$DefaultStats[i].fReloadAnimRate$")";
sReadyMadeConfig $= "aWeapon["$i$"]=(sWeaponClassName="$DefaultStats[i].sWeaponClassName$",iInventoryGroup="$DefaultStats[i].iInventoryGroup$",iWeight="$DefaultStats[i].iWeight$",iCost="$DefaultStats[i].iCost$",iDamageMax="$DefaultStats[i].iDamageMax$",iAltFireDamageMax="$DefaultStats[i].iAltFireDamageMax$",iMaxAmmo="$DefaultStats[i].iMaxAmmo$",iMagCapacity="$DefaultStats[i].iMagCapacity$",iAmmoCost="$DefaultStats[i].iAmmoCost$",iImpactDamage="$DefaultStats[i].iImpactDamage$",iProjPerFire="$DefaultStats[i].iProjPerFire$",fHeadShotDamageMult="$DefaultStats[i].fHeadShotDamageMult$",fSpread="$DefaultStats[i].fSpread$",fFireRate="$DefaultStats[i].fFireRate$",fFireAnimRate="$DefaultStats[i].fFireAnimRate$",fReloadRate="$DefaultStats[i].fReloadRate$",fReloadAnimRate="$DefaultStats[i].fReloadAnimRate$")";
MutLog(sReadyMadeConfig);
}
}

static function int ModifyAltFireDmg(string AltFireClass)
{
local int AltFireDamage;

// AltFire, if it exists
local class<KFFire> CurrentWeaponAltFire;
local class<KFShotgunFire> CurrentWeaponShotgunAltFire;
local class<KFMeleeFire> CurrentWeaponKFMeleeAltFire;
local class<KFHighROFFire> CurrentWeaponKFHighROFAltFire;

// IfDamage isn't in the base AltFireClass
local class<Projectile> CurrentWeaponProjectile;
local class<ShotgunBullet> CurrentWeaponShotgunBullet;
local class<LAWProj> CurrentWeaponLAWProj;

if (class<KFFire>(DynamicLoadObject(AltFireClass, class'Class')) != none && class<KFHighROFFire>(DynamicLoadObject(AltFireClass, class'Class')) == none)
{
CurrentWeaponAltFire = class<KFFire>(DynamicLoadObject(AltFireClass, class'Class'));
AltFireDamage = CurrentWeaponAltFire.default.DamageMax;
}
else if (class<KFHighROFFire>(DynamicLoadObject(AltFireClass, class'Class')) != none)
{
CurrentWeaponKFHighROFAltFire = class<KFHighROFFire>(DynamicLoadObject(AltFireClass, class'Class'));
AltFireDamage = CurrentWeaponKFHighROFAltFire.default.DamageMax;
}
else if (class<KFMeleeFire>(DynamicLoadObject(AltFireClass, class'Class')) != none)
{
CurrentWeaponKFMeleeAltFire = class<KFMeleeFire>(DynamicLoadObject(AltFireClass, class'Class'));
AltFireDamage = CurrentWeaponKFMeleeAltFire.default.MeleeDamage;
}
else if (class<KFShotgunFire>(DynamicLoadObject(AltFireClass, class'Class')) != none)
{
CurrentWeaponShotgunAltFire = class<KFShotgunFire>(DynamicLoadObject(AltFireClass, class'Class'));

if (class<Projectile>(DynamicLoadObject(string(CurrentWeaponShotgunAltFire.default.ProjectileClass), class'Class')) != none
&& class<ShotgunBullet>(DynamicLoadObject(string(CurrentWeaponShotgunAltFire.default.ProjectileClass), class'Class')) == none
&& class<LAWProj>(DynamicLoadObject(string(CurrentWeaponShotgunAltFire.default.ProjectileClass), class'Class')) == none)
{
CurrentWeaponProjectile = class<Projectile>(DynamicLoadObject(string(CurrentWeaponShotgunAltFire.default.ProjectileClass), class'Class'));
AltFireDamage = CurrentWeaponProjectile.default.Damage;
}
else if (class<ShotgunBullet>(DynamicLoadObject(string(CurrentWeaponShotgunAltFire.default.ProjectileClass), class'Class')) != none)
{
CurrentWeaponShotgunBullet = class<ShotgunBullet>(DynamicLoadObject(string(CurrentWeaponShotgunAltFire.default.ProjectileClass), class'Class'));
AltFireDamage = CurrentWeaponShotgunBullet.default.Damage;
}
else if (class<LAWProj>(DynamicLoadObject(string(CurrentWeaponShotgunAltFire.default.ProjectileClass), class'Class')) != none)
{
CurrentWeaponLAWProj = class<LAWProj>(DynamicLoadObject(string(CurrentWeaponShotgunAltFire.default.ProjectileClass), class'Class'));
AltFireDamage = CurrentWeaponLAWProj.default.Damage;
}
}
return AltFireDamage;
}


static function MutLog(string s)
{
Expand Down
Loading

0 comments on commit 5c84a74

Please sign in to comment.