From 1b5982fbe755a6e8fc20da1c7413a74bd71d99c5 Mon Sep 17 00:00:00 2001 From: Kherae Date: Wed, 22 Apr 2020 14:53:47 -0700 Subject: [PATCH 01/10] crit fix --- .../scripted/statWindow/extraStatsWindow.config | 6 +++--- interface/scripted/statWindow/extraStatsWindow.lua | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/interface/scripted/statWindow/extraStatsWindow.config b/interface/scripted/statWindow/extraStatsWindow.config index 0d4e0e1b..c67888a4 100644 --- a/interface/scripted/statWindow/extraStatsWindow.config +++ b/interface/scripted/statWindow/extraStatsWindow.config @@ -96,7 +96,7 @@ "value" : "---" }, - "critBonus" : { + "critDamage" : { "type" : "label", "position" : [70, 61], "hAnchor" : "mid", @@ -184,7 +184,7 @@ "breathDepletionRate" : "breath", // "breathRegenerationRate" : "ignore", // Ignore because special calculations are applied "critChance" : "crit", - "critBonus" : "crit", + "critDamage" : "critmult", // "encumberance" : "flat", "energyRegenBlockTime" : "flat", "energyRegenPercentageRate" : "percent", // % of max per second regained @@ -231,7 +231,7 @@ {"x1": 45, "y1": 88, "x2": 85, "y2": 100, "tooltip": "Health Regen"}, {"x1": 45, "y1": 74, "x2": 85, "y2": 86, "tooltip": "Energy Regen"}, - {"x1": 45, "y1": 60, "x2": 85, "y2": 72, "tooltip": "Bonus Crit Dmg"}, + {"x1": 45, "y1": 60, "x2": 85, "y2": 72, "tooltip": "Crit Dmg Multiplier"}, {"x1": 45, "y1": 46, "x2": 85, "y2": 58, "tooltip": "Breath Regen Time"}, {"x1": 45, "y1": 32, "x2": 85, "y2": 44, "tooltip": "Knockback Threshold"}, {"x1": 45, "y1": 18, "x2": 85, "y2": 30, "tooltip": "Shield Bash Push"}, diff --git a/interface/scripted/statWindow/extraStatsWindow.lua b/interface/scripted/statWindow/extraStatsWindow.lua index 6a9e2138..14873e2b 100644 --- a/interface/scripted/statWindow/extraStatsWindow.lua +++ b/interface/scripted/statWindow/extraStatsWindow.lua @@ -28,11 +28,15 @@ function update() widget.setText(stat, value) elseif type == "percent" then - value = tostring(avarage(value * 100)).."%" + value = tostring(average(value * 100)).."%" widget.setText(stat, value) elseif type == "crit" then - value = "+"..tostring(avarage(value)).."%" + value = "+"..tostring(average(value)).."%" + widget.setText(stat, value) + + elseif type == "critmult" then + value = tostring(average((1.5+value)*100)).."%" widget.setText(stat, value) elseif type == "food" then @@ -86,7 +90,7 @@ function update() end -function avarage(num) +function average(num) local low = math.floor(num) local high = math.ceil(num) @@ -109,7 +113,7 @@ function shorten(val) if type(val) == "number" then if val > 9999 then -- if its a 5 digit number, just let it overflow out of the box. Can't be reached naturaly, and cheaters can go fuck themselves - return avarage(val) + return average(val) else local str = tostring(val) local dotPoint = string.find(str, "%.", 1) From 7716605d091539853ba5076c923f6743fccad8bd Mon Sep 17 00:00:00 2001 From: Kherae Date: Wed, 22 Apr 2020 15:12:55 -0700 Subject: [PATCH 02/10] Update extraStatsWindow.lua --- .../scripted/statWindow/extraStatsWindow.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/interface/scripted/statWindow/extraStatsWindow.lua b/interface/scripted/statWindow/extraStatsWindow.lua index 14873e2b..8aac3fe7 100644 --- a/interface/scripted/statWindow/extraStatsWindow.lua +++ b/interface/scripted/statWindow/extraStatsWindow.lua @@ -40,13 +40,23 @@ function update() widget.setText(stat, value) elseif type == "food" then - --value = tostring(math.abs(shorten(1 / (value / status.stat("maxFood")) * 0.01))) - value = tostring(math.abs(shorten((value / status.stat("maxFood")) * 0.01))) - widget.setText(stat, value) + local foodVal=status.isResource("food") and status.resourceMax("food") or 0 + if foodVal~=0 then + value = tostring(math.abs(shorten(1 / (value / status.resourceMax("food")) * 0.01))) + if value % 1 == 0 then + widget.setText(stat, math.floor(value)) + else + widget.setText(stat, value) + end + else + widget.setText(stat, "0") + end + elseif type == "breath" then breathRate = value if breathMax > 0 then -- Why divided by 2 you ask? Fuck if I know, it returns double the right value otherwise. + --khe: that's because breath timer is decremented twice per update. widget.setText("breathMaxTime", breathMax / breathRate / 2) widget.setText("breathRegenTime", breathMax / breatRegen / 2) end From d5e3ab01f3c6d979c5646689337f39b9522f358b Mon Sep 17 00:00:00 2001 From: Kherae Date: Wed, 22 Apr 2020 16:59:49 -0700 Subject: [PATCH 03/10] disable annoying visuals --- items/active/weapons/crits.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/items/active/weapons/crits.lua b/items/active/weapons/crits.lua index 18802f79..a429df3a 100644 --- a/items/active/weapons/crits.lua +++ b/items/active/weapons/crits.lua @@ -27,7 +27,9 @@ function Crits:setCritDamage(damage) damage = damage + math.random(10) + 2 -- 1d10 + 2 bonus damage end - status.addEphemeralEffect("crithit", 0.3, activeItem.ownerEntityId()) + + --disabled because eyesore + --status.addEphemeralEffect("crithit", 0.3, activeItem.ownerEntityId()) -- ***************************************************************** -- weapon specific crit abilities! -- ***************************************************************** From 8ae958ac8a8e76903baab31e7b1ae96385783c5f Mon Sep 17 00:00:00 2001 From: Kherae Date: Wed, 22 Apr 2020 17:08:12 -0700 Subject: [PATCH 04/10] cleaner --- .../fu_weaponeffects/crithit/critReady.lua | 20 +++++++++---------- .../crithit/critReady.statuseffect | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/stats/effects/fu_weaponeffects/crithit/critReady.lua b/stats/effects/fu_weaponeffects/crithit/critReady.lua index 2d03c62f..f1d4605b 100644 --- a/stats/effects/fu_weaponeffects/crithit/critReady.lua +++ b/stats/effects/fu_weaponeffects/crithit/critReady.lua @@ -1,17 +1,17 @@ function init() - self.used = 0 - if (status.stat("isCharged") == 1) and (self.used == 0) then - self.used = 1 - activateVisualEffects() - end + activateVisualEffects() end function activateVisualEffects() - local statusTextRegion = { 0, 1, 0, 1 } - animator.setParticleEmitterOffsetRegion("critText", statusTextRegion) - animator.burstParticleEmitter("critText") - animator.playSound("burn") - effect.setParentDirectives("fade=008800=0.2") + if not (world.isMonster(entity.id()) or world.isNpc(entity.id())) then + if (status.stat("isCharged") == 1) then + local statusTextRegion = { 0, 1, 0, 1 } + animator.setParticleEmitterOffsetRegion("critText", statusTextRegion) + animator.burstParticleEmitter("critText") + animator.playSound("burn") + --effect.setParentDirectives("fade=008800=0.2") + end + end end diff --git a/stats/effects/fu_weaponeffects/crithit/critReady.statuseffect b/stats/effects/fu_weaponeffects/crithit/critReady.statuseffect index 4ce5e896..4784fcf8 100644 --- a/stats/effects/fu_weaponeffects/crithit/critReady.statuseffect +++ b/stats/effects/fu_weaponeffects/crithit/critReady.statuseffect @@ -8,6 +8,7 @@ "scripts" : [ "critReady.lua" ], - + "label":"Marksman's Focus - Sniper Crit Bonus Maxed", + "icon" : "/interface/statuses/attack.png", "animationConfig" : "critReady.animation" } From 81938ee20cd1a35f025abf6fd897e75e1e8f0043 Mon Sep 17 00:00:00 2001 From: Kherae Date: Thu, 23 Apr 2020 17:41:47 -0700 Subject: [PATCH 05/10] generic stat scripts begin --- stats/effects/fu_genericStatApplier.lua | 12 ++++ stats/effects/fu_genericStatusApplier.lua | 67 +++++++++++++++++++ stats/effects/fu_genericUnendingEffect.lua | 16 +++++ stats/effects/swimboost/swimboost1.lua | 8 +-- .../effects/swimboost/swimboost1.statuseffect | 12 ++-- .../effects/swimboost/swimboost2.statuseffect | 14 ++-- .../effects/swimboost/swimboost3.statuseffect | 12 ++-- .../effects/swimboost/swimboost4.statuseffect | 14 ++-- 8 files changed, 129 insertions(+), 26 deletions(-) create mode 100644 stats/effects/fu_genericStatApplier.lua create mode 100644 stats/effects/fu_genericStatusApplier.lua create mode 100644 stats/effects/fu_genericUnendingEffect.lua diff --git a/stats/effects/fu_genericStatApplier.lua b/stats/effects/fu_genericStatApplier.lua new file mode 100644 index 00000000..6491b2a7 --- /dev/null +++ b/stats/effects/fu_genericStatApplier.lua @@ -0,0 +1,12 @@ +local oldInitStatApplier=init +local oldUninitStatApplier=uninit + +function init() + handler=effect.addStatModifierGroup(config.getParameter("stats",{})) + if oldInitStatApplier then oldInitStatApplier() end +end + +function uninit() + effect.removeStatModifierGroup(handler) + if oldUninitStatApplier then oldUninitStatApplier() end +end \ No newline at end of file diff --git a/stats/effects/fu_genericStatusApplier.lua b/stats/effects/fu_genericStatusApplier.lua new file mode 100644 index 00000000..89847dbb --- /dev/null +++ b/stats/effects/fu_genericStatusApplier.lua @@ -0,0 +1,67 @@ +require "/scripts/effectUtil.lua" + +local oldInitStatusApplier=init +local oldUninitStatusApplier=uninit +local oldUpdateStatusApplier=update + +--[[sample table, pretend it is a 7 second duration effect. this is a doom poison with microstuns every second and ends with a 3 second stun. +{ + "statusApplierValues": + { + "init":[ + ["weakpoison",7] + ["l6doomed",7] + ], + --update rate is in seconds + "updateRate":1 + --update has no effect unless updateRate is set + "update":[ + ["fuparalysis",0.1] + ], + --careful with uninit, it can be iffy, as dying entities can unload before it is fully called. + "uninit":[ + ["fuparalysis",3] + ] + } +]] + +function init() + statusApplierValues=config.getParameter("statusApplierValues",{}) + if oldInitStatusApplier then oldInitStatusApplier() end + if statusApplierValues.init then + for _,effect in pairs(statusApplierValues.init) do + effectUtil.effectSelf(effect[1],effect[2]) + end + end +end + +function update(dt) + if statusApplierValues.update then + if statusApplierValues.updateRate then + if not statusApplierValues.updateTimer then + statusApplierValues.updateTimer=statusApplierValues.updateRate + else + if statusApplierValues.updateTimer > 0 then + statusApplierValues.updateTimer=statusApplierValues.updateTimer-dt + else + for _,effect in pairs(statusApplierValues.update) do + effectUtil.effectSelf(effect[1],effect[2]) + end + statusApplierValues.updateTimer=statusApplierValues.updateRate + end + end + end + end + if oldUpdateStatusApplier then + oldUpdateStatusApplier(dt) + end +end + +function uninit() + if statusApplierValues.uninit then + for _,effect in pairs(statusApplierValues.uninit) do + effectUtil.effectSelf(effect[1],effect[2]) + end + end + if oldUninitStatusApplier then oldUninitStatusApplier() end +end \ No newline at end of file diff --git a/stats/effects/fu_genericUnendingEffect.lua b/stats/effects/fu_genericUnendingEffect.lua new file mode 100644 index 00000000..b38e6b30 --- /dev/null +++ b/stats/effects/fu_genericUnendingEffect.lua @@ -0,0 +1,16 @@ +local oldInitUnendingEffect=init +local oldUninitUnendingEffect=uninit +local oldUpdateUnendingEffect=update + +function init() + if oldInitUnendingEffect then oldInitUnendingEffect() end +end + +function update(dt) + effect.modifyDuration(dt) + oldUpdateUnendingEffect(dt) +end + +function uninit() + if oldUninitUnendingEffect then oldUninitUnendingEffect() end +end \ No newline at end of file diff --git a/stats/effects/swimboost/swimboost1.lua b/stats/effects/swimboost/swimboost1.lua index e332ae18..5cc5ce7b 100644 --- a/stats/effects/swimboost/swimboost1.lua +++ b/stats/effects/swimboost/swimboost1.lua @@ -1,10 +1,10 @@ function init() - effect.addStatModifierGroup({{stat = "boostAmount", amount = 1}}) -- make sure to reset the value to 1 each time it inits so values never stack + sb.logInfo("status.stat(boostAmount):%s",status.stat("boostAmount")) + --[[effect.addStatModifierGroup({{stat = "boostAmount", amount = 1}}) -- make sure to reset the value to 1 each time it inits so values never stack self.mouthPosition = status.statusProperty("mouthPosition") or {0,0} - self.mouthBounds = {self.mouthPosition[1], self.mouthPosition[2], self.mouthPosition[1], self.mouthPosition[2]} + --self.mouthBounds = {self.mouthPosition[1], self.mouthPosition[2], self.mouthPosition[1], self.mouthPosition[2]} self.boostAmount = config.getParameter("boostAmount", 1) - effect.addStatModifierGroup({{stat = "boostAmount", effectiveMultiplier = self.boostAmount}}) -- add the swim boost stat - --sb.logInfo("ive applied swimboost of x"..status.stat("boostAmount")) + effect.addStatModifierGroup({{stat = "boostAmount", effectiveMultiplier = self.boostAmount}}) -- add the swim boost stat]] end function update(dt) diff --git a/stats/effects/swimboost/swimboost1.statuseffect b/stats/effects/swimboost/swimboost1.statuseffect index c645ac60..7ef64c6a 100644 --- a/stats/effects/swimboost/swimboost1.statuseffect +++ b/stats/effects/swimboost/swimboost1.statuseffect @@ -1,13 +1,15 @@ { "name" : "swimboost1", - "effectConfig" : { - "boostAmount" : 1.2, - "riseAmount" : 1.2 - }, + "effectConfig": { + "stats": [ + {"stat": "boostAmount","effectiveMultiplier": 1.2}, + {"stat": "riseAmount","effectiveMultiplier": 1.2} + ] + }, "defaultDuration" : 220, "scripts" : [ - "swimboost1.lua" + "/stats/effects/fu_genericStatApplier.lua" ], "animationConfig" : "swimboost1.animation", "label" : "Swim 1", diff --git a/stats/effects/swimboost/swimboost2.statuseffect b/stats/effects/swimboost/swimboost2.statuseffect index 8fcf65e7..a2761ace 100644 --- a/stats/effects/swimboost/swimboost2.statuseffect +++ b/stats/effects/swimboost/swimboost2.statuseffect @@ -1,15 +1,17 @@ { "name" : "swimboost2", - "effectConfig" : { - "boostAmount" : 1.4, - "riseAmount" : 1.4 - }, + "effectConfig": { + "stats": [ + {"stat": "boostAmount","effectiveMultiplier": 1.4}, + {"stat": "riseAmount","effectiveMultiplier": 1.4} + ] + }, "defaultDuration" : 220, "scripts" : [ - "swimboost1.lua" + "/stats/effects/fu_genericStatApplier.lua" ], - "animationConfig" : "swimboost1.animation", + "animationConfig" : "swimboost2.animation", "label" : "Swim 2", "icon" : "/interface/statuses/swimboost.png" } diff --git a/stats/effects/swimboost/swimboost3.statuseffect b/stats/effects/swimboost/swimboost3.statuseffect index a61a33fa..4881a013 100644 --- a/stats/effects/swimboost/swimboost3.statuseffect +++ b/stats/effects/swimboost/swimboost3.statuseffect @@ -1,13 +1,15 @@ { "name" : "swimboost3", - "effectConfig" : { - "boostAmount" : 1.6, - "riseAmount" : 1.6 - }, + "effectConfig": { + "stats": [ + {"stat": "boostAmount","effectiveMultiplier": 1.6}, + {"stat": "riseAmount","effectiveMultiplier": 1.6} + ] + }, "defaultDuration" : 220, "scripts" : [ - "swimboost1.lua" + "/stats/effects/fu_genericStatApplier.lua" ], "animationConfig" : "swimboost1.animation", "label" : "Swim 3", diff --git a/stats/effects/swimboost/swimboost4.statuseffect b/stats/effects/swimboost/swimboost4.statuseffect index 1e01aaff..1f8d98a0 100644 --- a/stats/effects/swimboost/swimboost4.statuseffect +++ b/stats/effects/swimboost/swimboost4.statuseffect @@ -1,15 +1,17 @@ { "name" : "swimboost4", - "effectConfig" : { - "boostAmount" : 2.0, - "riseAmount" : 2.0 - }, + "effectConfig": { + "stats": [ + {"stat": "boostAmount","effectiveMultiplier": 2}, + {"stat": "riseAmount","effectiveMultiplier": 2} + ] + }, "defaultDuration" : 220, "scripts" : [ - "swimboost1.lua" + "/stats/effects/fu_genericStatApplier.lua" ], - "animationConfig" : "swimboost1.animation", + "animationConfig" : "swimboost2.animation", "label" : "Swim 4", "icon" : "/interface/statuses/swimboost.png" } From e7fe976425216fdbcb9bb9f54a34bcd54c865680 Mon Sep 17 00:00:00 2001 From: Kherae Date: Sat, 25 Apr 2020 21:39:14 -0700 Subject: [PATCH 06/10] statwindow update --- .../scripted/statWindow/statWindow.config | 20 ++++++++++++++----- interface/scripted/statWindow/statWindow.lua | 4 ++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/interface/scripted/statWindow/statWindow.config b/interface/scripted/statWindow/statWindow.config index 80d79401..b0bd8739 100644 --- a/interface/scripted/statWindow/statWindow.config +++ b/interface/scripted/statWindow/statWindow.config @@ -128,6 +128,15 @@ "pressed" : "/interface/scripted/statWindow/status_fuel_on.png", "pressedOffset" : [0, 0] }, + "expandButton8" : { + "type" : "button", + "position" : [257, 103], + "callback" : "upgradeEquipmentMenu", + "base" : "/interface/scripted/statWindow/status_fuel.png", + "hover" : "/interface/scripted/statWindow/status_fuel_on.png", + "pressed" : "/interface/scripted/statWindow/status_fuel_on.png", + "pressedOffset" : [0, 0] + }, "racialLabel" : { @@ -232,14 +241,15 @@ }, - "races": [ "apex", "avian", "floran", "glitch", "human", "hylotl", "mauskin", "novakid", "shadow", "elduukhar", "argonian", "avali", "fuslimeperson", "slimeperson", "deerfolk", "lastree", "avikan", "bunnykin", "callistan", "calskies","droden", "elunite", "familiar", "felin", "fenerox", "gardevan", "aegi", "greckan", "gyrusen", "calskie", "kazdra", "kemono", "kineptic", "lamia", "mantizi","fumantizi", "mlp", "munari", "neko", "nightar", "ningen", "orcana", "fupeglaci","peglaci", "phox", "ponex", "sergal", "skelekin", "trink", "vespoid", "viera", "moogle", "vulpes", "wasphive", "arachne", "Indix", "skath", "pygs", "kitsune", "indix", "thelusian", "fukirhos", "kirhos", "radien", "woggle", "dragon", "tauren", "lucario", "inkling", "eevee", "elysian", "fennix", "lombax_striped", "lombax_pointed", "saturn", "saturn2", "blattra", "sarasinor", "webber", "candavaswebber", "Zoroark","everis","changenykt", "demon", "shade", "veluu", "cat", "deerkin", "terrakin","merrkin", "spiritguardian", "fragmentedruin", "juux", "fupeglaci", "remorian", "lutrin", "irken", "carakinox", "harpy", "alicorn", "batpony", "changeling", "pony", "pegasus", "hippogriff", "unicorn", "ponex", "attarran" ], + "races": [ "apex", "avian", "floran", "glitch", "human", "hylotl", "novakid", "shadow", "kirhos", "fukirhos", "thelusian", "radien", "fumantizi", "elduukhar", "nightar", "cat", "veluu", "slimeperson", "fuslimeperson", "fupeglaci", "skath", "juux" ], "elements": [ "physical", "fire", "poison", "ice", "electric", "radioactive", "cosmic", "shadow" ], "statuses" : { // Cold "liquidnitrogenImmunity" : { "name" : "^#4BF3FD;Liquid Nitrogen" }, "nitrogenfreezeImmunity" : { "name" : "^#4BF3FD;Nitrogen Freeze", "skip" : [ "liquidnitrogenImmunity" ] }, - "ffextremecoldImmunity" : { "name" : "^#4BF3FD;Cold II" }, - "biomecoldImmunity" : { "name" : "^#4BF3FD;Cold I", "skip" : [ "ffextremecoldImmunity" ] }, + "ffextremecoldImmunity" : { "name" : "^#4BF3FD;Cold II", "skip" : [ "lethalColdImmunity" ] }, + "biomecoldImmunity" : { "name" : "^#4BF3FD;Cold I", "skip" : [ "ffextremecoldImmunity","lethalColdImmunity" ] }, + "lethalColdImmunity": { "name" : "^#4BF3FD;Cold III"}, // Blocks "quicksandImmunity" : { "name" : "^yellow;Quick Sand" }, @@ -271,7 +281,7 @@ "breathProtection" : { "name" : "Breath" }, "gasImmunity" : { "name" : "^#D1E160;Gas" }, "stunImmunity" : { "name" : "^gray;Stun" }, - "asteroidImmunity" : { "name" : "^gray;Asteroids" }, + //"asteroidImmunity" : { "name" : "^gray;Asteroids" },//removed "sulphuricImmunity" : { "name" : "^#ffd800;Sulph. Acid" }, "protoImmunity" : { "name" : "^#78f04f;Proto-Poison" }, "extremepressureProtection" : { "name" : "^gray;Pressure" }, @@ -296,7 +306,7 @@ "radiationburnImmunity" : { "name" : "^yellow;Radiation Burn" } }, - "scriptWidgetCallbacks" : [ "expand","loreBook", "mechEquip", "mechFuel", "techBuild", "techEquip", "research" ], + "scriptWidgetCallbacks" : [ "expand","loreBook", "mechEquip", "mechFuel", "techBuild", "techEquip", "research","upgradeEquipmentMenu" ], "scripts" : ["/interface/scripted/statWindow/statWindow.lua"], "scriptDelta" : 30 } diff --git a/interface/scripted/statWindow/statWindow.lua b/interface/scripted/statWindow/statWindow.lua index 71e22a46..7787b1a5 100644 --- a/interface/scripted/statWindow/statWindow.lua +++ b/interface/scripted/statWindow/statWindow.lua @@ -156,3 +156,7 @@ function populateRacialDescription(race) widget.setText(listItem..".trait", lists[i]) end end + +function upgradeEquipmentMenu() + player.interact("ScriptPane", "/interface/scripted/fu_multiupgrade/fu_multiupgrade.config", player.id()) +end \ No newline at end of file From c4a761ad9599d1ca1edf72e5eab46a62306d731d Mon Sep 17 00:00:00 2001 From: Kherae Date: Sat, 25 Apr 2020 21:41:03 -0700 Subject: [PATCH 07/10] Update statWindow.config --- interface/scripted/statWindow/statWindow.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/scripted/statWindow/statWindow.config b/interface/scripted/statWindow/statWindow.config index b0bd8739..256fe662 100644 --- a/interface/scripted/statWindow/statWindow.config +++ b/interface/scripted/statWindow/statWindow.config @@ -130,7 +130,7 @@ }, "expandButton8" : { "type" : "button", - "position" : [257, 103], + "position" : [250, 103], "callback" : "upgradeEquipmentMenu", "base" : "/interface/scripted/statWindow/status_fuel.png", "hover" : "/interface/scripted/statWindow/status_fuel_on.png", From e696be605ab28d8e9fec474b75e61f1684c92fbe Mon Sep 17 00:00:00 2001 From: Kherae Date: Sat, 25 Apr 2020 21:54:26 -0700 Subject: [PATCH 08/10] Update statWindow.lua --- interface/scripted/statWindow/statWindow.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/scripted/statWindow/statWindow.lua b/interface/scripted/statWindow/statWindow.lua index 7787b1a5..8f24754c 100644 --- a/interface/scripted/statWindow/statWindow.lua +++ b/interface/scripted/statWindow/statWindow.lua @@ -25,6 +25,7 @@ function init() populateRacialDescription(playerRace) else + widget.setVisible("expandButton8", false) widget.setText("racialLabel", "ERROR - UNRECOGNIZED SPECIES") end end From 63c8195b5aed9380cde7ecfbb3b0fef85713acb6 Mon Sep 17 00:00:00 2001 From: Kherae Date: Sat, 25 Apr 2020 22:12:00 -0700 Subject: [PATCH 09/10] thing --- interface/scripted/fu_multiupgrade/body.png | Bin 0 -> 510 bytes .../scripted/fu_multiupgrade/bodyblue.png | Bin 0 -> 1080 bytes .../scripted/fu_multiupgrade/bodygreen.png | Bin 0 -> 1083 bytes .../scripted/fu_multiupgrade/cardmanip.png | Bin 0 -> 1252 bytes interface/scripted/fu_multiupgrade/cards.png | Bin 0 -> 268 bytes .../scripted/fu_multiupgrade/cardupgrade.png | Bin 0 -> 1277 bytes .../scripted/fu_multiupgrade/durability.png | Bin 0 -> 130 bytes .../fu_multiupgrade/durabilityempty.png | Bin 0 -> 89 bytes interface/scripted/fu_multiupgrade/footer.png | Bin 0 -> 192 bytes .../fu_multiupgrade/fu_multiupgrade.config | 145 +++++++ .../fu_multiupgrade/fu_multiupgrade.lua | 367 ++++++++++++++++++ interface/scripted/fu_multiupgrade/header.png | Bin 0 -> 209 bytes .../scripted/fu_multiupgrade/listitem.png | Bin 0 -> 132 bytes .../fu_multiupgrade/listitemselected.png | Bin 0 -> 125 bytes .../fu_multiupgrade/unavailableoverlay.png | Bin 0 -> 122 bytes .../fu_multiupgrade/weaponupgradeicon.png | Bin 0 -> 265 bytes interface/scripted/statWindow/statWindow.lua | 1 - 17 files changed, 512 insertions(+), 1 deletion(-) create mode 100644 interface/scripted/fu_multiupgrade/body.png create mode 100644 interface/scripted/fu_multiupgrade/bodyblue.png create mode 100644 interface/scripted/fu_multiupgrade/bodygreen.png create mode 100644 interface/scripted/fu_multiupgrade/cardmanip.png create mode 100644 interface/scripted/fu_multiupgrade/cards.png create mode 100644 interface/scripted/fu_multiupgrade/cardupgrade.png create mode 100644 interface/scripted/fu_multiupgrade/durability.png create mode 100644 interface/scripted/fu_multiupgrade/durabilityempty.png create mode 100644 interface/scripted/fu_multiupgrade/footer.png create mode 100644 interface/scripted/fu_multiupgrade/fu_multiupgrade.config create mode 100644 interface/scripted/fu_multiupgrade/fu_multiupgrade.lua create mode 100644 interface/scripted/fu_multiupgrade/header.png create mode 100644 interface/scripted/fu_multiupgrade/listitem.png create mode 100644 interface/scripted/fu_multiupgrade/listitemselected.png create mode 100644 interface/scripted/fu_multiupgrade/unavailableoverlay.png create mode 100644 interface/scripted/fu_multiupgrade/weaponupgradeicon.png diff --git a/interface/scripted/fu_multiupgrade/body.png b/interface/scripted/fu_multiupgrade/body.png new file mode 100644 index 0000000000000000000000000000000000000000..402cfa542d4abb65654e414e36b2d2ed4ad5fff2 GIT binary patch literal 510 zcmeAS@N?(olHy`uVBq!ia0vp^JAwEb2Q!e|b@B2;AmtR`6XGi4pATe0fR~q-2p9kv znwpxKnVCI3Jz^XG?>cm}Ls$5kw$j7}%M(=jD%<-K^Ga7MOVs^ma1V^Q_EU`=sGq$g z$S?T+e}-r8KD^vFCAgb`ficC?#WAGf*4sO+iEj)992{RKpK$rReb$|}nTwjOqS$S+nl%RH`>CDk}OkX^Hxi`l67cQ_b^&HUx2+kdLRPrLj} z;ZM)2cB=ZK)-gXbm+o_jTjlca-iedv&k3D6e0N*oc~$=M>#ep^ZSDl#5I*_);Wb;o zoloA@yqyDM;TYftak6|SNV^jgTi?Zx-BujxEt|Nd-$Rr{CL?m0kU;|_CRv_d99lY^ir^mO%eS?83{1ON;8<9Gl7 literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/bodyblue.png b/interface/scripted/fu_multiupgrade/bodyblue.png new file mode 100644 index 0000000000000000000000000000000000000000..d17b17d13e9878ddfc8abf3a829712c31eecfdf4 GIT binary patch literal 1080 zcmeAS@N?(olHy`uVBq!ia0vp^JAwEb2OE&=a~60+7BevL9R^{>~CK0;p)Gp+a{y=SN|^Qp{b2&(R6LRVfJfU{)MO_^=a&mHg%4QdD-n{wb z)vHzVKmYyvXK`3<=Z+mW)|}|??>`=CcJSoMlU^?Gj!oWU9(l6dzy9|x+w3=|FZQ>V zhK7AI@BZ^l-0}4J`snG}AH0xLC|OmIBi)~$I_2=h>#?kV5*l7)cHS*^-G-fJ zN}o2KX7hIE(?8j(e#e=#q_yv9x{dhk(}t&OldmPNn=Sj-?u3`$y|@0a4@Z5>tc{Sm kZUW47fBwy?G5X2AZ9cml@6@>*z}(K@>FVdQ&MBb@0Mj4|+W-In literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/bodygreen.png b/interface/scripted/fu_multiupgrade/bodygreen.png new file mode 100644 index 0000000000000000000000000000000000000000..5552e9d3ebf4a4168bbd2e86dd8ac0bb73b91c17 GIT binary patch literal 1083 zcmeAS@N?(olHy`uVBq!ia0vp^JAwEb2OE&=a~60+7BevL9R^{>j!QYo9ze;lsN6kE&wqEQsKfj(Wk5cNK zhVTFH?Y5t|IZ#e`7euqV|C1-3b8IF~E`OYOA>yIy-LCV&1UGM6cKPM? zjXR5K|L=1-7Zu%BYx?*?GdQ5Zp>prs?DF^fA+dX3UVG1q-FYVIn{Tc@x+$yd;`@J# z?$3StZU0WepZ|Auw?6-H;Y94Z3HU+p9GEDz8U+(9T+g{`|J+&yOEJTAVVou(XWqK5@5V(s!lwPuuJF#jZ7} z{q^;7R_t`+pWUu?U%MAP{k?zfY0(Nb@{@tS_@k3QixjuD>5Dg|e_E4XwC#LY?79tm zw<&$vcv8&UozMSdulgM)Xu8E0Ea2<`NqPI8rrU_0K04#+HpAHltJB=~mlvt2zyG!T sYvSS`TkLdtv!#;FivIncRb%v%`)32YUCpsGpyGkS)78&qol`;+0P6Z1LI3~& literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/cardmanip.png b/interface/scripted/fu_multiupgrade/cardmanip.png new file mode 100644 index 0000000000000000000000000000000000000000..813da2dbe869d14efab62a2b42c31e630e66bf34 GIT binary patch literal 1252 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UA`Z7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;tCYcbrENpeBO7@-xKyw`j^&|c$85eW7w&hsDg;fN8M#&GS@Rc zb(qSU{d$+-&%B~<+04T~kIq+`!aa{uK;ZAojjj7!SE(1jJkp->B=9FF$$7f^xvXi#ph2S%tI_x}l0H{H|4F{I+w+iUKU zhYT1T9!4$TJHTY2V8Ot>@xZef-kOPr3?>w&TO_8+?0mZMrSOOH6tO*R<~9=208Mn3fTlyGI7YQuwiUTWeIbc!S29(@SM8bg%`4FUfJ#~ zkDW5hoeuf!oXp%bYycr&enL P(1{G5u6{1-oD!M|k3?#4J%UA`Z7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;tCW`P~~$Ej7ZEYt^3bV+1}ToE4*4+;+nS7#0ATD9XbkBFbYOP zV7P|BstVy&U_N0e3Gxg6Ke7Qs@OO4qU_5gcctjR6Fz_7)VaDV6D^h@hRh}-6Ar}5` z&z$6IP~dS5oEi1t|NrfmnoiBwahbK8_3TOO7p~H^eMvg~tN4y`7;IuQ{8*PFdaC7h zWNTAZhw)PlQ;rWxX{|l1EK^SkeH2=uaO6eN6sZ=DunE^*tGYZ{>N3sSWx@n$k9MKS oOF!*=Eih5~1k2f5FWNg^ut+*}tjiWU=>kfEp00i_>zopr05j}l3IG5A literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/durability.png b/interface/scripted/fu_multiupgrade/durability.png new file mode 100644 index 0000000000000000000000000000000000000000..2cef2e421bf80bfde243a4d33cc57424225e3456 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^Z9vS%!3H8vKJx@po}Mm_Ar-fhfBgS%@4Qmw@c%%Y zu0)9`Y7%{%43gf{7bPsX!STHR(?QP1yO*gMv3d5y{L`54a7f~5zgiDa=|#h9$DV7* c<<>AU)Lu&~-n=744`?WZr>mdKI;Vst09Xbt1poj5 literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/durabilityempty.png b/interface/scripted/fu_multiupgrade/durabilityempty.png new file mode 100644 index 0000000000000000000000000000000000000000..028c46d56c90e99be2ce79fee594fde3a30f84ae GIT binary patch literal 89 zcmeAS@N?(olHy`uVBq!ia0vp^9YD;+!2%>Vamp0}DFsg#$B>F!$q5NR^x0J$zG(Qy iHoGyWm^eU)Oa_LO$Fg7UDjx%?W$<+Mb6Mw<&;$TP-4;~< literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/footer.png b/interface/scripted/fu_multiupgrade/footer.png new file mode 100644 index 0000000000000000000000000000000000000000..999c7ca1b15e86c70f6bbd0e86b35a73366d28b2 GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^JAqh?g&9cZom2<`QbGYfA+A9B|Ns9$lHbr3h-Ccp z8UC#~0pzom1o;IsFc^RMXys7n4-|;-ba4!+xb^l-xL|{Ui0eV~K!?BQWw;d>d6xXx z?lkql()A5nZ+vZbV)(PaKI{MYu+9Ao?w{7Ud3fJ;&k5<@_U3&4m~cOxV^4B<#tqKh liVwfvU6}A&@8#Jp&UBm28-E;Fd=h8}gQu&X%Q~loCIGAjO9}u0 literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/fu_multiupgrade.config b/interface/scripted/fu_multiupgrade/fu_multiupgrade.config new file mode 100644 index 00000000..1a4c1f0a --- /dev/null +++ b/interface/scripted/fu_multiupgrade/fu_multiupgrade.config @@ -0,0 +1,145 @@ +{ + "gui": { + "background": { + "zlevel": 0, + "type": "background", + "fileHeader": "/interface/scripted/fu_multiupgrade/header.png", + "fileBody": "/interface/scripted/fu_multiupgrade/bodyblue.png", + "fileFooter": "/interface/scripted/fu_multiupgrade/footer.png" + }, + + "windowtitle": { + "type": "title", + "title": " Upgrade Table", + "subtitle": " Upgrades various equipment", + "icon": { + "type": "image", + "file": "/interface/scripted/mechassembly/upgradeitemslot.png" + } + }, + + "itemScrollArea": { + "type": "scrollArea", + "rect": [5, 99, 174, 215], + "children": { + "itemList": { + "type": "list", + "callback": "itemSelected", + "schema": { + "selectedBG": "/interface/scripted/weaponupgrade/listitemselected.png", + "unselectedBG": "/interface/scripted/weaponupgrade/listitem.png", + "spacing": [0, 1], + "memberSize": [156, 20], + "listTemplate": { + "background": { + "type": "image", + "file": "/interface/scripted/weaponupgrade/listitem.png", + "position": [2, 0], + "zlevel": -1 + }, + "itemName": { + "type": "label", + "position": [25, 5], + "hAnchor": "left", + "wrapWidth": 116, + "value": "Replace Me" + }, + "itemIcon": { + "type": "itemslot", + "position": [3, 1], + "callback": "null" + }, + "unavailableoverlay": { + "type": "image", + "file": "/interface/scripted/weaponupgrade/unavailableoverlay.png", + "position": [2, 0], + "zlevel": 1 + } + } + } + } + } + }, + + "essenceCostDescription": { + "type": "label", + "position": [93, 65], + "hAnchor": "mid", + "vAnchor": "bottom", + "color": "cyan", + "value": "REQUIRED MODULES" + }, + "upgradeIcon": { + "type": "image", + "zlevel": 1, + "file": "/interface/scripted/fu_multiupgrade/cardupgrade.png", + "position": [25, 48], + "visible": false, + "hAnchor": "mid", + "vAnchor": "bottom", + "mouseTransparent": true + }, + "manipIcon": { + "type": "image", + "zlevel": 1, + "file": "/interface/scripted/fu_multiupgrade/cardmanip.png", + "position": [25, 48], + "visible": false, + "hAnchor": "mid", + "vAnchor": "bottom", + "mouseTransparent": true + }, + "essenceCost": { + "type": "label", + "position": [93, 56], + "hAnchor": "mid", + "vAnchor": "bottom", + "value": "0 / --" + }, + + "btnUpgrade": { + "type": "button", + "position": [92, 30], + "base": "/interface/button.png", + "hover": "/interface/buttonhover.png", + "disabledImage": "/interface/buttongrayed.png", + "caption": "Upgrade", + "callback": "doUpgrade" + }, + "cancel": { + "type": "button", + "position": [33, 30], + "base": "/interface/button.png", + "hover": "/interface/buttonhover.png", + "caption": "Cancel", + "callback": "close" + }, + "close": { + "type": "button", + "base": "/interface/x.png", + "hover": "/interface/xhover.png", + "pressed": "/interface/xpress.png", + "pressedOffset": [0, 0], + "position": [161, 242] + }, + + "emptyLabel": { + "type": "label", + "position": [90, 150], + "hAnchor": "mid", + "value": "You don't have any weapons to upgrade!", + "wrapWidth": 125, + "color": [185, 181, 178] + } + }, + + "scriptWidgetCallbacks": [ + "itemSelected", + "doUpgrade" + ], + + "scripts": ["/interface/scripted/fu_multiupgrade/fu_multiupgrade.lua"], + "scriptDelta": 30, + + "upgradeLevel": 10 +} \ No newline at end of file diff --git a/interface/scripted/fu_multiupgrade/fu_multiupgrade.lua b/interface/scripted/fu_multiupgrade/fu_multiupgrade.lua new file mode 100644 index 00000000..dba4fea6 --- /dev/null +++ b/interface/scripted/fu_multiupgrade/fu_multiupgrade.lua @@ -0,0 +1,367 @@ +require "/scripts/util.lua" +require "/scripts/interp.lua" +require "/scripts/researchGenerators.lua" + +function init() + self.itemList = "itemScrollArea.itemList" + self.weaponUpgradeLevel = 6 + self.toolUpgradeLevel = 20 + self.upgradableItems = {} + self.selectedItem = nil + populateItemList() +end + +function update(dt) + populateItemList() +end + +function upgradeCost(itemConfig,itemType) + if itemConfig == nil then return 0 end + local newValue = 0 + + if itemType=="weapon" then + newValue=(itemConfig.parameters.level or itemConfig.config.level) or 1--cost is current level in upgrade modules + elseif itemType=="tool" then + itemConfig.config.upmod = itemConfig.config.upmod or 1 + newValue = (root.evalFunction("minerModuleValue", itemConfig.parameters.level or itemConfig.config.level or 1) *3) * itemConfig.config.upmod + end + return math.floor(newValue) +end + +function populateItemList(forceRepop) + local upgradeableWeaponItems = player.itemsWithTag("upgradeableWeapon") + local upgradeableToolItems = player.itemsWithTag("mininglaser") + local upgradableItems={} + + for i = 1, #upgradeableWeaponItems do + upgradeableWeaponItems[i].count = 1 + table.insert(upgradableItems,{itemData=upgradeableWeaponItems[i],itemType="weapon"}) + end + + for i = 1, #upgradeableToolItems do + upgradeableToolItems[i].count = 1 + table.insert(upgradableItems,{itemData=upgradeableToolItems[i],itemType="tool"}) + end + + + widget.setVisible("emptyLabel", #upgradableItems == 0) + + local upgrademodules = player.hasCountOfItem("upgrademodule") + local manipulatormodules = player.hasCountOfItem("manipulatormodule") + + local itemsCompare=compare(upgradableItems, self.upgradableItems) + + if forceRepop or not itemsCompare then + widget.clearListItems(self.itemList) + widget.setButtonEnabled("btnUpgrade", false) + self.upgradableItems = upgradableItems + --widget.clearListItems(self.itemList) + --widget.setButtonEnabled("btnUpgrade", false) + + for i, item in pairs(self.upgradableItems) do + local config = root.itemConfig(item.itemData) + local entryLevelMax=(item.itemType=="weapon" and self.weaponUpgradeLevel) or (item.itemType=="tool" and self.toolUpgradeLevel) + if (config.parameters.level or config.config.level or 1) < entryLevelMax then + local listItem = string.format("%s.%s", self.itemList, widget.addListItem(self.itemList)) + local name = config.parameters.shortdescription or config.config.shortdescription + + widget.setText(string.format("%s.itemName", listItem), name) + widget.setItemSlotItem(string.format("%s.itemIcon", listItem), item.itemData) + + local price = upgradeCost(config,item.itemType) + widget.setData(listItem, { index = i, price = price,itemType = item.itemType }) + + local priceVar = (item.itemType=="weapon" and upgrademodules) or (item.itemType=="tool" and manipulatormodules) or 0 + widget.setVisible(string.format("%s.unavailableoverlay", listItem), price > priceVar) + end + end + + self.selectedItem = nil + showItem(nil) + end +end + +function showItem(item,price,itemType) + local enableButton=false + if itemType=="weapon" then + enableButton=showWeapon(item,price) + elseif itemType=="tool" then + enableButton=showTool(item,price) + else + widget.setText("essenceCost", string.format("0 / --")) + end + + widget.setVisible("upgradeIcon",itemType=="weapon") + widget.setVisible("manipIcon",itemType=="tool") + widget.setButtonEnabled("btnUpgrade", enableButton) +end + + + +function showWeapon(item, price) + local upgradeModules = player.hasCountOfItem("upgrademodule", true) + local enableButton = false + + if item then + enableButton = upgradeModules >= price + local directive = enableButton and "^green;" or "^red;" + widget.setText("essenceCost", string.format("%s%s / %s", directive, upgradeModules, price)) + --else + --widget.setText("essenceCost", string.format("%s / --", upgradeModules)) + end + --widget.setButtonEnabled("btnUpgrade", enableButton) + return enableButton +end + +function showTool(item, price) + local playerModule = player.hasCountOfItem("manipulatormodule", true) + local enableButton = false + + if item then + enableButton = playerModule >= price + local directive = enableButton and "^green;" or "^red;" + widget.setText("essenceCost", string.format("%s%s / %s", directive, playerModule, price)) + else + widget.setText("essenceCost", string.format("%s / --", playerModule)) + end + + return enableButton +end + +function itemSelected() + local listItem = widget.getListSelected(self.itemList) + self.selectedItem = listItem + + if listItem then + local listItem = widget.getData(string.format("%s.%s", self.itemList, listItem)) + local localItem = self.upgradableItems[listItem.index] + showItem(localItem.itemData,listItem.price,localItem.itemType) + end +end + +--[[ +function isArmor() + if (upgradedItem.parameters.category == "legarmor") or (upgradedItem.parameters.category == "chestarmor") or (upgradedItem.parameters.category == "headarmor") then + isArmorSet = 1 + return isArmorSet + end +end]] + +function doUpgrade() + if self.selectedItem then + + local selectedData = widget.getData(string.format("%s.%s", self.itemList, self.selectedItem)) + local upgradeItemInfo = self.upgradableItems[selectedData.index] + if upgradeItemInfo.itemType=="weapon" then + upgradeWeapon(upgradeItemInfo.itemData,selectedData.price) + elseif upgradeItemInfo.itemType=="tool" then + upgradeTool(upgradeItemInfo.itemData,selectedData.price) + end + + + populateItemList(true) + end +end + +function upgradeWeapon(upgradeItem,price) + if upgradeItem then + local consumedItem = player.consumeItem(upgradeItem, false, true) + if consumedItem then + local consumedCurrency = player.consumeItem({name = "upgrademodule", count = price}, false, true) + local upgradedItem = copy(consumedItem) + if consumedCurrency then + + local itemConfig = root.itemConfig(upgradedItem) + self.baseValueMod = itemConfig.config.level or 1 -- store the original level in case we need it for calculations + + upgradedItem.parameters.level = (itemConfig.parameters.level or itemConfig.config.level or 1) + 1 + + upgradedItem.parameters.critChance = (itemConfig.parameters.critChance or itemConfig.config.critChance or 1) + 0.1 -- increase Crit Chance + upgradedItem.parameters.critBonus = (itemConfig.parameters.critBonus or itemConfig.config.critBonus or 1) + 0.25 -- increase Crit Damage + + -- set Rarity + if upgradedItem.parameters.level ==4 then + upgradedItem.parameters.rarity = "uncommon" + elseif upgradedItem.parameters.level == 5 then + upgradedItem.parameters.rarity = "rare" + end + + -- is it a shield? + if (itemConfig.config.category == "shield") then + upgradedItem.parameters.shieldBash = (itemConfig.parameters.shieldBash or itemConfig.config.shieldBash or 1) + 0.25 + self.baseValueMod + upgradedItem.parameters.shieldBashPush = (itemConfig.parameters.shieldBashPush or itemConfig.config.shieldBashPush or 1) + 0.25 + + if upgradedItem.parameters.cooldownTime then + upgradedItem.parameters.cooldownTime = (itemConfig.parameters.cooldownTime or itemConfig.config.cooldownTime or 1) * 0.98 + end + + if upgradedItem.parameters.perfectBlockTime then + upgradedItem.parameters.perfectBlockTime = (itemConfig.parameters.perfectBlockTime or itemConfig.config.perfectBlockTime or 1) * 1.03 + end + if upgradedItem.parameters.shieldEnergyBonus then + upgradedItem.parameters.shieldEnergyBonus = (itemConfig.parameters.shieldEnergyBonus or itemConfig.config.shieldEnergyBonus or 1) * 1.05 + end + if upgradedItem.parameters.baseShieldHealth then + upgradedItem.parameters.baseShieldHealth = (itemConfig.parameters.baseShieldHealth or itemConfig.config.baseShieldHealth or 1) * 1.05 + end + end + + upgradedItem.parameters.primaryAbility = {} + + -- magnorbs + if (upgradedItem.parameters.orbitRate) then + upgradedItem.parameters.shieldKnockback = (itemConfig.parameters.shieldKnockback or itemConfig.config.shieldKnockback or 1) + 1 + upgradedItem.parameters.shieldEnergyCost = (itemConfig.parameters.shieldEnergyCost or itemConfig.config.shieldEnergyCost or 1) + 1 + upgradedItem.parameters.shieldHealth = (itemConfig.parameters.shieldHealth or itemConfig.config.shieldHealth or 1) + 1 + end + --staff + if (itemConfig.config.category == "staff") or (itemConfig.config.category == "wand") then + upgradedItem.parameters.primaryAbility = {} + if (itemConfig.config.baseDamageFactor) then + upgradedItem.parameters.baseDamageFactor = (itemConfig.parameters.baseDamageFactor or itemConfig.config.baseDamageFactor or 1) * 1.05 + end + end + -- boomerangs and other projectileParameters based things (magnorbs here too , chakrams) + if (upgradedItem.parameters.projectileParameters) then + upgradedItem.parameters.projectileParameters = { + controlForce = itemConfig.config.primaryAbility.controlForce + (upgradedItem.parameters.level) + } + end + + if (itemConfig.config.primaryAbility) then + + -- beams and miners + if (itemConfig.config.primaryAbility.beamLength) then + upgradedItem.parameters.primaryAbility.beamLength= itemConfig.config.primaryAbility.beamLength + upgradedItem.parameters.level + end + + -- wands/staves + if (itemConfig.config.primaryAbility.maxCastRange) then + upgradedItem.parameters.primaryAbility = { + maxCastRange = itemConfig.config.primaryAbility.maxCastRange + (upgradedItem.parameters.level/4) + } + end + + if (itemConfig.config.primaryAbility.energyCost) then + upgradedItem.parameters.primaryAbility = { + energyCost = itemConfig.config.primaryAbility.energyCost - (upgradedItem.parameters.level/3) + } + end + + -- Can it STUN? + if (itemConfig.config.category == "hammer") or (itemConfig.config.category == "mace") or (itemConfig.config.category == "greataxe") or (itemConfig.config.category == "quarterstaff") then + upgradedItem.parameters.stunChance = (itemConfig.parameters.stunChance or itemConfig.config.stunChance or 1) + 0.5 + self.baseValueMod + end + end + + + if (itemConfig.config.improvedParameters) and (upgradedItem.parameters.level) > 3 then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.improvedParameters) + end + -- check if player gets Research randomly + checkResearchBonus() + player.giveItem(upgradedItem) + end + end + end +end + + +function upgradeTool(upgradeItem,price) + if upgradeItem then + local consumedItem = player.consumeItem(upgradeItem, false, true) + if consumedItem then + local consumedCurrency = player.consumeItem({name = "manipulatormodule", count = price}, false, true) + --local consumedCurrency = player.consumeCurrency("fuscienceresource", selectedData.price) + local upgradedItem = copy(consumedItem) + if consumedCurrency then + + local itemConfig = root.itemConfig(upgradedItem) + upgradedItem.parameters.level = (itemConfig.parameters.level or itemConfig.config.level or 1) + 1 + + -- set Rarity + if upgradedItem.parameters.level ==3 then + upgradedItem.parameters.rarity = "uncommon" + elseif upgradedItem.parameters.level == 5 then + upgradedItem.parameters.rarity = "rare" + elseif upgradedItem.parameters.level == 7 then + upgradedItem.parameters.rarity = "legendary" + elseif upgradedItem.parameters.level >= 8 then + upgradedItem.parameters.rarity = "essential" + end + + + upgradedItem.parameters.primaryAbility = {} + + -- check item types here + if not (upgradedItem.parameters.upmod) then + upgradedItem.parameters.upmod = 1 + end + + if (upgradedItem.parameters.level) <= 2 and itemConfig.config.upgradeParameters then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters) + elseif (upgradedItem.parameters.level) == 3 and itemConfig.config.upgradeParameters2 then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters2) + elseif (upgradedItem.parameters.level) == 4 and itemConfig.config.upgradeParameters3 and not (itemConfig.config.category == "hookshot") and not (itemConfig.config.category == "parasol") then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters3) + upgradedItem.parameters.upmod= upgradedItem.parameters.upmod + 0.5 or 1.5 + elseif (upgradedItem.parameters.level) == 5 and itemConfig.config.upgradeParameters4 and not (itemConfig.config.category == "hookshot") and not (itemConfig.config.category == "relocator") and not (itemConfig.config.category == "parasol") then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters4) + elseif (upgradedItem.parameters.level) == 6 and itemConfig.config.upgradeParameters5 and not (itemConfig.config.category == "hookshot") and not (itemConfig.config.category == "relocator") and not (itemConfig.config.category == "parasol") then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters5) + upgradedItem.parameters.upmod= upgradedItem.parameters.upmod + 0.5 or 2 + elseif (upgradedItem.parameters.level) == 7 and itemConfig.config.upgradeParameters6 and not (itemConfig.config.category == "hookshot") and not (itemConfig.config.category == "relocator") and not (itemConfig.config.category == "parasol") and not (itemConfig.config.category == "translocator") then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters6) + elseif (upgradedItem.parameters.level) == 8 and itemConfig.config.upgradeParameters7 and not (itemConfig.config.category == "hookshot") and not (itemConfig.config.category == "relocator") and not (itemConfig.config.category == "parasol") and not (itemConfig.config.category == "translocator") then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters7) + upgradedItem.parameters.upmod= upgradedItem.parameters.upmod + 0.5 or 2.5 + elseif (upgradedItem.parameters.level) > 8 and itemConfig.config.upgradeParameters8 and not (itemConfig.config.category == "bugnet") and not (itemConfig.config.category == "hookshot") and not (itemConfig.config.category == "relocator") and not (itemConfig.config.category == "parasol") and not (itemConfig.config.category == "translocator") and not (itemConfig.config.category == "detector") then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters8) + upgradedItem.parameters.primaryAbility.beamLength= 30 + ( upgradedItem.parameters.level + 1 ) + upgradedItem.parameters.primaryAbility.energyUsage= 6 + ( upgradedItem.parameters.level /10 ) + upgradedItem.parameters.primaryAbility.baseDps = itemConfig.config.primaryAbility.baseDps + ( upgradedItem.parameters.level /10 ) + upgradedItem.parameters.upmod= upgradedItem.parameters.upmod + 0.5 or 3 + upgradedItem.parameters.rarity = "legendary" + elseif (upgradedItem.parameters.level) > 8 and itemConfig.config.upgradeParameters8 and (itemConfig.config.category == "bugnet") then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters8) + upgradedItem.parameters.primaryAbility.energyUsage= 1 + ( upgradedItem.parameters.level /20 ) + upgradedItem.parameters.primaryAbility.baseDps = itemConfig.config.primaryAbility.baseDps + ( upgradedItem.parameters.level /10 ) + upgradedItem.parameters.upmod= upgradedItem.parameters.upmod + 0.5 or 3 + upgradedItem.parameters.rarity = "legendary" + end + + if (itemConfig.config.category == "repairgun") and (upgradedItem.parameters.level) > 8 and itemConfig.config.upgradeParameters8 then + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters8) + upgradedItem.parameters.primaryAbility.projectileParameters.restoreBase= (upgradedItem.parameters.level) + 3 + upgradedItem.parameters.primaryAbility.projectileParameters.speed= (upgradedItem.parameters.level)+1 + upgradedItem.parameters.primaryAbility.energyUsage= 10 + ( upgradedItem.parameters.level /10 ) + -- catch leftovers + elseif (itemConfig.config.category == "detector") and (upgradedItem.parameters.level) >=8 then -- ore detectors and cave detectors + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters8) + upgradedItem.parameters.pingRange= upgradedItem.parameters.pingRange + 1 + upgradedItem.parameters.pingDuration= upgradedItem.parameters.pingDuration + 0.15 + upgradedItem.parameters.pingCooldown= upgradedItem.parameters.pingCooldown - 0.05 + elseif (itemConfig.config.category == "parasol") and (upgradedItem.parameters.level) >=3 then -- parasol + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters2) + upgradedItem.parameters.level = 20 + upgradedItem.parameters.rarity = "legendary" + elseif (itemConfig.config.category == "translocator") and (upgradedItem.parameters.level) >=5 then -- translocator + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters4) + upgradedItem.parameters.level = 20 + upgradedItem.parameters.rarity = "legendary" + elseif (itemConfig.config.category == "hookshot") and (upgradedItem.parameters.level) >=3 then -- hookshots + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters2) + upgradedItem.parameters.level = 20 + upgradedItem.parameters.rarity = "legendary" + elseif (itemConfig.config.category == "relocator") and (upgradedItem.parameters.level) >=4 then -- relocators + upgradedItem.parameters = util.mergeTable(upgradedItem.parameters, itemConfig.config.upgradeParameters3) + upgradedItem.parameters.level = 20 + upgradedItem.parameters.rarity = "legendary" + end + + end + player.giveItem(upgradedItem) + checkResearchBonus() + end + end +end \ No newline at end of file diff --git a/interface/scripted/fu_multiupgrade/header.png b/interface/scripted/fu_multiupgrade/header.png new file mode 100644 index 0000000000000000000000000000000000000000..3f95bd5a22998f27927dcfe36d677c7b0a5c8625 GIT binary patch literal 209 zcmV;?051QDP)X1^@s6ZLyEC0001(NkljCWedUD;vmYSN!WRb$2x1yUaZp&sLDp z&FueA-rC%l{h!H85026IbxKc;$?Fb|(SM(O4N3hzd8>oN&y$xQ9Fw;^I3|yX>62?F zr|jg@@{?ooJ(FW{C@}fd%3PQia(9JQ(q+w! bFXb3|qmN6K)jC}SYGLqn^>bP0l+XkK3tA;H literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/listitemselected.png b/interface/scripted/fu_multiupgrade/listitemselected.png new file mode 100644 index 0000000000000000000000000000000000000000..4487a9b1966c42468abeec84fbd152c6b1aa30cb GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^bAVWckr_xjO+B_7NU;U@gt-0(gV36zopr0F1C8I{*Lx literal 0 HcmV?d00001 diff --git a/interface/scripted/fu_multiupgrade/weaponupgradeicon.png b/interface/scripted/fu_multiupgrade/weaponupgradeicon.png new file mode 100644 index 0000000000000000000000000000000000000000..68cabb9c76572c6d684b6e0854d45dd86cbabf34 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;w^#Gp`*Z=?j1DRKEK3%?iV|hh6 zkXlHvbwvr&fU z1MCv42OSvB2nI1RyKZPPayjO~ppy84iS1AqqXVZP$8kZ8qZu5DT)Q|9TPAgK^d(yf zx$p61IaMf9xJIL-u~4mRYxe=m)s0pOGU6w59XMy4d2^Mc?}^^a)`Gq-PVSBt?gA?~ zPFeC4ujpl9Ud?lco1IyrAxPl-&4$0a#cVu$i&!}rcKtP8ETt@U4(KcfPgg&ebxsLQ E0L#5xE&u=k literal 0 HcmV?d00001 diff --git a/interface/scripted/statWindow/statWindow.lua b/interface/scripted/statWindow/statWindow.lua index 8f24754c..7787b1a5 100644 --- a/interface/scripted/statWindow/statWindow.lua +++ b/interface/scripted/statWindow/statWindow.lua @@ -25,7 +25,6 @@ function init() populateRacialDescription(playerRace) else - widget.setVisible("expandButton8", false) widget.setText("racialLabel", "ERROR - UNRECOGNIZED SPECIES") end end From 6def16fb1689fce9079d717112fd20d8c07731e4 Mon Sep 17 00:00:00 2001 From: Kherae Date: Tue, 28 Apr 2020 19:05:04 -0700 Subject: [PATCH 10/10] ebi --- interface/scripted/statWindow/statWindow.config | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/interface/scripted/statWindow/statWindow.config b/interface/scripted/statWindow/statWindow.config index 256fe662..65c943e3 100644 --- a/interface/scripted/statWindow/statWindow.config +++ b/interface/scripted/statWindow/statWindow.config @@ -247,9 +247,8 @@ // Cold "liquidnitrogenImmunity" : { "name" : "^#4BF3FD;Liquid Nitrogen" }, "nitrogenfreezeImmunity" : { "name" : "^#4BF3FD;Nitrogen Freeze", "skip" : [ "liquidnitrogenImmunity" ] }, - "ffextremecoldImmunity" : { "name" : "^#4BF3FD;Cold II", "skip" : [ "lethalColdImmunity" ] }, - "biomecoldImmunity" : { "name" : "^#4BF3FD;Cold I", "skip" : [ "ffextremecoldImmunity","lethalColdImmunity" ] }, - "lethalColdImmunity": { "name" : "^#4BF3FD;Cold III"}, + "ffextremecoldImmunity" : { "name" : "^#4BF3FD;Cold II" }, + "biomecoldImmunity" : { "name" : "^#4BF3FD;Cold I", "skip" : [ "ffextremecoldImmunity" ] }, // Blocks "quicksandImmunity" : { "name" : "^yellow;Quick Sand" },