Skip to content

Commit

Permalink
Update GGPK Spec (#2986)
Browse files Browse the repository at this point in the history
* Update Mods.dat

* Adding ArmourTypes.dat

* Adding Ward bases and displays

* style: drop parenthesis

* Fixing mod export

* Fix minion export script

Co-authored-by: Peter Pölzl <33464174+ppoelzl@users.noreply.github.com>
Co-authored-by: LocalIdentity <localidentity2@gmail.com>
  • Loading branch information
3 people authored Jul 24, 2021
1 parent 1bf5d4f commit 533a4a6
Show file tree
Hide file tree
Showing 8 changed files with 263 additions and 98 deletions.
3 changes: 3 additions & 0 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,13 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
local evasionEnergyShieldBase = sumLocal(modList, "EvasionAndEnergyShield", "BASE", 0)
local energyShieldBase = sumLocal(modList, "EnergyShield", "BASE", 0) + (self.base.armour.EnergyShieldBase or 0)
local armourEnergyShieldBase = sumLocal(modList, "ArmourAndEnergyShield", "BASE", 0)
local wardBase = sumLocal(modList, "Ward", "BASE", 0) + (self.base.armour.WardBase or 0)
local armourInc = sumLocal(modList, "Armour", "INC", 0)
local armourEvasionInc = sumLocal(modList, "ArmourAndEvasion", "INC", 0)
local evasionInc = sumLocal(modList, "Evasion", "INC", 0)
local evasionEnergyShieldInc = sumLocal(modList, "EvasionAndEnergyShield", "INC", 0)
local energyShieldInc = sumLocal(modList, "EnergyShield", "INC", 0)
local wardInc = sumLocal(modList, "Ward", "INC", 0)
local armourEnergyShieldInc = sumLocal(modList, "ArmourAndEnergyShield", "INC", 0)
local defencesInc = sumLocal(modList, "Defences", "INC", 0)
local qualityScalar = self.quality
Expand All @@ -981,6 +983,7 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
armourData.Armour = round((armourBase + armourEvasionBase + armourEnergyShieldBase) * (1 + (armourInc + armourEvasionInc + armourEnergyShieldInc + defencesInc + qualityScalar) / 100))
armourData.Evasion = round((evasionBase + armourEvasionBase + evasionEnergyShieldBase) * (1 + (evasionInc + armourEvasionInc + evasionEnergyShieldInc + defencesInc + qualityScalar) / 100))
armourData.EnergyShield = round((energyShieldBase + evasionEnergyShieldBase + armourEnergyShieldBase) * (1 + (energyShieldInc + armourEnergyShieldInc + evasionEnergyShieldInc + defencesInc + qualityScalar) / 100))
armourData.Ward = round(wardBase * (1 + (wardInc + defencesInc + qualityScalar) / 100))
if self.base.armour.BlockChance then
armourData.BlockChance = self.base.armour.BlockChance + sumLocal(modList, "BlockChance", "BASE", 0)
end
Expand Down
3 changes: 3 additions & 0 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,9 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
if armourData.EnergyShield > 0 then
tooltip:AddLine(16, s_format("^x7F7F7FEnergy Shield: %s%d", main:StatColor(armourData.EnergyShield, base.armour.EnergyShieldBase), armourData.EnergyShield))
end
if armourData.Ward > 0 then
tooltip:AddLine(16, s_format("^x7F7F7FWard: %s%d", main:StatColor(armourData.Ward, base.armour.WardBase), armourData.Ward))
end
elseif base.flask then
-- Flask-specific info
local flaskData = item.flaskData
Expand Down
3 changes: 3 additions & 0 deletions src/Export/Bases/boots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ local itemBases = ...
#base Metadata/Items/Armours/Boots/BootsAtlas1 Two-Toned Boots (Evasion/Energy Shield)
#forceShow false

#subType Ward
#baseMatch Metadata/Items/Armours/Boots/BootsExpedition%d+

#subType
#base Metadata/Items/Armours/Boots/BootsDemigods1
3 changes: 3 additions & 0 deletions src/Export/Bases/gloves.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ local itemBases = ...
#subType Evasion/Energy Shield
#baseMatch Metadata/Items/Armours/Gloves/GlovesDexInt%d+

#subType Ward
#baseMatch Metadata/Items/Armours/Gloves/GlovesExpedition%d+

#subType
#base Metadata/Items/Armours/Gloves/GlovesDemigods1
3 changes: 3 additions & 0 deletions src/Export/Bases/helmet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ local itemBases = ...
#baseMatch Metadata/Items/Armours/Helmets/HelmetDexInt%d+
#baseMatch Metadata/Items/Armours/Helmets/HelmetDexIntRitual%d+

#subType Ward
#baseMatch Metadata/Items/Armours/Helmets/HelmetExpedition%d+

#subType
#base Metadata/Items/Armours/Helmets/HelmetWreath1
2 changes: 1 addition & 1 deletion src/Export/Classes/GGPKData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ function GGPKClass:GetNeededFiles()
"Data/Stats.dat",
"Data/BaseItemTypes.dat",
"Data/WeaponTypes.dat",
"Data/ArmourTypes.dat",
"Data/ShieldTypes.dat",
"Data/ComponentArmour.dat",
"Data/Flasks.dat",
"Data/ComponentCharges.dat",
"Data/ComponentAttributeRequirements.dat",
Expand Down
25 changes: 14 additions & 11 deletions src/Export/Scripts/bases.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,27 @@ directiveTable.base = function(state, args, out)
out:write('Range = ', weaponType.Range, ', ')
out:write('},\n')
end
local compArmour = dat("ComponentArmour"):GetRow("BaseItemType", baseItemType.Id)
if compArmour then
local armourType = dat("ArmourTypes"):GetRow("BaseItemType", baseItemType)
if armourType then
out:write('\tarmour = { ')
local shield = dat("ShieldTypes"):GetRow("BaseItemType", baseItemType)
if shield then
out:write('BlockChance = ', shield.Block, ', ')
end
if compArmour.Armour > 0 then
out:write('ArmourBase = ', compArmour.Armour, ', ')
if armourType.Armour > 0 then
out:write('ArmourBase = ', armourType.Armour, ', ')
end
if compArmour.Evasion > 0 then
out:write('EvasionBase = ', compArmour.Evasion, ', ')
if armourType.Evasion > 0 then
out:write('EvasionBase = ', armourType.Evasion, ', ')
end
if compArmour.EnergyShield > 0 then
out:write('EnergyShieldBase = ', compArmour.EnergyShield, ', ')
if armourType.EnergyShield > 0 then
out:write('EnergyShieldBase = ', armourType.EnergyShield, ', ')
end
if compArmour.MovementPenalty ~= 0 then
out:write('MovementPenalty = ', -compArmour.MovementPenalty, ', ')
if armourType.MovementPenalty ~= 0 then
out:write('MovementPenalty = ', -armourType.MovementPenalty, ', ')
end
if armourType.Ward ~= 0 then
out:write('WardBase = ', armourType.Ward, ', ')
end
out:write('},\n')
end
Expand Down Expand Up @@ -169,7 +172,7 @@ directiveTable.base = function(state, args, out)
end
out:write('\treq = { ')
local reqLevel = 1
if weaponType or compArmour then
if weaponType or armourType then
if baseItemType.DropLevel > 4 then
reqLevel = baseItemType.DropLevel
end
Expand Down
Loading

0 comments on commit 533a4a6

Please sign in to comment.