Skip to content

Commit

Permalink
added aug effect charge scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
ChronoVortex committed Apr 21, 2023
1 parent df7a33f commit b914149
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions data/vertex_module/tags/augEffects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ local function parser(node)
else
augEffect.needsPower = parse_xml_bool(augEffectNode:first_attribute("needsPower"):value())
end
if not augEffectNode:first_attribute("chargeScaling") then
augEffect.chargeScaling = false -- augEffects do not scale by weapon charges by default
else
augEffect.chargeScaling = parse_xml_bool(augEffectNode:first_attribute("chargeScaling"):value())
end
if not augEffectNode:first_attribute("nostack") then
augEffect.nostack = false -- augEffects stack by default
else
Expand All @@ -62,10 +67,14 @@ local function logic()
for equipment in vter(system) do
for _, augEffect in ipairs(equipmentInfo[equipment.blueprint.name]["augEffects"]) do
if augEffect.effect == augName and (not augEffect.needsPower or equipment.powered) then
local effectAmount = augEffect.amount
if augEffect.chargeScaling and equipment.blueprint:GetType() == 0 then
effectAmount = effectAmount*(equipment.chargeLevel/math.max(equipment.weaponVisual.iChargeLevels, 1))
end
if augEffect.nostack then
table.insert(possibleValues, augEffect.amount)
table.insert(possibleValues, effectAmount)
else
augBonusValue = augBonusValue + augEffect.amount
augBonusValue = augBonusValue + effectAmount
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion mod-appendix/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<title><![CDATA[ Vertex Tags and Utility Functions ]]></title>
<threadUrl><![CDATA[ https://github.com/ChronoVortex/FTL-HS-Vertex ]]></threadUrl>
<author><![CDATA[ Vertaalfout, Chrono Vortex ]]></author>
<version><![CDATA[ 2.0 ]]></version>
<version><![CDATA[ 2.1 ]]></version>
<description>
<![CDATA[
This mod has no content, instead adding new tags and LUA utility functions for other mods to build off of.
Expand Down

0 comments on commit b914149

Please sign in to comment.