Trader, MedicPistol and Perk fixes

MedicPistol has no weight in upgrades now
Fixed weight and damage for upgrades in trader
Fixed initial secondary ammo for weapons in trader
Fixed secondary ammo icon in trader
Fixed error when perk hasn't HeadDamage stat
This commit is contained in:
inklesspen1scripter 2020-07-07 00:12:25 +03:00
parent 35e0160071
commit 23bda71718
4 changed files with 43 additions and 5 deletions

View File

@ -257,6 +257,7 @@ simulated static final function KFGFxObject_TraderItems CreateNewList()
simulated static final function SetWeaponInfo( bool bDedicated, int Index, FCustomTraderItem Item, KFGFxObject_TraderItems List ) simulated static final function SetWeaponInfo( bool bDedicated, int Index, FCustomTraderItem Item, KFGFxObject_TraderItems List )
{ {
local array<STraderItemWeaponStats> S; local array<STraderItemWeaponStats> S;
local int i;
if( List.SaleItems.Length<=Index ) if( List.SaleItems.Length<=Index )
List.SaleItems.Length = Index+1; List.SaleItems.Length = Index+1;
@ -268,16 +269,24 @@ simulated static final function SetWeaponInfo( bool bDedicated, int Index, FCust
else List.SaleItems[Index].SingleClassName = ''; else List.SaleItems[Index].SingleClassName = '';
List.SaleItems[Index].DualClassName = Item.WeaponClass.Default.DualClass!=None ? Item.WeaponClass.Default.DualClass.Name : ''; List.SaleItems[Index].DualClassName = Item.WeaponClass.Default.DualClass!=None ? Item.WeaponClass.Default.DualClass.Name : '';
List.SaleItems[Index].AssociatedPerkClasses = Item.WeaponClass.Static.GetAssociatedPerkClasses(); List.SaleItems[Index].AssociatedPerkClasses = Item.WeaponClass.Static.GetAssociatedPerkClasses();
List.SaleItems[Index].MaxSpareAmmo = Item.WeaponClass.Default.SpareAmmoCapacity[0];
List.SaleItems[Index].MagazineCapacity = Item.WeaponClass.Default.MagazineCapacity[0]; List.SaleItems[Index].MagazineCapacity = Item.WeaponClass.Default.MagazineCapacity[0];
List.SaleItems[Index].InitialSpareMags = Item.WeaponClass.Default.InitialSpareMags[0]; List.SaleItems[Index].InitialSpareMags = Item.WeaponClass.Default.InitialSpareMags[0];
List.SaleItems[Index].MaxSpareAmmo = Item.WeaponClass.Default.SpareAmmoCapacity[0];
List.SaleItems[Index].MaxSecondaryAmmo = Item.WeaponClass.Default.MagazineCapacity[1] * Item.WeaponClass.Default.SpareAmmoCapacity[1]; List.SaleItems[Index].MaxSecondaryAmmo = Item.WeaponClass.Default.MagazineCapacity[1] * Item.WeaponClass.Default.SpareAmmoCapacity[1];
List.SaleItems[Index].BlocksRequired = Item.WeaponClass.Default.InventorySize; List.SaleItems[Index].BlocksRequired = Item.WeaponClass.Default.InventorySize;
List.SaleItems[Index].ItemID = Index; List.SaleItems[Index].ItemID = Index;
List.SaleItems[Index].InitialSecondaryAmmo = Item.WeaponClass.Default.InitialSpareMags[1];
List.SaleItems[Index].WeaponUpgradeDmgMultiplier[0] = 1.0;
for(i = 0;i<Min(Item.WeaponClass.Default.WeaponUpgrades.Length, 5);i++)
{
List.SaleItems[Index].WeaponUpgradeWeight[i+1] = Item.WeaponClass.Static.GetUpgradeStatAdd(EWUS_Weight, i+1);
List.SaleItems[Index].WeaponUpgradeDmgMultiplier[i+1] = Item.WeaponClass.Static.GetUpgradeStatScale(EWUS_Damage0, i+1);
}
if( !bDedicated ) if( !bDedicated )
{ {
List.SaleItems[Index].SecondaryAmmoImagePath = Item.WeaponClass.Default.SecondaryAmmoTexture!=None ? "img://"$PathName(Item.WeaponClass.Default.SecondaryAmmoTexture) : ""; List.SaleItems[Index].SecondaryAmmoImagePath = Item.WeaponClass.Default.SecondaryAmmoTexture!=None ? PathName(Item.WeaponClass.Default.SecondaryAmmoTexture) : "UI_SecondaryAmmo_TEX.GasTank";
List.SaleItems[Index].TraderFilter = Item.WeaponClass.Static.GetTraderFilter(); List.SaleItems[Index].TraderFilter = Item.WeaponClass.Static.GetTraderFilter();
List.SaleItems[Index].InventoryGroup = Item.WeaponClass.Default.InventoryGroup; List.SaleItems[Index].InventoryGroup = Item.WeaponClass.Default.InventoryGroup;
List.SaleItems[Index].GroupPriority = Item.WeaponClass.Default.GroupPriority; List.SaleItems[Index].GroupPriority = Item.WeaponClass.Default.GroupPriority;
@ -296,9 +305,13 @@ simulated function RecheckGRI()
{ {
KFGameReplicationInfo(WorldInfo.GRI).TraderItems = CustomList; KFGameReplicationInfo(WorldInfo.GRI).TraderItems = CustomList;
foreach LocalPlayerControllers(class'ExtPlayerController',PC) foreach LocalPlayerControllers(class'ExtPlayerController',PC)
{
if( PC.PurchaseHelper!=None ) if( PC.PurchaseHelper!=None )
{
PC.PurchaseHelper.TraderItems = CustomList; PC.PurchaseHelper.TraderItems = CustomList;
} }
}
}
} }
simulated final function bool ShowAdminName() simulated final function bool ShowAdminName()

View File

@ -12,6 +12,11 @@ defaultproperties
InventorySize=0 InventorySize=0
InstantHitDamageTypes(DEFAULT_FIREMODE)=class'ExtDT_Ballistic_Pistol_Medic' InstantHitDamageTypes(DEFAULT_FIREMODE)=class'ExtDT_Ballistic_Pistol_Medic'
WeaponUpgrades[1]=(Stats=((Stat=EWUS_Damage0, Scale=1.7f), (Stat=EWUS_HealFullRecharge, Scale=0.9f)))
WeaponUpgrades[2]=(Stats=((Stat=EWUS_Damage0, Scale=2.0f), (Stat=EWUS_HealFullRecharge, Scale=0.8f)))
WeaponUpgrades[3]=(Stats=((Stat=EWUS_Damage0, Scale=2.55f), (Stat=EWUS_HealFullRecharge, Scale=0.7f)))
WeaponUpgrades[4]=(Stats=((Stat=EWUS_Damage0, Scale=3.0f), (Stat=EWUS_HealFullRecharge, Scale=0.6f)))
} }
simulated static function bool AllowedForAllPerks() simulated static function bool AllowedForAllPerks()

View File

@ -34,7 +34,8 @@ var config int FirstLevelExp, // How much EXP needed for first level.
StarPointsPerLevel, StarPointsPerLevel,
MinLevelForPrestige, // Minimum level required for perk prestige. MinLevelForPrestige, // Minimum level required for perk prestige.
PrestigeSPIncrease, // Starpoint increase per prestige levelup. PrestigeSPIncrease, // Starpoint increase per prestige levelup.
MaxPrestige; // Maximum prestige level. MaxPrestige,
MinimalDataLevel; // Maximum prestige level.
var config float PrestigeXPReduce; // Amount of XP cost is reduced for each prestige. var config float PrestigeXPReduce; // Amount of XP cost is reduced for each prestige.
var config array<string> TraitClasses; var config array<string> TraitClasses;
@ -405,6 +406,12 @@ function LoadData( ExtSaveDataBase Data )
local string S; local string S;
CurrentEXP = Data.ReadInt(3); CurrentEXP = Data.ReadInt(3);
// if(MinimalDataLevel > 0)
// {
// i = GetNeededExp(MinimalDataLevel-1)
// if(i > CurrentEXP)
// CurrentEXP = i
// }
if( Data.GetArVer()>=1 ) if( Data.GetArVer()>=1 )
CurrentPrestige = Data.ReadInt(3); CurrentPrestige = Data.ReadInt(3);
@ -465,6 +472,13 @@ function SetInitialLevel()
local int i,a,b; local int i,a,b;
local byte MT,j; local byte MT,j;
if(MinimalDataLevel > 0)
{
i = GetNeededExp(MinimalDataLevel-1);
if(i > CurrentEXP)
CurrentEXP = i;
}
// Set to initial level player is on after configures has loaded. // Set to initial level player is on after configures has loaded.
CurrentLevel = CalcLevelForExp(CurrentEXP); CurrentLevel = CalcLevelForExp(CurrentEXP);
CurrentSP = CurrentLevel*(StarPointsPerLevel+CurrentPrestige*PrestigeSPIncrease); CurrentSP = CurrentLevel*(StarPointsPerLevel+CurrentPrestige*PrestigeSPIncrease);
@ -605,6 +619,7 @@ static function UpdateConfigs( int OldVer )
Default.MinLevelForPrestige = 140; Default.MinLevelForPrestige = 140;
Default.PrestigeSPIncrease = 1; Default.PrestigeSPIncrease = 1;
Default.MaxPrestige = 20; Default.MaxPrestige = 20;
Default.MinimalDataLevel = 0;
Default.PrestigeXPReduce = 0.05; Default.PrestigeXPReduce = 0.05;
Default.PerkStats.Length = 0; Default.PerkStats.Length = 0;
@ -707,6 +722,8 @@ static function string GetValue( name PropName, int ElementIndex )
return string(Default.MinLevelForPrestige); return string(Default.MinLevelForPrestige);
case 'PrestigeSPIncrease': case 'PrestigeSPIncrease':
return string(Default.PrestigeSPIncrease); return string(Default.PrestigeSPIncrease);
case 'MinimalDataLevel':
return string(Default.MinimalDataLevel);
case 'MaxPrestige': case 'MaxPrestige':
return string(Default.MaxPrestige); return string(Default.MaxPrestige);
case 'PrestigeXPReduce': case 'PrestigeXPReduce':
@ -721,6 +738,8 @@ static function ApplyValue( name PropName, int ElementIndex, string Value )
Default.FirstLevelExp = int(Value); break; Default.FirstLevelExp = int(Value); break;
case 'LevelUpExpCost': case 'LevelUpExpCost':
Default.LevelUpExpCost = int(Value); break; Default.LevelUpExpCost = int(Value); break;
case 'MinimalDataLevel':
Default.MinimalDataLevel = int(Value); break;
case 'LevelUpIncCost': case 'LevelUpIncCost':
Default.LevelUpIncCost = int(Value); break; Default.LevelUpIncCost = int(Value); break;
case 'MinimumLevel': case 'MinimumLevel':
@ -1418,6 +1437,7 @@ defaultproperties
WebConfigs.Add((PropType=0,PropName="PrestigeSPIncrease",UIName="Prestige SP Increase",UIDesc="Star points increase per level for every prestige")) WebConfigs.Add((PropType=0,PropName="PrestigeSPIncrease",UIName="Prestige SP Increase",UIDesc="Star points increase per level for every prestige"))
WebConfigs.Add((PropType=0,PropName="MaxPrestige",UIName="Max Prestige",UIDesc="Maximum prestige level")) WebConfigs.Add((PropType=0,PropName="MaxPrestige",UIName="Max Prestige",UIDesc="Maximum prestige level"))
WebConfigs.Add((PropType=0,PropName="PrestigeXPReduce",UIName="Prestige XP Reduce",UIDesc="Percent amount of XP cost is reduced for each prestige (1.0 = 1/2, or 50 % of XP)")) WebConfigs.Add((PropType=0,PropName="PrestigeXPReduce",UIName="Prestige XP Reduce",UIDesc="Percent amount of XP cost is reduced for each prestige (1.0 = 1/2, or 50 % of XP)"))
// WebConfigs.Add((PropType=0,PropName="MinimalDataLevel",UIName="Minimal Real Level",UIDesc="Minimal level for new players or who loads from saves"))
DefPerkStats(0)=(MaxValue=50,CostPerValue=1,StatType="Speed",UIName="Movement Speed (+&%)",Progress=0.4) DefPerkStats(0)=(MaxValue=50,CostPerValue=1,StatType="Speed",UIName="Movement Speed (+&%)",Progress=0.4)
DefPerkStats(1)=(MaxValue=1000,CostPerValue=1,StatType="Damage",UIName="Perk Damage (+&%)",Progress=0.5) DefPerkStats(1)=(MaxValue=1000,CostPerValue=1,StatType="Damage",UIName="Perk Damage (+&%)",Progress=0.5)
@ -1459,6 +1479,7 @@ defaultproperties
Modifiers.Add(1.f) Modifiers.Add(1.f)
Modifiers.Add(1.f) Modifiers.Add(1.f)
Modifiers.Add(1.f) Modifiers.Add(1.f)
Modifiers.Add(0.f)
EnemyDistDraw.Add(500) EnemyDistDraw.Add(500)
EnemyDistDraw.Add(700) EnemyDistDraw.Add(700)

View File

@ -273,7 +273,6 @@ function EditTraiderItems()
// local STraderItem SI; // local STraderItem SI;
// var config bool bDLCWeaponsForFree; // var config bool bDLCWeaponsForFree;
// var config bool bDontUseOriginalWeaponry; // var config bool bDontUseOriginalWeaponry;
if(!bDontUseOriginalWeaponry) if(!bDontUseOriginalWeaponry)
{ {
Trad = KFGameReplicationInfo(WorldInfo.GRI).TraderItems; Trad = KFGameReplicationInfo(WorldInfo.GRI).TraderItems;