diff --git a/codex/documents/ffguide6.codex b/codex/documents/ffguide6.codex index f1af0589469..4f914b240a0 100644 --- a/codex/documents/ffguide6.codex +++ b/codex/documents/ffguide6.codex @@ -8,7 +8,7 @@ "longContentPages":[ "FrackinUniverse adds a large amount of armors (and foods) and enhances some older ones, allowing for a greater variety of playstyles. These can be very useful through gameplay and provide exceptionally useful benefits!\n ^orange;Stats^reset; : Vanilla players may notice there are more than they are used to, and even the ones they are used to have different ranges. FU presents a wider variety of armor classes to spice up your play, and does the same with food.\n -If you are more interested in damage, pick up Power armor or hyper power armor to trade defensive stats for offensive ones. Alternatively, pick up Tank or Power Tank sets to outlast your enemy. They come in melee OR ranged! Fighting not quite your thing? Pick up an Exploration oriented set, and be at home in your environment! You're guaranteed to locate a set that suits your playstyle somewhere out there!\n +If you are more interested in damage, pick up Power Armor or Hyper Power Armor to trade defensive stats for offensive ones. Alternatively, pick up Tank or Hyper Tank sets to outlast your enemy. They come in melee OR ranged! Fighting not quite your thing? Pick up an Exploration oriented set, and be at home in your environment! You're guaranteed to locate a set that suits your playstyle somewhere out there!\n ^orange;Resistances^reset; : Many armors in FU come with inherent resistances. Many biome weather effects will simply stop affecting you once you hit an appropriate amount, and various enemy attacks will do less damage. Nifty, right? It gets better; upgrade your armor, and those resistances will increase!\n ^orange;Bonuses^reset; : Most are increases to your stats, plenty are conditional. Any that say ^green;+value^reset; are typically additive increases. It can be a little confusing, however. As example: if it gives +^green;3^reset;% Crit Chance it increases your crit chance by a flat 3%, but if it says +^green;3^reset;% Energy Regen, that's 3% of your base. The easiest way to remember is to ask yourself...does it have a base of 0? If so, it likely is like Crit Chance! If a bonus says x^green;1.3^reset;, or ^green;More^reset;, that's a multiplier on the value you currently have. Have 1000% Damage somehow? 100% More (or 2x) would make it 2000%! Small note: Regen is usually per second.\n @@ -27,10 +27,12 @@ As a small side-note, some terms or symbols are used loosely. If you see a bonus ^cyan;Undying Resolve^reset;: increases Protection as your life gets lower, up to the stated amount, while ^cyan;Immortal Resolve^reset; grants HP Regen instead. If a set grants either, it will grant ^cyan;Immortal Resolve^reset; to your pet.\n ^cyan;Dark Commander^reset;/^cyan;Beast Master^reset;: Increases Damage, Protection, HP and Speed of your pets (both) and crew (Dark Commander) by the listed percent, increases their jump ability by half of that, and regenerates HP at a sixth of that amount per second.\n ^cyan;Capturenaut^reset;: Increases pet count by 1, plus an additional 1 per 2 tiers (up to +2) of the lowest equipped set piece. Grants an additional +1 if using alongside the back item. This means a fully upgraded set will allow up to 5 additional pets!\n -^red;Wretchel Toxicity^reset;: Ingesting Wretchel reduces core stats and healing received, and drains health over time. These effects increase in severity the more you consume in a short time frame, as well as while your health is critically low. It will ^red;KILL^reset; you, if you are careless. +^red;Wretchel Toxicity^reset;: Ingesting Wretchel reduces core stats and healing received, and drains health over time. These effects increase in severity the more you consume in a short time frame, as well as while your health is critically low. It will ^red;KILL^reset; you, if you are careless.\n ^cyan;Charisma^reset;: Your ability to bargain with Traders at space stations. The higher your charisma, the better the deal (and fatter your bank balance!)\n -They will inherit more stats from you, both beneficial and detrimental, and have special scaling on Protection and HP. Be mindful when taking powerful buffs like ^cyan;Glass Cannon^reset;, as it will reduce their health noticeably. -^cyan;Pet Stat Inheritance^reset; is as follows: HP, directly from your character, rather than just equipped armor, and increased further by your Protection stat. Protection: Inherited from armor as in vanilla. Damage: directly from character sheet. Health Regen: Inherits as a flat amount, except in special cases (^cyan;Immortal Resolve^reset;, effects not covered by FU, etc.). If you have 100 health and 10% HP Regen, it will grant your pet 10 HP per second. If a stat isn't here, a pet most likely does not inherit it." +\n\n^cyan;Pet/Crew Stat Inheritance^reset;: +Overall scaling is as follows: HP, directly from your character, rather than just equipped armor. Protection: applied as a multiplier to HP via a specific formula. Damage: directly from character sheet. Health Regen: Inherits as a flat amount, except in special cases (^cyan;Immortal Resolve^reset;, effects not covered by FU, etc.). If you have 100 health and 10% HP Regen, it will grant your pet 10 HP per second. If a stat isn't here, a pet most likely does not inherit it. +^yellow;Special notes^reset;: Be mindful when taking powerful buffs like ^cyan;Glass Cannon^reset;, as it will reduce their health noticeably. +" ], diff --git a/interface/itemdescriptions/gun2aetherium.itemdescription b/interface/itemdescriptions/gun2aetherium.itemdescription index 54b33e65727..7257af4a305 100644 --- a/interface/itemdescriptions/gun2aetherium.itemdescription +++ b/interface/itemdescriptions/gun2aetherium.itemdescription @@ -131,7 +131,7 @@ "type" : "label", "position" : [16, 34], "hAnchor" : "left", - "value" : "^green;Shots per Charge^reset;:" + "value" : "Energy Per Shot:" }, "energyPerShotLabel" : { "type" : "label", diff --git a/items/active/weapons/npc/swtjc_ewg_npcantimaterialrifle.activeitem b/items/active/weapons/npc/swtjc_ewg_npcantimaterialrifle.activeitem index a8448bc5f08..004c519fb71 100644 --- a/items/active/weapons/npc/swtjc_ewg_npcantimaterialrifle.activeitem +++ b/items/active/weapons/npc/swtjc_ewg_npcantimaterialrifle.activeitem @@ -4,7 +4,7 @@ "maxStack" : 1, "rarity" : "Common", "description" : "A high-powered rifle that sacrifices rate-of-fire for enough firepower to cut through armor like a hot knife through butter.", - "shortdescription" : "NPC Anti-Material Rifle", + "shortdescription" : "NPC Anti-Materiel Rifle", "tooltipKind" : "gun", "category" : "swtjc_ewg_antiMaterialRifle", "twoHanded" : true, diff --git a/items/active/weapons/ranged/sniperrifle/swtjc_ewg_commonantimaterialrifle.activeitem b/items/active/weapons/ranged/sniperrifle/swtjc_ewg_commonantimaterialrifle.activeitem index c9731eceb4c..36bc8df1c89 100644 --- a/items/active/weapons/ranged/sniperrifle/swtjc_ewg_commonantimaterialrifle.activeitem +++ b/items/active/weapons/ranged/sniperrifle/swtjc_ewg_commonantimaterialrifle.activeitem @@ -4,7 +4,7 @@ "maxStack" : 1, "rarity" : "Common", "description" : "Sacrifices rate-of-fire for enough firepower to cut through armor.", - "shortdescription" : "Common Anti-Material Rifle", + "shortdescription" : "Common Anti-Materiel Rifle", "tooltipKind" : "gun2", "category" : "swtjc_ewg_antiMaterialRifle", "twoHanded" : true, diff --git a/items/active/weapons/ranged/sniperrifle/swtjc_ewg_rareantimaterialrifle.activeitem b/items/active/weapons/ranged/sniperrifle/swtjc_ewg_rareantimaterialrifle.activeitem index 4c487d3c1a5..2cb4069988b 100644 --- a/items/active/weapons/ranged/sniperrifle/swtjc_ewg_rareantimaterialrifle.activeitem +++ b/items/active/weapons/ranged/sniperrifle/swtjc_ewg_rareantimaterialrifle.activeitem @@ -4,7 +4,7 @@ "maxStack" : 1, "rarity" : "Rare", "description" : "A high-powered rifle that sacrifices rate-of-fire for enough firepower to cut through armor.", - "shortdescription" : "Rare Anti-Material Rifle", + "shortdescription" : "Rare Anti-Materiel Rifle", "tooltipKind" : "gun2", "category" : "swtjc_ewg_antiMaterialRifle", "twoHanded" : true, diff --git a/items/active/weapons/ranged/sniperrifle/swtjc_ewg_uncommonantimaterialrifle.activeitem b/items/active/weapons/ranged/sniperrifle/swtjc_ewg_uncommonantimaterialrifle.activeitem index 163bee9f09d..6eab4eb57fe 100644 --- a/items/active/weapons/ranged/sniperrifle/swtjc_ewg_uncommonantimaterialrifle.activeitem +++ b/items/active/weapons/ranged/sniperrifle/swtjc_ewg_uncommonantimaterialrifle.activeitem @@ -4,7 +4,7 @@ "maxStack" : 1, "rarity" : "Uncommon", "description" : "A high-powered rifle that sacrifices rate-of-fire for enough firepower to cut through armor.", - "shortdescription" : "Uncommon Anti-Material Rifle", + "shortdescription" : "Uncommon Anti-Materiel Rifle", "tooltipKind" : "gun2", "category" : "swtjc_ewg_antiMaterialRifle", "twoHanded" : true, diff --git a/items/categories.config.patch b/items/categories.config.patch index 75e6bd7100b..faafabee2d5 100644 --- a/items/categories.config.patch +++ b/items/categories.config.patch @@ -36,7 +36,7 @@ [{"op":"test","inverse":true,"path":"/labels/swtjc_ewg_battleRifle"},{"op": "add","path": "/labels/swtjc_ewg_battleRifle","value": "Battle Rifle"}], [{"op":"test","inverse":true,"path":"/labels/swtjc_ewg_squadAutomaticWeapon"},{"op": "add","path": "/labels/swtjc_ewg_squadAutomaticWeapon","value": "Squad Automatic Weapon"}], [{"op":"test","inverse":true,"path":"/labels/swtjc_ewg_beamRifle"},{"op": "add","path": "/labels/swtjc_ewg_beamRifle","value": "Beam Rifle"}], - [{"op":"test","inverse":true,"path":"/labels/swtjc_ewg_antiMaterialRifle"},{"op": "add","path": "/labels/swtjc_ewg_antiMaterialRifle","value": "Anti-Material Rifle"}], + [{"op":"test","inverse":true,"path":"/labels/swtjc_ewg_antiMaterialRifle"},{"op": "add","path": "/labels/swtjc_ewg_antiMaterialRifle","value": "Anti-Materiel Rifle"}], [{"op":"test","inverse":true,"path":"/labels/swtjc_ewg_sawedOffShotgun"},{"op": "add","path": "/labels/swtjc_ewg_sawedOffShotgun","value": "Short-Barreled Shotgun"}], [{"op":"test","inverse":true,"path":"/labels/swtjc_ewg_autoShotgun"},{"op": "add","path": "/labels/swtjc_ewg_autoShotgun","value": "Automatic Shotgun"}], [{"op":"test","inverse":true,"path":"/labels/swtjc_ewg_flakCannon"},{"op": "add","path": "/labels/swtjc_ewg_flakCannon","value": "Flak Cannon"}], diff --git a/objects/power/isn_battery.lua b/objects/power/isn_battery.lua index 3afe4fd25e8..c5748988a0c 100644 --- a/objects/power/isn_battery.lua +++ b/objects/power/isn_battery.lua @@ -66,7 +66,7 @@ function isn_makeBatteryDescription(desc, charge, onDeath) -- append charge state to default description; ensure that it's on a line of its own local str=string_split(desc,"^truncate;") if str[1] then str=str[1] else str="" end - str=str..((onDeath and " ^red;Scan for Info^reset;") or "\n^blue;Upper Right Input^reset;: On/Off Switch\n^red;Output 1^reset;: Partial Power, ^red;Output 2^reset;: Full Power") + str=str..((onDeath and " ^red;Scan for Info^reset;") or "\n^blue;Upper Right Input^reset;: On/Off Switch\n^red;Battery Logic outputs:\nLeft^reset;: Has Power, ^red;Right^reset;: Is Full") str = str .. (desc ~= '' and "\n" or '') .. "Power Stored: ^yellow;"..util.round(power.getStoredEnergy(),1).."^reset;/^green;"..util.round(power.getMaxEnergy(),1).."^reset;J (^yellow;" .. charge .. '^reset;%)' return str end @@ -115,7 +115,7 @@ function batteryUpdate(dt) self.oldPowerStored=power.getStoredEnergy() batteryUpdateThrottle=batteryUpdateThrottleBase*throttleMult --object.setOutputNodeLevel(0,self.oldPowerStored>0) - object.setOutputNodeLevel(0,self.oldPowerStored>=power.getMaxEnergy()*0.01) + object.setOutputNodeLevel(0,self.oldPowerStored>=power.getMaxEnergy()*0.1) object.setOutputNodeLevel(1,power.getStoredEnergy() >= power.getMaxEnergy()) end end diff --git a/quests/generated/pools/weapon.config.patch b/quests/generated/pools/weapon.config.patch index 603b696dc4f..b925e0a2e68 100644 --- a/quests/generated/pools/weapon.config.patch +++ b/quests/generated/pools/weapon.config.patch @@ -5,5 +5,5 @@ {"op" : "replace", "path" : "/0/1/3/name", "value" : "Semi-Automatic, Beam Pistol or Revolver" }, {"op" : "replace", "path" : "/0/1/4/name", "value" : "Standard or Mini Rocket Launcher" }, {"op" : "replace", "path" : "/0/1/5/name", "value" : "Handheld or Multi Grenade Launcher" }, -{"op" : "replace", "path" : "/0/1/6/name", "value" : "Sniper, Semi-Automatic, Anti-Material or Beam Rifle" } -] \ No newline at end of file +{"op" : "replace", "path" : "/0/1/6/name", "value" : "Sniper, Semi-Automatic, Anti-Materiel or Beam Rifle" } +] diff --git a/scripts/ffstrangeseaconfig.config b/scripts/ffstrangeseaconfig.config new file mode 100644 index 00000000000..a65eaec9678 --- /dev/null +++ b/scripts/ffstrangeseaconfig.config @@ -0,0 +1,20 @@ +{ + "version":1.2, + "modifier":1.5, + "effectList":{ + "cold":["ffbiomecold0","ffbiomecold1","ffbiomecold2","ffbiomecold3","ffbiomecold4"], + "heat":["ffbiomeheat1","ffbiomeheat2","ffbiomeheat3"], + "natureStings":["desertweathernew","desertweathernewdeadly","jungleweathernew","beesting"], + "aether":["aetherweathernew","aetherweathernew2","aetherweathernew3"], + "electric":["ffbiomeelectric1","ffbiomeelectric2","ffbiomeelectric3"], + "radiation":["radioactiveweathernew","radioactiveweathernew2","radioactiveweathernew3"], + "poisons":["biomepoison1","biomepoison2","biomepoison3","booze","booze2","booze3","protoweather"], + "sulphuric":["sulphuricweathernew","sulphuricweathernew2","sulphuricweathernew3","sulphuricweathernew4"], + "gases":["fu_nooxygen","helium3","shadowgasfx"], + "pressure":["gasworld1","gasworld2","gasworld3"], + "dark":["superdarkstatlarge","superdarkstatmid","superdarkstat"], + "ghosts":["erchiussickness","erchiussickness2","erchiussickness3"], + "insanity":["insanitynew","insanitynew2","insanitynew3unknown"], + "time":["futimeweather","organicsoupeffect"] + } +} diff --git a/scripts/ffunknownconfig.config b/scripts/ffunknownconfig.config index 5caad023c59..a65eaec9678 100644 --- a/scripts/ffunknownconfig.config +++ b/scripts/ffunknownconfig.config @@ -15,6 +15,6 @@ "dark":["superdarkstatlarge","superdarkstatmid","superdarkstat"], "ghosts":["erchiussickness","erchiussickness2","erchiussickness3"], "insanity":["insanitynew","insanitynew2","insanitynew3unknown"], - "time":["futimeweather"] + "time":["futimeweather","organicsoupeffect"] } } diff --git a/scripts/fr_scripts/healthRegen.lua b/scripts/fr_scripts/healthRegen.lua index 32d50f8c954..ded953c9f45 100644 --- a/scripts/fr_scripts/healthRegen.lua +++ b/scripts/fr_scripts/healthRegen.lua @@ -14,10 +14,8 @@ function FRHelper:call(args, main, dt, ...) if not dt then dt = script.updateDt() end local label=(args.label or "default").."_healthRegen" if not (world.isNpc(entity.id()) and status.resource("health") < 1) then - --status.modifyResourcePercentage("health", args.healingRate * dt * math.max(0,1+status.stat("healingBonus"))) if not self[label.."_timer"] or self[label.."_timer"]>=0.5 then world.sendEntityMessage(entity.id(),"recordFUPersistentEffect",label) - --sb.logInfo("args %s, maxHp %s, healingBonus %s, actualRegen %s",args,status.stat("maxHealth"),status.stat("healingBonus"),status.stat("maxHealth")*(args.healingRate or 0)*math.max(0,1+status.stat("healingBonus"))) status.setPersistentEffects(label,{{stat="healthRegen",amount=status.stat("maxHealth")*(args.healingRate or 0)*math.max(0,1+status.stat("healingBonus"))}}) self[label.."_timer"]=0.0 else diff --git a/scripts/fu_player_init.lua b/scripts/fu_player_init.lua index 960bceb3b29..dc68091dd42 100644 --- a/scripts/fu_player_init.lua +++ b/scripts/fu_player_init.lua @@ -8,7 +8,7 @@ local unknownWorlds={ ffunknown="/scripts/ffunknownconfig.config", shadow="/scripts/ffshadowconfig.config", superdense="/scripts/ffsuperdenseconfig.config", - strangesea="/scripts/ffunknownconfig.config" + strangesea="/scripts/ffstrangeseaconfig.config" } local ffunknownConfig diff --git a/stats/bonuses/argonianRegen.lua b/stats/bonuses/argonianRegen.lua index fcaf55611ed..b157668400a 100644 --- a/stats/bonuses/argonianRegen.lua +++ b/stats/bonuses/argonianRegen.lua @@ -1,24 +1,12 @@ ---didit = false - function init() - --[[self.species = world.entitySpecies(entity.id()) - if not self.species then return else didit = true end - - self.raceJson = root.assetJson("/species/argonian.raceeffect") - self.specialConfig = self.raceJson.specialConfig -]] script.setUpdateDelta(10) bonusHandler=effect.addStatModifierGroup({}) end function update(dt) - --if not didit then init() end - - effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.stat("maxHealth")*0.0023810714*math.max(0,1+status.stat("healingBonus"))}}) - --self.healingRate = 1.00005 / 420 -- health per time - 0.005% health per 420ms, I think --420 seconds to reach 100.005%, or 419.97900104 seconds to restore 100% -khe - --status.modifyResourcePercentage("health", self.healingRate * dt) + effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.stat("maxHealth")*0.0023810714*math.max(0,1+status.stat("healingBonus"))}}) end function uninit() effect.removeStatModifierGroup(bonusHandler) -end \ No newline at end of file +end diff --git a/stats/effects/fu_effects/guardianwings/blueguardian.lua b/stats/effects/fu_effects/guardianwings/blueguardian.lua deleted file mode 100644 index 14686415014..00000000000 --- a/stats/effects/fu_effects/guardianwings/blueguardian.lua +++ /dev/null @@ -1,11 +0,0 @@ -function init() - script.setUpdateDelta(5) -end - -function update(dt) -status.modifyResourcePercentage("health", 1/200 * dt*math.max(0,1+status.stat("healingBonus"))) -end - -function uninit() - -end \ No newline at end of file diff --git a/stats/effects/fu_effects/guardianwings/blueguardian.statuseffect b/stats/effects/fu_effects/guardianwings/blueguardian.statuseffect index 9d0888c2da5..312739151b7 100644 --- a/stats/effects/fu_effects/guardianwings/blueguardian.statuseffect +++ b/stats/effects/fu_effects/guardianwings/blueguardian.statuseffect @@ -1,10 +1,10 @@ { "name" : "blueguardian", - "effectConfig" : {}, + "effectConfig" : {"regenRate":0.005}, "defaultDuration" : 5, "scripts" : [ - "blueguardian.lua" + "guardianwings.lua" ], "animationConfig" : "blueguardian.animation" diff --git a/stats/effects/fu_effects/guardianwings/greenguardian.lua b/stats/effects/fu_effects/guardianwings/greenguardian.lua deleted file mode 100644 index 14686415014..00000000000 --- a/stats/effects/fu_effects/guardianwings/greenguardian.lua +++ /dev/null @@ -1,11 +0,0 @@ -function init() - script.setUpdateDelta(5) -end - -function update(dt) -status.modifyResourcePercentage("health", 1/200 * dt*math.max(0,1+status.stat("healingBonus"))) -end - -function uninit() - -end \ No newline at end of file diff --git a/stats/effects/fu_effects/guardianwings/greenguardian.statuseffect b/stats/effects/fu_effects/guardianwings/greenguardian.statuseffect index 4473a694ba1..fc207d4b4a4 100644 --- a/stats/effects/fu_effects/guardianwings/greenguardian.statuseffect +++ b/stats/effects/fu_effects/guardianwings/greenguardian.statuseffect @@ -1,10 +1,10 @@ { "name" : "greenguardian", - "effectConfig" : {}, + "effectConfig" : {"regenRate":0.005}, "defaultDuration" : 5, "scripts" : [ - "greenguardian.lua" + "guardianwings.lua" ], "animationConfig" : "greenguardian.animation" diff --git a/stats/effects/fu_effects/guardianwings/guardianwings.lua b/stats/effects/fu_effects/guardianwings/guardianwings.lua new file mode 100644 index 00000000000..dd082a24f03 --- /dev/null +++ b/stats/effects/fu_effects/guardianwings/guardianwings.lua @@ -0,0 +1,17 @@ +function init() + script.setUpdateDelta(5) + self.healingRate=config.getParameter("regenRate",1/200) + bonusHandler=effect.addStatModifierGroup({}) +end + +function update(dt) + if (world.entityType(entity.id())=="player") or status.resource("health")>=1 then + effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.resourceMax("health")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) + else + effect.setStatModifierGroup(bonusHandler,{}) + end +end + +function uninit() + effect.removeStatModifierGroup(bonusHandler) +end diff --git a/stats/effects/fu_effects/guardianwings/isogenguardian.lua b/stats/effects/fu_effects/guardianwings/isogenguardian.lua deleted file mode 100644 index 91f3317a2fa..00000000000 --- a/stats/effects/fu_effects/guardianwings/isogenguardian.lua +++ /dev/null @@ -1,11 +0,0 @@ -function init() - script.setUpdateDelta(5) -end - -function update(dt) -status.modifyResourcePercentage("health", 1/900 * dt*math.max(0,1+status.stat("healingBonus"))) -end - -function uninit() - -end \ No newline at end of file diff --git a/stats/effects/fu_effects/guardianwings/isogenguardian.statuseffect b/stats/effects/fu_effects/guardianwings/isogenguardian.statuseffect index 766d7d5483b..2cd0b206720 100644 --- a/stats/effects/fu_effects/guardianwings/isogenguardian.statuseffect +++ b/stats/effects/fu_effects/guardianwings/isogenguardian.statuseffect @@ -1,10 +1,10 @@ { "name" : "isogenguardian", - "effectConfig" : {}, + "effectConfig" : {"regenRate":0.005}, "defaultDuration" : 5, "scripts" : [ - "isogenguardian.lua" + "guardianwings.lua" ], "animationConfig" : "isogenguardian.animation" diff --git a/stats/effects/fu_effects/guardianwings/orangeguardian.lua b/stats/effects/fu_effects/guardianwings/orangeguardian.lua deleted file mode 100644 index 91f3317a2fa..00000000000 --- a/stats/effects/fu_effects/guardianwings/orangeguardian.lua +++ /dev/null @@ -1,11 +0,0 @@ -function init() - script.setUpdateDelta(5) -end - -function update(dt) -status.modifyResourcePercentage("health", 1/900 * dt*math.max(0,1+status.stat("healingBonus"))) -end - -function uninit() - -end \ No newline at end of file diff --git a/stats/effects/fu_effects/guardianwings/orangeguardian.statuseffect b/stats/effects/fu_effects/guardianwings/orangeguardian.statuseffect index 6c9e34f6f0b..187a74fcacf 100644 --- a/stats/effects/fu_effects/guardianwings/orangeguardian.statuseffect +++ b/stats/effects/fu_effects/guardianwings/orangeguardian.statuseffect @@ -1,10 +1,10 @@ { "name" : "orangeguardian", - "effectConfig" : {}, + "effectConfig" : {"regenRate":0.005}, "defaultDuration" : 5, "scripts" : [ - "orangeguardian.lua" + "guardianwings.lua" ], "animationConfig" : "orangeguardian.animation" diff --git a/stats/effects/fu_effects/guardianwings/pinkguardian.lua b/stats/effects/fu_effects/guardianwings/pinkguardian.lua deleted file mode 100644 index 14686415014..00000000000 --- a/stats/effects/fu_effects/guardianwings/pinkguardian.lua +++ /dev/null @@ -1,11 +0,0 @@ -function init() - script.setUpdateDelta(5) -end - -function update(dt) -status.modifyResourcePercentage("health", 1/200 * dt*math.max(0,1+status.stat("healingBonus"))) -end - -function uninit() - -end \ No newline at end of file diff --git a/stats/effects/fu_effects/guardianwings/pinkguardian.statuseffect b/stats/effects/fu_effects/guardianwings/pinkguardian.statuseffect index 24e339fa3e4..d3e93f7009e 100644 --- a/stats/effects/fu_effects/guardianwings/pinkguardian.statuseffect +++ b/stats/effects/fu_effects/guardianwings/pinkguardian.statuseffect @@ -1,10 +1,10 @@ { "name" : "pinkguardian", - "effectConfig" : {}, + "effectConfig" : {"regenRate":0.005}, "defaultDuration" : 5, "scripts" : [ - "pinkguardian.lua" + "guardianwings.lua" ], "animationConfig" : "pinkguardian.animation" diff --git a/stats/effects/fu_effects/guardianwings/xithriciteguardian.lua b/stats/effects/fu_effects/guardianwings/xithriciteguardian.lua deleted file mode 100644 index 91f3317a2fa..00000000000 --- a/stats/effects/fu_effects/guardianwings/xithriciteguardian.lua +++ /dev/null @@ -1,11 +0,0 @@ -function init() - script.setUpdateDelta(5) -end - -function update(dt) -status.modifyResourcePercentage("health", 1/900 * dt*math.max(0,1+status.stat("healingBonus"))) -end - -function uninit() - -end \ No newline at end of file diff --git a/stats/effects/fu_effects/guardianwings/xithriciteguardian.statuseffect b/stats/effects/fu_effects/guardianwings/xithriciteguardian.statuseffect index c5c693e691e..dc3dfb96013 100644 --- a/stats/effects/fu_effects/guardianwings/xithriciteguardian.statuseffect +++ b/stats/effects/fu_effects/guardianwings/xithriciteguardian.statuseffect @@ -1,10 +1,10 @@ { "name" : "xithriciteguardian", - "effectConfig" : {}, + "effectConfig" : {"regenRate":0.005}, "defaultDuration" : 5, "scripts" : [ - "xithriciteguardian.lua" + "guardianwings.lua" ], "animationConfig" : "xithriciteguardian.animation" diff --git a/stats/effects/fu_effects/guardianwings/yellowguardian.lua b/stats/effects/fu_effects/guardianwings/yellowguardian.lua deleted file mode 100644 index b3d8ccf046f..00000000000 --- a/stats/effects/fu_effects/guardianwings/yellowguardian.lua +++ /dev/null @@ -1,11 +0,0 @@ -function init() - script.setUpdateDelta(5) -end - -function update(dt) -status.modifyResourcePercentage("health", 1/200 * dt*math.max(0,1+status.stat("healingBonus"))) -end - -function uninit() - -end \ No newline at end of file diff --git a/stats/effects/fu_effects/guardianwings/yellowguardian.statuseffect b/stats/effects/fu_effects/guardianwings/yellowguardian.statuseffect index 5111a86c9cc..bf497ee59c9 100644 --- a/stats/effects/fu_effects/guardianwings/yellowguardian.statuseffect +++ b/stats/effects/fu_effects/guardianwings/yellowguardian.statuseffect @@ -1,10 +1,10 @@ { "name" : "yellowguardian", - "effectConfig" : {}, + "effectConfig" : {"regenRate":0.005}, "defaultDuration" : 5, "scripts" : [ - "yellowguardian.lua" + "guardianwings.lua" ], "animationConfig" : "yellowguardian.animation" diff --git a/stats/effects/gfex_eeveesetbonus/espeon/espeonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/espeon/espeonsetbonus.lua index 6e2802f0464..0411630975d 100644 --- a/stats/effects/gfex_eeveesetbonus/espeon/espeonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/espeon/espeonsetbonus.lua @@ -1,13 +1,7 @@ function init() - effect.addStatModifierGroup({ - {stat = "physicalResistance", amount = 0.15}, - {stat = "fallDamageMultiplier", effectiveMultiplier = 0.7} - }) - script.setUpdateDelta(0) -end - -function update(dt) + bonusHandler=effect.addStatModifierGroup({{stat = "physicalResistance", amount = 0.15},{stat = "fallDamageMultiplier", effectiveMultiplier = 0.7}}) end function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/gfex_eeveesetbonus/flareon/flareonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/flareon/flareonsetbonus.lua index e1bcb05175f..2875f254441 100644 --- a/stats/effects/gfex_eeveesetbonus/flareon/flareonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/flareon/flareonsetbonus.lua @@ -1,10 +1,7 @@ function init() - effect.addStatModifierGroup({{stat = "iceResistance", amount = 0.15}, {stat = "biomecoldImmunity", amount = 1}}) - script.setUpdateDelta(0) -end - -function update(dt) + bonusHandler=effect.addStatModifierGroup({{stat = "iceResistance", amount = 0.15}, {stat = "biomecoldImmunity", amount = 1}}) end function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/gfex_eeveesetbonus/glaceon/glaceonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/glaceon/glaceonsetbonus.lua index 02c02ff4b46..6134a9fb375 100644 --- a/stats/effects/gfex_eeveesetbonus/glaceon/glaceonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/glaceon/glaceonsetbonus.lua @@ -1,10 +1,7 @@ function init() - effect.addStatModifierGroup({{stat = "poisonResistance", amount = 0.15}, {stat = "biomeheatImmunity", amount = 1}}) - script.setUpdateDelta(0) -end - -function update(dt) + bonusHandler=effect.addStatModifierGroup({{stat = "poisonResistance", amount = 0.15}, {stat = "biomeheatImmunity", amount = 1}}) end function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/gfex_eeveesetbonus/jolteon/jolteonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/jolteon/jolteonsetbonus.lua index c72442fa690..bc208231c3b 100644 --- a/stats/effects/gfex_eeveesetbonus/jolteon/jolteonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/jolteon/jolteonsetbonus.lua @@ -1,11 +1,7 @@ function init() - effect.addStatModifierGroup({{stat = "electricResistance", amount = 0.15}, {stat = "electricStatusImmunity", amount = 1}}) - - script.setUpdateDelta(0) -end - -function update(dt) + bonusHandler=effect.addStatModifierGroup({{stat = "electricResistance", amount = 0.15}, {stat = "electricStatusImmunity", amount = 1}}) end function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/gfex_eeveesetbonus/leafeon/leafeonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/leafeon/leafeonsetbonus.lua index dcee655e2ca..89982d3a719 100644 --- a/stats/effects/gfex_eeveesetbonus/leafeon/leafeonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/leafeon/leafeonsetbonus.lua @@ -1,10 +1,7 @@ function init() - effect.addStatModifierGroup({{stat = "tarStatusImmunity", amount = 1},{stat = "electricResistance", amount = 0.15}}) - script.setUpdateDelta(0) -end - -function update(dt) + bonusHandler=effect.addStatModifierGroup({{stat = "tarStatusImmunity", amount = 1},{stat = "electricResistance", amount = 0.15}}) end function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/gfex_eeveesetbonus/nucleon/nucleonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/nucleon/nucleonsetbonus.lua index 4ae9d54dc12..28975b7d19e 100644 --- a/stats/effects/gfex_eeveesetbonus/nucleon/nucleonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/nucleon/nucleonsetbonus.lua @@ -1,14 +1,7 @@ function init() - effect.addStatModifierGroup({ - {stat = "biomeradiationImmunity", amount = 1}, - {stat = "radioactiveResistance", amount = 0.15}, - {stat = "sulphuricImmunity", amount = 1} - }) - script.setUpdateDelta(0) -end - -function update(dt) + bonusHandler=effect.addStatModifierGroup({{stat = "biomeradiationImmunity", amount = 1},{stat = "radioactiveResistance", amount = 0.15},{stat = "sulphuricImmunity", amount = 1}}) end function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/gfex_eeveesetbonus/sylveon/sylveonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/sylveon/sylveonsetbonus.lua index b51b127d017..d71d7931e17 100644 --- a/stats/effects/gfex_eeveesetbonus/sylveon/sylveonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/sylveon/sylveonsetbonus.lua @@ -1,16 +1,27 @@ function init() - effect.addStatModifierGroup({{stat = "shadowResistance", amount = 0.15}}) - script.setUpdateDelta(5) - self.healingRate = 1.0 / 150 - effect.addStatModifierGroup({ - {stat = "energyRegenPercentageRate", amount = 10}, - {stat = "energyRegenBlockTime", effectiveMultiplier = 0} - }) + script.setUpdateDelta(5) + self.healingRate = 1.0 / 150 + bonusHandler=effect.addStatModifierGroup({ + {stat = "shadowResistance", amount = 0.15}, + --{stat = "energyRegenPercentageRate", amount = 10}, {stat = "energyRegenBlockTime", effectiveMultiplier = 0}--no. you don't get to have unlimited energy. + {stat = "energyRegenPercentageRate", baseMultiplier = 1.5 }, {stat = "energyRegenBlockTime", effectiveMultiplier = 0.9} --you get some FAIR values instead. + }) + bonusHandler2=effect.addStatModifierGroup({}) end function update(dt) - status.modifyResourcePercentage("health", self.healingRate * dt) + if (world.entityType(entity.id())=="player") or status.resource("health")>=1 then + effect.setStatModifierGroup(bonusHandler2,{{stat="healthRegen",amount=status.resourceMax("health")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) + else + effect.setStatModifierGroup(bonusHandler2,{}) + end end function uninit() + if bonusHandler then + effect.removeStatModifierGroup(bonusHandler) + end + if bonusHandler2 then + effect.removeStatModifierGroup(bonusHandler2) + end end diff --git a/stats/effects/gfex_eeveesetbonus/umbreon/umbreonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/umbreon/umbreonsetbonus.lua index 8854d28a346..f15b803b350 100644 --- a/stats/effects/gfex_eeveesetbonus/umbreon/umbreonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/umbreon/umbreonsetbonus.lua @@ -1,10 +1,11 @@ function init() - effect.addStatModifierGroup({{stat = "cosmicResistance", amount = 0.1}}) + bonusHandler=effect.addStatModifierGroup({{stat = "cosmicResistance", amount = 0.1}}) end function update(dt) - status.addEphemeralEffect("gfex_umbrethorns", 5) + status.addEphemeralEffect("gfex_umbrethorns", 5) end function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/gfex_eeveesetbonus/vaporeon/vaporeonsetbonus.lua b/stats/effects/gfex_eeveesetbonus/vaporeon/vaporeonsetbonus.lua index 42a4ee9477e..09186bc54ee 100644 --- a/stats/effects/gfex_eeveesetbonus/vaporeon/vaporeonsetbonus.lua +++ b/stats/effects/gfex_eeveesetbonus/vaporeon/vaporeonsetbonus.lua @@ -1,14 +1,12 @@ function init() - effect.addStatModifierGroup({ - {stat = "fireResistance", amount = 0.15}, - {stat = "wetImmunity", amount = 1}, - {stat = "maxBreath", amount = 1000} - }) - self.movementParameters = config.getParameter("movementParameters", {}) + bonusHandler=effect.addStatModifierGroup({{stat = "fireResistance", amount = 0.15},{stat = "wetImmunity", amount = 1},{stat = "maxBreath", amount = 1000}}) + --self.movementParameters = config.getParameter("movementParameters", {})--by itself this does nothing. you're supposed to add code for it in the update block. end -function update(dt) -end +--[[function update(dt) + +end]] function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/pandorasbox/pandorasboxenergybreak/pandorasboxenergybreak.lua b/stats/effects/pandorasbox/pandorasboxenergybreak/pandorasboxenergybreak.lua index 094cc870fe9..01997646180 100644 --- a/stats/effects/pandorasbox/pandorasboxenergybreak/pandorasboxenergybreak.lua +++ b/stats/effects/pandorasbox/pandorasboxenergybreak/pandorasboxenergybreak.lua @@ -1,17 +1,17 @@ -require "/scripts/status.lua" -require "/scripts/util.lua" -require "/scripts/interp.lua" - function init() + bonusHandler=effect.addStatModifierGroup({ + {stat = "energyRegenPercentageRate", effectiveMultiplier = 0}, + {stat = "energyRegenBlockTime", effectiveMultiplier = 0} + }) end function update(dt) -if status.overConsumeResource("energy", 0) then - status.setResourceLocked("energy", true); - status.setResourcePercentage("energy", 0); - effect.addStatModifierGroup({ - {stat = "energyRegenPercentageRate", effectiveMultiplier = 0}, - {stat = "energyRegenBlockTime", effectiveMultiplier = 0} - }) - end + if status.isResource("energy") then + status.setResourceLocked("energy", true) + status.setResourcePercentage("energy", 0) + end +end + +function uninit() + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/regeneration/darkregenfenerox.lua b/stats/effects/regeneration/darkregenfenerox.lua index cf2871a2a99..47ec688e11b 100644 --- a/stats/effects/regeneration/darkregenfenerox.lua +++ b/stats/effects/regeneration/darkregenfenerox.lua @@ -23,7 +23,6 @@ function update(dt) if nighttime or underground and (self.foodValue >= 45) then self.healingRate = 1.007 / config.getParameter("healTime", 220) - --status.modifyResourcePercentage("health", self.healingRate * dt) effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.stat("maxHealth")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) status.setPersistentEffects("feneroxEffects", { @@ -40,4 +39,4 @@ end function uninit() status.setPersistentEffects("feneroxEffects",{}) effect.removeStatModifierGroup(bonusHandler) -end \ No newline at end of file +end diff --git a/stats/effects/regeneration/indixregen.lua b/stats/effects/regeneration/indixregen.lua index 18ee7ddd06b..f12b7021c2d 100644 --- a/stats/effects/regeneration/indixregen.lua +++ b/stats/effects/regeneration/indixregen.lua @@ -1,5 +1,4 @@ function init() - --self.healingRate = 1.01 / config.getParameter("healTime", 180) self.healingRate = 1.0 / config.getParameter("healTime", 180) script.setUpdateDelta(10) bonusHandler=effect.addStatModifierGroup({}) @@ -7,10 +6,8 @@ end function update(dt) - --sb.logInfo("indixregen") if status.resourcePercentage("energy") >= 0.5 then effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=(status.resourceMax("health")*self.healingRate)*math.max(0,1+status.stat("healingBonus"))}}) - --status.modifyResourcePercentage("health", self.healingRate * dt) else effect.setStatModifierGroup(bonusHandler,{}) end diff --git a/stats/effects/regeneration/regen_healingwater.lua b/stats/effects/regeneration/regen_healingwater.lua index 6c9705cc12c..e9eb1ae73bc 100644 --- a/stats/effects/regeneration/regen_healingwater.lua +++ b/stats/effects/regeneration/regen_healingwater.lua @@ -26,7 +26,6 @@ end function update(dt) if (not self.didInit) or (not self.healingRate) then init() end - --sb.logInfo("regenhealingwater") if self.frEnabled and (self.species == "fragmentedruin") then self.tickTimer = self.tickTimer - dt if self.tickTimer <= 0 then @@ -41,8 +40,6 @@ function update(dt) effect.setParentDirectives(string.format("fade=00AA00=%.1f", self.tickTimer * 0.4)) else effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.resourceMax("health")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) - - --status.modifyResourcePercentage("health", self.healingRate * dt) end end @@ -51,4 +48,4 @@ function uninit() if bonusHandler then effect.removeStatModifierGroup(bonusHandler) end -end \ No newline at end of file +end diff --git a/stats/effects/regeneration/regeneration.lua b/stats/effects/regeneration/regeneration.lua index ba89c5ae2ab..ea5d908ada9 100644 --- a/stats/effects/regeneration/regeneration.lua +++ b/stats/effects/regeneration/regeneration.lua @@ -9,7 +9,6 @@ function init() end function update(dt) - --status.modifyResourcePercentage("health", self.healingRate * dt) if (world.entityType(entity.id())=="player") or status.resource("health")>=1 then effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.resourceMax("health")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) else diff --git a/stats/effects/regeneration/regenerationaugment.lua b/stats/effects/regeneration/regenerationaugment.lua new file mode 100644 index 00000000000..820a6eac0f3 --- /dev/null +++ b/stats/effects/regeneration/regenerationaugment.lua @@ -0,0 +1,17 @@ +function init() + script.setUpdateDelta(5) + self.healingRate = 1.0 / config.getParameter("healTime", 60) + bonusHandler=effect.addStatModifierGroup({}) +end + +function update(dt) + if (world.entityType(entity.id())=="player") or status.resource("health")>=1 then + effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.resourceMax("health")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) + else + effect.setStatModifierGroup(bonusHandler,{}) + end +end + +function uninit() + effect.removeStatModifierGroup(bonusHandler) +end diff --git a/stats/effects/regeneration/regenerationpsionic.lua b/stats/effects/regeneration/regenerationpsionic.lua index 1610481ee08..a7c7f35992e 100644 --- a/stats/effects/regeneration/regenerationpsionic.lua +++ b/stats/effects/regeneration/regenerationpsionic.lua @@ -1,28 +1,28 @@ function init() - animator.setParticleEmitterOffsetRegion("healing", mcontroller.boundBox()) - animator.setParticleEmitterActive("healing", config.getParameter("particles", true)) + animator.setParticleEmitterOffsetRegion("healing", mcontroller.boundBox()) + animator.setParticleEmitterActive("healing", config.getParameter("particles", true)) - script.setUpdateDelta(5) + script.setUpdateDelta(5) - self.healingRate = 1.0 / config.getParameter("healTime", 60) - self.energyCost = config.getParameter("energyCost") + self.healingRate = 1.0 / config.getParameter("healTime", 60) + self.energyCost = config.getParameter("energyCost") - effect.addStatModifierGroup({ - {stat = "mentalProtection", amount = 0.25}, - {stat = "energyRegenPercentageRate", effectiveMultiplier = 0}, - {stat = "energyRegenBlockTime", effectiveMultiplier = 0}, - {stat = "shieldStaminaRegen", effectiveMultiplier = 0} - }) + bonusHandler=effect.addStatModifierGroup({ + {stat = "mentalProtection", amount = 0.25}, + {stat = "energyRegenPercentageRate", effectiveMultiplier = 0}, + {stat = "energyRegenBlockTime", effectiveMultiplier = 0}, + {stat = "shieldStaminaRegen", effectiveMultiplier = 0} + }) end function update(dt) - if status.overConsumeResource("energy", self.energyCost) then - status.modifyResourcePercentage("health", self.healingRate * dt * math.max(0,1+status.stat("healingBonus"))) - status.modifyResourcePercentage("energy", (-self.energyCost)) - end + if status.overConsumeResource("energy", self.energyCost) then + status.modifyResourcePercentage("health", self.healingRate * dt * math.max(0,1+status.stat("healingBonus"))) + status.modifyResourcePercentage("energy", (-self.energyCost)) + end end function uninit() - + effect.removeStatModifierGroup(bonusHandler) end diff --git a/stats/effects/slimeslow/slimeslow.lua b/stats/effects/slimeslow/slimeslow.lua index faf0bb08f31..98a8ee43080 100644 --- a/stats/effects/slimeslow/slimeslow.lua +++ b/stats/effects/slimeslow/slimeslow.lua @@ -14,9 +14,7 @@ function update(dt) if self.frEnabled and (self.species == "slimeperson") then self.healingRate = 0.025 - --status.modifyResourcePercentage("health", self.healingRate * dt) effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.stat("maxHealth")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) - --sb.logInfo("slimeslow") mcontroller.controlModifiers({ groundMovementModifier = 0.9, speedModifier = 0.9, @@ -34,4 +32,4 @@ function uninit() if bonusHandler then effect.removeStatModifierGroup(bonusHandler) end -end \ No newline at end of file +end diff --git a/stats/effects/tarslow/tarslow.lua b/stats/effects/tarslow/tarslow.lua index 8b6c1923c8a..87f40fa6630 100644 --- a/stats/effects/tarslow/tarslow.lua +++ b/stats/effects/tarslow/tarslow.lua @@ -21,9 +21,6 @@ function update(dt) if self.frEnabled and (self.species == "glitch") then self.healingRate = 0.015 effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.stat("maxHealth")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) - --status.modifyResourcePercentage("health", self.healingRate * dt) - - --sb.logInfo("tarslow") mcontroller.controlModifiers({ groundMovementModifier = 1, speedModifier = 1, @@ -47,4 +44,4 @@ function uninit() if baseHandler then effect.removeStatModifierGroup(baseHandler) end -end \ No newline at end of file +end diff --git a/stats/effects/wet/wet.lua b/stats/effects/wet/wet.lua index 2ce9fba1662..6634704c5e8 100644 --- a/stats/effects/wet/wet.lua +++ b/stats/effects/wet/wet.lua @@ -22,7 +22,6 @@ function update(dt) if self.frEnabled and (self.species == "hylotl") then self.foodRate = 0.001 if status.isResource("food") then - --sb.logInfo("wet") status.modifyResourcePercentage("food", self.foodRate * dt) end end @@ -30,7 +29,6 @@ function update(dt) self.healingRate = 0.001 self.foodRate = 0.001 effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.stat("maxHealth")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) - --status.modifyResourcePercentage("health", self.healingRate * dt) if status.isResource("food") then status.modifyResourcePercentage("food", self.foodRate * dt) end diff --git a/tech/jump/boostedjump.lua b/tech/jump/boostedjump.lua index 91075d4e1aa..2e92f5baf6d 100644 --- a/tech/jump/boostedjump.lua +++ b/tech/jump/boostedjump.lua @@ -7,9 +7,6 @@ end function applyTechBonus() self.jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor - if not self.jumpBonus then - self.jumpBonus = 1 - end end function update(args) diff --git a/tech/jump/fumultijump.lua b/tech/jump/fumultijump.lua index acd99d4808c..6ef8a772bb7 100644 --- a/tech/jump/fumultijump.lua +++ b/tech/jump/fumultijump.lua @@ -1,59 +1,54 @@ function init() - self.multiJumpCount = config.getParameter("multiJumpCount") - self.multiJumpModifier = config.getParameter("multiJumpModifier") - refreshJumps() -end - -function applyTechBonus() - self.jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor + self.multiJumpCount = config.getParameter("multiJumpCount") + self.multiJumpModifier = config.getParameter("multiJumpModifier") + refreshJumps() end function update(args) - applyTechBonus() - local jumpActivated = args.moves["jump"] and not self.lastJump - self.lastJump = args.moves["jump"] - updateJumpModifier() - if jumpActivated and canMultiJump() then - doMultiJump() - else - if mcontroller.groundMovement() or mcontroller.liquidMovement() then - refreshJumps() - end - end + local jumpActivated = args.moves["jump"] and not self.lastJump + self.lastJump = args.moves["jump"] + updateJumpModifier() + if jumpActivated and canMultiJump() then + doMultiJump() + else + if mcontroller.groundMovement() or mcontroller.liquidMovement() then + refreshJumps() + end + end end -- after the original ground jump has finished, start applying the new jump modifier function updateJumpModifier() - if self.multiJumpModifier then - if not self.applyJumpModifier - and not mcontroller.jumping() - and not mcontroller.groundMovement() then - self.applyJumpModifier = true - end - if self.applyJumpModifier then - mcontroller.controlModifiers({airJumpModifier = self.multiJumpModifier * self.jumpBonus}) - end - end + if self.multiJumpModifier then + if not self.applyJumpModifier + and not mcontroller.jumping() + and not mcontroller.groundMovement() then + self.applyJumpModifier = true + end + if self.applyJumpModifier then + mcontroller.controlModifiers({airJumpModifier = self.multiJumpModifier * (1 + status.stat("jumptechBonus"))}) + end + end end function canMultiJump() - return self.multiJumps > 0 - and not mcontroller.jumping() - and not mcontroller.canJump() - and not mcontroller.liquidMovement() - and not status.statPositive("activeMovementAbilities") - and math.abs(world.gravity(mcontroller.position())) > 0 + return self.multiJumps > 0 + and not mcontroller.jumping() + and not mcontroller.canJump() + and not mcontroller.liquidMovement() + and not status.statPositive("activeMovementAbilities") + and math.abs(world.gravity(mcontroller.position())) > 0 end function doMultiJump() - mcontroller.controlJump(true) - mcontroller.setYVelocity(math.max(0, mcontroller.yVelocity())) - self.multiJumps = self.multiJumps - 1 - animator.burstParticleEmitter("multiJumpParticles") - animator.playSound("multiJumpSound") + mcontroller.controlJump(true) + mcontroller.setYVelocity(math.max(0, mcontroller.yVelocity())) + self.multiJumps = self.multiJumps - 1 + animator.burstParticleEmitter("multiJumpParticles") + animator.playSound("multiJumpSound") end function refreshJumps() - self.multiJumps = self.multiJumpCount - self.applyJumpModifier = false + self.multiJumps = self.multiJumpCount + self.applyJumpModifier = false end diff --git a/tech/jump/fuwalljump.lua b/tech/jump/fuwalljump.lua index 068e76e3e56..abc092615c8 100644 --- a/tech/jump/fuwalljump.lua +++ b/tech/jump/fuwalljump.lua @@ -2,138 +2,141 @@ require "/tech/jump/multijump.lua" require "/scripts/vec2.lua" require "/scripts/poly.lua" -function init() - self.multiJumpCount = config.getParameter("multiJumpCount") - self.multiJumpModifier = config.getParameter("multiJumpModifier") - - self.wallSlideParameters = config.getParameter("wallSlideParameters") - self.wallJumpXVelocity = config.getParameter("wallJumpXVelocity") - self.wallGrabFreezeTime = config.getParameter("wallGrabFreezeTime") - self.wallGrabFreezeTimer = 0 - self.wallReleaseTime = config.getParameter("wallReleaseTime") - self.wallReleaseTimer = 0 - - buildSensors() - self.wallDetectThreshold = config.getParameter("wallDetectThreshold") - self.wallCollisionSet = {"Dynamic", "Block"} - - refreshJumps() - releaseWall() +local oldRefreshJumps=refreshJumps + +function refreshJumps() + oldRefreshJumps() + local jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor + self.multiJumpCount = self.initialMultiJumpCount * jumpBonus + self.wallJumpXVelocity = self.initialWallJumpXVelocity * jumpBonus end -function uninit() - releaseWall() +function init() + self.initialMultiJumpCount = config.getParameter("multiJumpCount") + self.multiJumpModifier = config.getParameter("multiJumpModifier") + + self.wallSlideParameters = config.getParameter("wallSlideParameters") + self.wallJumpXVelocity = config.getParameter("wallJumpXVelocity") + self.initialWallJumpXVelocity = config.getParameter("wallJumpXVelocity") + self.wallGrabFreezeTime = config.getParameter("wallGrabFreezeTime") + self.wallGrabFreezeTimer = 0 + self.wallReleaseTime = config.getParameter("wallReleaseTime") + self.wallReleaseTimer = 0 + + buildSensors() + self.wallDetectThreshold = config.getParameter("wallDetectThreshold") + self.wallCollisionSet = {"Dynamic", "Block"} + + refreshJumps() + releaseWall() end -function applyTechBonus() - self.jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor - self.multiJumpCount = config.getParameter("multiJumpCount") * self.jumpBonus - self.wallJumpXVelocity = config.getParameter("wallJumpXVelocity") * self.jumpBonus +function uninit() + releaseWall() end function update(args) - applyTechBonus() - local jumpActivated = args.moves["jump"] and not self.lastJump - self.lastJump = args.moves["jump"] - - updateJumpModifier() - - local lrInput - if args.moves["left"] and not args.moves["right"] then - lrInput = "left" - elseif args.moves["right"] and not args.moves["left"] then - lrInput = "right" - end - - if mcontroller.groundMovement() or mcontroller.liquidMovement() then - refreshJumps() - if self.wall then - releaseWall() - end - elseif self.wall then - mcontroller.controlParameters(self.wallSlideParameters) - - if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then - releaseWall() - elseif jumpActivated then - doWallJump() - else - if lrInput and lrInput ~= self.wall then - self.wallReleaseTimer = self.wallReleaseTimer + args.dt - else - self.wallReleaseTimer = 0 - end - - if self.wallReleaseTimer > self.wallReleaseTime then - releaseWall() - else - mcontroller.controlFace(self.wall == "left" and 1 or -1) - if self.wallGrabFreezeTimer > 0 then - self.wallGrabFreezeTimer = math.max(0, self.wallGrabFreezeTimer - args.dt) - mcontroller.controlApproachVelocity({0, 0}, 1000) - if self.wallGrabFreezeTimer == 0 then - animator.setParticleEmitterActive("wallSlide."..self.wall, true) - animator.playSound("wallSlideLoop", -1) - end - end - end - end - elseif not status.statPositive("activeMovementAbilities") then - if lrInput and not mcontroller.jumping() and checkWall(lrInput) then - grabWall(lrInput) - elseif jumpActivated and canMultiJump() then - doMultiJump() - end - end + local jumpActivated = args.moves["jump"] and not self.lastJump + self.lastJump = args.moves["jump"] + + updateJumpModifier() + + local lrInput + if args.moves["left"] and not args.moves["right"] then + lrInput = "left" + elseif args.moves["right"] and not args.moves["left"] then + lrInput = "right" + end + + if mcontroller.groundMovement() or mcontroller.liquidMovement() then + refreshJumps() + if self.wall then + releaseWall() + end + elseif self.wall then + mcontroller.controlParameters(self.wallSlideParameters) + + if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then + releaseWall() + elseif jumpActivated then + doWallJump() + else + if lrInput and lrInput ~= self.wall then + self.wallReleaseTimer = self.wallReleaseTimer + args.dt + else + self.wallReleaseTimer = 0 + end + + if self.wallReleaseTimer > self.wallReleaseTime then + releaseWall() + else + mcontroller.controlFace(self.wall == "left" and 1 or -1) + if self.wallGrabFreezeTimer > 0 then + self.wallGrabFreezeTimer = math.max(0, self.wallGrabFreezeTimer - args.dt) + mcontroller.controlApproachVelocity({0, 0}, 1000) + if self.wallGrabFreezeTimer == 0 then + animator.setParticleEmitterActive("wallSlide."..self.wall, true) + animator.playSound("wallSlideLoop", -1) + end + end + end + end + elseif not status.statPositive("activeMovementAbilities") then + if lrInput and not mcontroller.jumping() and checkWall(lrInput) then + grabWall(lrInput) + elseif jumpActivated and canMultiJump() then + doMultiJump() + end + end end function buildSensors() - local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) - self.wallSensors = { - right = {}, - left = {} - } - for _, offset in pairs(config.getParameter("wallSensors")) do - table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) - table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) - end + local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) + self.wallSensors = { + right = {}, + left = {} + } + for _, offset in pairs(config.getParameter("wallSensors")) do + table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) + table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) + end end function checkWall(wall) - local pos = mcontroller.position() - local wallCheck = 0 - for _, offset in pairs(self.wallSensors[wall]) do - -- world.debugPoint(vec2.add(pos, offset), world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) and "yellow" or "blue") - if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then - wallCheck = wallCheck + 1 - end - end - return wallCheck >= self.wallDetectThreshold + local pos = mcontroller.position() + local wallCheck = 0 + for _, offset in pairs(self.wallSensors[wall]) do + -- world.debugPoint(vec2.add(pos, offset), world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) and "yellow" or "blue") + if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then + wallCheck = wallCheck + 1 + end + end + return wallCheck >= self.wallDetectThreshold end function doWallJump() - mcontroller.controlJump(true) - animator.playSound("wallJumpSound") - animator.burstParticleEmitter("wallJump."..self.wall) - mcontroller.setXVelocity(self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity) - releaseWall() + mcontroller.controlJump(true) + animator.playSound("wallJumpSound") + animator.burstParticleEmitter("wallJump."..self.wall) + mcontroller.setXVelocity(self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity) + releaseWall() end function grabWall(wall) - self.wall = wall - self.wallGrabFreezeTimer = self.wallGrabFreezeTime - self.wallReleaseTimer = 0 - mcontroller.setVelocity({0, 0}) - tech.setToolUsageSuppressed(true) - tech.setParentState("fly") - animator.playSound("wallGrab") + self.wall = wall + self.wallGrabFreezeTimer = self.wallGrabFreezeTime + self.wallReleaseTimer = 0 + mcontroller.setVelocity({0, 0}) + tech.setToolUsageSuppressed(true) + tech.setParentState("fly") + animator.playSound("wallGrab") end function releaseWall() - self.wall = nil - tech.setToolUsageSuppressed(false) - tech.setParentState() - animator.setParticleEmitterActive("wallSlide.left", false) - animator.setParticleEmitterActive("wallSlide.right", false) - animator.stopAllSounds("wallSlideLoop") + self.wall = nil + tech.setToolUsageSuppressed(false) + tech.setParentState() + animator.setParticleEmitterActive("wallSlide.left", false) + animator.setParticleEmitterActive("wallSlide.right", false) + animator.stopAllSounds("wallSlideLoop") end diff --git a/tech/jump/gravityjump.lua b/tech/jump/gravityjump.lua index 7a6197d711d..074b22ace80 100644 --- a/tech/jump/gravityjump.lua +++ b/tech/jump/gravityjump.lua @@ -37,12 +37,12 @@ function uninit() stopAbility(nil) end -function applyTechBonus() +--[[function applyTechBonus()--the stat isnt actually used for anything at all. self.jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor -end +end]] function update(args) - applyTechBonus() + --applyTechBonus() self.disabled = disabled(args) if not self.disabled and args.moves["jump"] and canAbility(args) then if not self.doingAbility then diff --git a/tech/jump/longjump.lua b/tech/jump/longjump.lua index 0b8e8466bea..8e3af201d2b 100644 --- a/tech/jump/longjump.lua +++ b/tech/jump/longjump.lua @@ -29,12 +29,7 @@ function init() releaseWall() end -function applyTechBonus() - self.jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor -end - function update(args) - applyTechBonus() if not disabled(args) and args.moves["jump"] and canAbility(args) then if not self.doingAbility then self.doingAbility = true @@ -58,55 +53,54 @@ function update(args) end end - if not disabled(args) then updateAlways(args) + if not disabled(args) then updateAlways(args) end + + local jumpActivated = args.moves["jump"] and not self.lastJumpKey + self.lastJumpKey = args.moves["jump"] + local lrInput + if args.moves["left"] and not args.moves["right"] then + lrInput = "left" + elseif args.moves["right"] and not args.moves["left"] then + lrInput = "right" end - local jumpActivated = args.moves["jump"] and not self.lastJumpKey - self.lastJumpKey = args.moves["jump"] - local lrInput - if args.moves["left"] and not args.moves["right"] then - lrInput = "left" - elseif args.moves["right"] and not args.moves["left"] then - lrInput = "right" - end - - if mcontroller.groundMovement() or mcontroller.liquidMovement() then - if self.wall then - releaseWall() - end - elseif self.wall then - mcontroller.controlParameters(self.wallSlideParameters) - - if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then - releaseWall() - elseif jumpActivated then - doWallJump() - else - if lrInput and lrInput ~= self.wall then - self.wallReleaseTimer = self.wallReleaseTimer + args.dt - else - self.wallReleaseTimer = 0 - end - - if self.wallReleaseTimer > self.wallReleaseTime then - releaseWall() - else - mcontroller.controlFace(self.wall == "left" and 1 or -1) - if self.wallGrabFreezeTimer > 0 then - self.wallGrabFreezeTimer = math.max(0, self.wallGrabFreezeTimer - args.dt) - mcontroller.controlApproachVelocity({0, 0}, 1000) - if self.wallGrabFreezeTimer == 0 then - animator.setParticleEmitterActive("wallSlide."..self.wall, true) - animator.playSound("wallSlideLoop", -1) - end - end - end - end - elseif not status.statPositive("activeMovementAbilities") then - if lrInput and not mcontroller.jumping() and checkWall(lrInput) then - grabWall(lrInput) - end - end + if mcontroller.groundMovement() or mcontroller.liquidMovement() then + if self.wall then + releaseWall() + end + elseif self.wall then + mcontroller.controlParameters(self.wallSlideParameters) + + if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then + releaseWall() + elseif jumpActivated then + doWallJump() + else + if lrInput and lrInput ~= self.wall then + self.wallReleaseTimer = self.wallReleaseTimer + args.dt + else + self.wallReleaseTimer = 0 + end + + if self.wallReleaseTimer > self.wallReleaseTime then + releaseWall() + else + mcontroller.controlFace(self.wall == "left" and 1 or -1) + if self.wallGrabFreezeTimer > 0 then + self.wallGrabFreezeTimer = math.max(0, self.wallGrabFreezeTimer - args.dt) + mcontroller.controlApproachVelocity({0, 0}, 1000) + if self.wallGrabFreezeTimer == 0 then + animator.setParticleEmitterActive("wallSlide."..self.wall, true) + animator.playSound("wallSlideLoop", -1) + end + end + end + end + elseif not status.statPositive("activeMovementAbilities") then + if lrInput and not mcontroller.jumping() and checkWall(lrInput) then + grabWall(lrInput) + end + end end function disabled(args) @@ -130,20 +124,18 @@ function landed(args) end function startAbility(args) - self.doingAbility = false + self.doingAbility = false end -function stopAbility(args) - -end +function stopAbility(args) end function updateAbility(args) - self.doingAbility = false + self.doingAbility = false end function updateJumping(args) local params = mcontroller.baseParameters() - params.airJumpProfile.jumpSpeed = (params.airJumpProfile.jumpSpeed * self.jumpSpeedMultiplier) * self.jumpBonus + params.airJumpProfile.jumpSpeed = (params.airJumpProfile.jumpSpeed * self.jumpSpeedMultiplier) * (1 + status.stat("jumptechBonus")) mcontroller.controlParameters(params) end @@ -159,54 +151,54 @@ function updateAlways(args) end function buildSensors() - local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) - self.wallSensors = { - right = {}, - left = {} - } - for _, offset in pairs(config.getParameter("wallSensors")) do - table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) - table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) - end + local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) + self.wallSensors = { + right = {}, + left = {} + } + for _, offset in pairs(config.getParameter("wallSensors")) do + table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) + table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) + end end function checkWall(wall) - local pos = mcontroller.position() - local wallCheck = 0 - for _, offset in pairs(self.wallSensors[wall]) do - -- world.debugPoint(vec2.add(pos, offset), world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) and "yellow" or "blue") - if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then - wallCheck = wallCheck + 1 - end - end - return wallCheck >= self.wallDetectThreshold + local pos = mcontroller.position() + local wallCheck = 0 + for _, offset in pairs(self.wallSensors[wall]) do + -- world.debugPoint(vec2.add(pos, offset), world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) and "yellow" or "blue") + if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then + wallCheck = wallCheck + 1 + end + end + return wallCheck >= self.wallDetectThreshold end function doWallJump() - mcontroller.controlJump(true) - animator.playSound("wallJumpSound") - animator.burstParticleEmitter("wallJump."..self.wall) - mcontroller.setXVelocity(self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity) - releaseWall() + mcontroller.controlJump(true) + animator.playSound("wallJumpSound") + animator.burstParticleEmitter("wallJump."..self.wall) + mcontroller.setXVelocity(self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity) + releaseWall() end function grabWall(wall) - self.doingAbility = false - stopAbility(nil) - self.wall = wall - self.wallGrabFreezeTimer = self.wallGrabFreezeTime - self.wallReleaseTimer = 0 - mcontroller.setVelocity({0, 0}) - --tech.setToolUsageSuppressed(true) - tech.setParentState("fly") - animator.playSound("wallGrab") + self.doingAbility = false + stopAbility(nil) + self.wall = wall + self.wallGrabFreezeTimer = self.wallGrabFreezeTime + self.wallReleaseTimer = 0 + mcontroller.setVelocity({0, 0}) + --tech.setToolUsageSuppressed(true) + tech.setParentState("fly") + animator.playSound("wallGrab") end function releaseWall() - self.wall = nil - --tech.setToolUsageSuppressed(false) - tech.setParentState() - animator.setParticleEmitterActive("wallSlide.left", false) - animator.setParticleEmitterActive("wallSlide.right", false) - animator.stopAllSounds("wallSlideLoop") + self.wall = nil + --tech.setToolUsageSuppressed(false) + tech.setParentState() + animator.setParticleEmitterActive("wallSlide.left", false) + animator.setParticleEmitterActive("wallSlide.right", false) + animator.stopAllSounds("wallSlideLoop") end diff --git a/tech/jump/longjump2.lua b/tech/jump/longjump2.lua index a88720323af..47d8ae88f5f 100644 --- a/tech/jump/longjump2.lua +++ b/tech/jump/longjump2.lua @@ -29,12 +29,7 @@ function init() releaseWall() end -function applyTechBonus() - self.jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor -end - function update(args) - applyTechBonus() if not disabled(args) and args.moves["jump"] and canAbility(args) then if not self.doingAbility then self.doingAbility = true @@ -61,52 +56,52 @@ function update(args) if not disabled(args) then updateAlways(args) end - local jumpActivated = args.moves["jump"] and not self.lastJumpKey - self.lastJumpKey = args.moves["jump"] - local lrInput - if args.moves["left"] and not args.moves["right"] then - lrInput = "left" - elseif args.moves["right"] and not args.moves["left"] then - lrInput = "right" - end - - if mcontroller.groundMovement() or mcontroller.liquidMovement() then - if self.wall then - releaseWall() - end - elseif self.wall then - mcontroller.controlParameters(self.wallSlideParameters) - - if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then - releaseWall() - elseif jumpActivated then - doWallJump() - else - if lrInput and lrInput ~= self.wall then - self.wallReleaseTimer = self.wallReleaseTimer + args.dt - else - self.wallReleaseTimer = 0 - end - - if self.wallReleaseTimer > self.wallReleaseTime then - releaseWall() - else - mcontroller.controlFace(self.wall == "left" and 1 or -1) - if self.wallGrabFreezeTimer > 0 then - self.wallGrabFreezeTimer = math.max(0, self.wallGrabFreezeTimer - args.dt) - mcontroller.controlApproachVelocity({0, 0}, 1000) - if self.wallGrabFreezeTimer == 0 then - animator.setParticleEmitterActive("wallSlide."..self.wall, true) - animator.playSound("wallSlideLoop", -1) - end - end - end - end - elseif not status.statPositive("activeMovementAbilities") then - if lrInput and not mcontroller.jumping() and checkWall(lrInput) then - grabWall(lrInput) - end - end + local jumpActivated = args.moves["jump"] and not self.lastJumpKey + self.lastJumpKey = args.moves["jump"] + local lrInput + if args.moves["left"] and not args.moves["right"] then + lrInput = "left" + elseif args.moves["right"] and not args.moves["left"] then + lrInput = "right" + end + + if mcontroller.groundMovement() or mcontroller.liquidMovement() then + if self.wall then + releaseWall() + end + elseif self.wall then + mcontroller.controlParameters(self.wallSlideParameters) + + if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then + releaseWall() + elseif jumpActivated then + doWallJump() + else + if lrInput and lrInput ~= self.wall then + self.wallReleaseTimer = self.wallReleaseTimer + args.dt + else + self.wallReleaseTimer = 0 + end + + if self.wallReleaseTimer > self.wallReleaseTime then + releaseWall() + else + mcontroller.controlFace(self.wall == "left" and 1 or -1) + if self.wallGrabFreezeTimer > 0 then + self.wallGrabFreezeTimer = math.max(0, self.wallGrabFreezeTimer - args.dt) + mcontroller.controlApproachVelocity({0, 0}, 1000) + if self.wallGrabFreezeTimer == 0 then + animator.setParticleEmitterActive("wallSlide."..self.wall, true) + animator.playSound("wallSlideLoop", -1) + end + end + end + end + elseif not status.statPositive("activeMovementAbilities") then + if lrInput and not mcontroller.jumping() and checkWall(lrInput) then + grabWall(lrInput) + end + end end function disabled(args) @@ -164,7 +159,7 @@ end function updateJumping(args) local params = mcontroller.baseParameters() - params.airJumpProfile.jumpSpeed = (params.airJumpProfile.jumpSpeed * self.jumpSpeedMultiplier) * self.jumpBonus + params.airJumpProfile.jumpSpeed = (params.airJumpProfile.jumpSpeed * self.jumpSpeedMultiplier) * (1 + status.stat("jumptechBonus")) mcontroller.controlParameters(params) end @@ -182,54 +177,54 @@ function updateAlways(args) end function buildSensors() - local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) - self.wallSensors = { - right = {}, - left = {} - } - for _, offset in pairs(config.getParameter("wallSensors")) do - table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) - table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) - end + local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) + self.wallSensors = { + right = {}, + left = {} + } + for _, offset in pairs(config.getParameter("wallSensors")) do + table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) + table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) + end end function checkWall(wall) - local pos = mcontroller.position() - local wallCheck = 0 - for _, offset in pairs(self.wallSensors[wall]) do - -- world.debugPoint(vec2.add(pos, offset), world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) and "yellow" or "blue") - if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then - wallCheck = wallCheck + 1 - end - end - return wallCheck >= self.wallDetectThreshold + local pos = mcontroller.position() + local wallCheck = 0 + for _, offset in pairs(self.wallSensors[wall]) do + -- world.debugPoint(vec2.add(pos, offset), world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) and "yellow" or "blue") + if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then + wallCheck = wallCheck + 1 + end + end + return wallCheck >= self.wallDetectThreshold end function doWallJump() - mcontroller.controlJump(true) - animator.playSound("wallJumpSound") - animator.burstParticleEmitter("wallJump."..self.wall) - mcontroller.setXVelocity(self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity) - releaseWall() + mcontroller.controlJump(true) + animator.playSound("wallJumpSound") + animator.burstParticleEmitter("wallJump."..self.wall) + mcontroller.setXVelocity(self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity) + releaseWall() end function grabWall(wall) - self.doingAbility = false - stopAbility(nil) - self.wall = wall - self.wallGrabFreezeTimer = self.wallGrabFreezeTime - self.wallReleaseTimer = 0 - mcontroller.setVelocity({0, 0}) - --tech.setToolUsageSuppressed(true) - tech.setParentState("fly") - animator.playSound("wallGrab") + self.doingAbility = false + stopAbility(nil) + self.wall = wall + self.wallGrabFreezeTimer = self.wallGrabFreezeTime + self.wallReleaseTimer = 0 + mcontroller.setVelocity({0, 0}) + --tech.setToolUsageSuppressed(true) + tech.setParentState("fly") + animator.playSound("wallGrab") end function releaseWall() - self.wall = nil - --tech.setToolUsageSuppressed(false) - tech.setParentState() - animator.setParticleEmitterActive("wallSlide.left", false) - animator.setParticleEmitterActive("wallSlide.right", false) - animator.stopAllSounds("wallSlideLoop") + self.wall = nil + --tech.setToolUsageSuppressed(false) + tech.setParentState() + animator.setParticleEmitterActive("wallSlide.left", false) + animator.setParticleEmitterActive("wallSlide.right", false) + animator.stopAllSounds("wallSlideLoop") end diff --git a/tech/jump/wallcling.lua b/tech/jump/wallcling.lua index 30eb6f8e7d9..54167ecbc48 100644 --- a/tech/jump/wallcling.lua +++ b/tech/jump/wallcling.lua @@ -2,146 +2,148 @@ require "/tech/jump/multijump.lua" require "/scripts/vec2.lua" require "/scripts/poly.lua" -function init() - self.energyCost = config.getParameter("energyCost") - self.multiJumpCount = config.getParameter("multiJumpCount") - self.multiJumpModifier = config.getParameter("multiJumpModifier") - - self.wallSlideParameters = config.getParameter("wallSlideParameters") - self.wallJumpXVelocity = config.getParameter("wallJumpXVelocity") - self.wallJumpYVelocity = config.getParameter("wallJumpYVelocity") - self.wallGrabFreezeTime = config.getParameter("wallGrabFreezeTime") - self.wallGrabIsTriangle = config.getParameter("wallGrabIsTriangle") - self.wallGrabFreezeTimer = 0 - self.wallReleaseTime = config.getParameter("wallReleaseTime") - self.wallReleaseTimer = 0 - - buildSensors() - self.wallDetectThreshold = config.getParameter("wallDetectThreshold") - self.wallCollisionSet = {"Dynamic", "Block"} - - refreshJumps() - releaseWall() +local oldRefreshJumps=refreshJumps + +function refreshJumps() + oldRefreshJumps() + local jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor + self.wallJumpXVelocity = self.initialWallJumpXVelocity * (jumpBonus) + self.wallJumpYVelocity = self.initialWallJumpYVelocity * (jumpBonus) + self.wallGrabFreezeTime = self.initialWallGrabFreezeTime * (jumpBonus) end -function uninit() - releaseWall() +function init() + self.energyCost = config.getParameter("energyCost") + self.multiJumpCount = config.getParameter("multiJumpCount") + self.multiJumpModifier = config.getParameter("multiJumpModifier") + + self.wallSlideParameters = config.getParameter("wallSlideParameters") + self.initialWallJumpXVelocity = config.getParameter("wallJumpXVelocity") + self.initialWallJumpYVelocity = config.getParameter("wallJumpYVelocity") + self.initialWallGrabFreezeTime = config.getParameter("wallGrabFreezeTime") + self.wallGrabIsTriangle = config.getParameter("wallGrabIsTriangle") + self.wallGrabFreezeTimer = 0 + self.wallReleaseTime = config.getParameter("wallReleaseTime") + self.wallReleaseTimer = 0 + + buildSensors() + self.wallDetectThreshold = config.getParameter("wallDetectThreshold") + self.wallCollisionSet = {"Dynamic", "Block"} + + refreshJumps() + releaseWall() end -function applyTechBonus() - self.jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor - self.wallJumpXVelocity = config.getParameter("wallJumpXVelocity") * (self.jumpBonus) - self.wallJumpYVelocity = config.getParameter("wallJumpYVelocity") * (self.jumpBonus) - self.wallGrabFreezeTime = config.getParameter("wallGrabFreezeTime") * (self.jumpBonus) +function uninit() + releaseWall() end function update(args) - applyTechBonus() - local jumpActivated = args.moves["jump"] and not self.lastJump - self.lastJump = args.moves["jump"] - - updateJumpModifier() - - local lrInput - if args.moves["left"] and not args.moves["right"] then - lrInput = "left" - elseif args.moves["right"] and not args.moves["left"] then - lrInput = "right" - end - - if mcontroller.groundMovement() or mcontroller.liquidMovement() then - refreshJumps() - if self.wall then - releaseWall() - end - elseif self.wall then - refreshJumps() - mcontroller.controlParameters(self.wallSlideParameters) - - if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then - releaseWall() - elseif jumpActivated and status.overConsumeResource("energy", self.energyCost) then - doWallJump() - animator.playSound("wallJumpSound") - else - if lrInput and lrInput ~= self.wall then - self.wallReleaseTimer = self.wallReleaseTimer + args.dt - else - self.wallReleaseTimer = 0 - end - - if self.wallReleaseTimer > self.wallReleaseTime then - releaseWall() - else - mcontroller.controlFace(self.wall == "left" and 1 or -1) - if self.wallGrabFreezeTimer > 0 then - self.wallGrabFreezeTimer = math.max(0, self.wallGrabFreezeTimer - args.dt) - mcontroller.controlApproachVelocity({0, 0}, 1000) - if self.wallGrabFreezeTimer == 0 then - animator.setParticleEmitterActive("wallSlide."..self.wall, true) - animator.playSound("wallSlideLoop", -1) - end - end - end - end - elseif not status.statPositive("activeMovementAbilities") then - if lrInput and not mcontroller.jumping() and checkWall(lrInput) then - grabWall(lrInput) - elseif jumpActivated and canMultiJump() then - doMultiJump() - end - end + local jumpActivated = args.moves["jump"] and not self.lastJump + self.lastJump = args.moves["jump"] + + updateJumpModifier() + + local lrInput + if args.moves["left"] and not args.moves["right"] then + lrInput = "left" + elseif args.moves["right"] and not args.moves["left"] then + lrInput = "right" + end + + if mcontroller.groundMovement() or mcontroller.liquidMovement() then + refreshJumps() + if self.wall then + releaseWall() + end + elseif self.wall then + refreshJumps() + mcontroller.controlParameters(self.wallSlideParameters) + + if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then + releaseWall() + elseif jumpActivated and status.overConsumeResource("energy", self.energyCost) then + doWallJump() + animator.playSound("wallJumpSound") + else + if lrInput and lrInput ~= self.wall then + self.wallReleaseTimer = self.wallReleaseTimer + args.dt + else + self.wallReleaseTimer = 0 + end + + if self.wallReleaseTimer > self.wallReleaseTime then + releaseWall() + else + mcontroller.controlFace(self.wall == "left" and 1 or -1) + if self.wallGrabFreezeTimer > 0 then + self.wallGrabFreezeTimer = math.max(0, self.wallGrabFreezeTimer - args.dt) + mcontroller.controlApproachVelocity({0, 0}, 1000) + if self.wallGrabFreezeTimer == 0 then + animator.setParticleEmitterActive("wallSlide."..self.wall, true) + animator.playSound("wallSlideLoop", -1) + end + end + end + end + elseif not status.statPositive("activeMovementAbilities") then + if lrInput and not mcontroller.jumping() and checkWall(lrInput) then + grabWall(lrInput) + elseif jumpActivated and canMultiJump() then + doMultiJump() + end + end end function buildSensors() - local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) - self.wallSensors = { - right = {}, - left = {} - } - for _, offset in pairs(config.getParameter("wallSensors")) do - table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) - table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) - end + local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) + self.wallSensors = { + right = {}, + left = {} + } + for _, offset in pairs(config.getParameter("wallSensors")) do + table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) + table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) + end end function checkWall(wall) - local pos = mcontroller.position() - local wallCheck = 0 - for _, offset in pairs(self.wallSensors[wall]) do - if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then - wallCheck = wallCheck + 1 - end - end - return wallCheck >= self.wallDetectThreshold + local pos = mcontroller.position() + local wallCheck = 0 + for _, offset in pairs(self.wallSensors[wall]) do + if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then + wallCheck = wallCheck + 1 + end + end + return wallCheck >= self.wallDetectThreshold end function doWallJump() - mcontroller.controlJump(true) - animator.playSound("wallJumpSound") - animator.burstParticleEmitter("wallJump."..self.wall) - local vel = mcontroller.velocity() - vel[1] = self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity - vel[2] = self.wallJumpYVelocity - mcontroller.setVelocity(vel) - releaseWall() + mcontroller.controlJump(true) + animator.playSound("wallJumpSound") + animator.burstParticleEmitter("wallJump."..self.wall) + local vel = mcontroller.velocity() + vel[1] = self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity + vel[2] = self.wallJumpYVelocity + mcontroller.setVelocity(vel) + releaseWall() end function grabWall(wall) - self.wall = wall - self.wallGrabFreezeTimer = self.wallGrabFreezeTime - self.wallReleaseTimer = 0 - mcontroller.setVelocity({0, 0}) + self.wall = wall + self.wallGrabFreezeTimer = self.wallGrabFreezeTime + self.wallReleaseTimer = 0 + mcontroller.setVelocity({0, 0}) - tech.setParentState("fly") - animator.playSound("wallGrab") + tech.setParentState("fly") + animator.playSound("wallGrab") end function releaseWall() - self.wall = nil - tech.setToolUsageSuppressed(false) - tech.setParentState() - animator.setParticleEmitterActive("wallSlide.left", false) - animator.setParticleEmitterActive("wallSlide.right", false) - animator.stopAllSounds("wallSlideLoop") + self.wall = nil + tech.setToolUsageSuppressed(false) + tech.setParentState() + animator.setParticleEmitterActive("wallSlide.left", false) + animator.setParticleEmitterActive("wallSlide.right", false) + animator.stopAllSounds("wallSlideLoop") end diff --git a/tech/jump/wallcling2.lua b/tech/jump/wallcling2.lua index c09dd66ee58..0736f10f6b6 100644 --- a/tech/jump/wallcling2.lua +++ b/tech/jump/wallcling2.lua @@ -2,199 +2,202 @@ require "/tech/jump/multijump.lua" require "/scripts/vec2.lua" require "/scripts/poly.lua" -function init() - self.energyCost = config.getParameter("energyCost") - self.multiJumpCount = config.getParameter("multiJumpCount") - self.multiJumpModifier = config.getParameter("multiJumpModifier") - - self.wallSlideParameters = config.getParameter("wallSlideParameters") - self.wallJumpXVelocity = config.getParameter("wallJumpXVelocity") - self.wallGrabFreezeTime = config.getParameter("wallGrabFreezeTime") - self.wallGrabFreezeTimer = 0 - self.wallReleaseTime = config.getParameter("wallReleaseTime") - self.wallReleaseTimer = 0 - - self.healTimer = 0 - self.pressDown = false - self.soundPlay = false - self.effectTimer = 0 - self.effectDelay = 0.8 - self.invisibleBlockTimer = 0.0 - self.setInv = false - - buildSensors() - self.wallDetectThreshold = config.getParameter("wallDetectThreshold") - self.wallCollisionSet = {"Dynamic", "Block"} - - refreshJumps() - releaseWall() +local oldRefreshJumps=refreshJumps + +function refreshJumps() + oldRefreshJumps() + local jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor + self.wallJumpXVelocity = self.initialWallJumpXVelocity * (jumpBonus) + self.wallJumpYVelocity = self.initialWallJumpYVelocity * (jumpBonus) + self.wallGrabFreezeTime = self.initialWallGrabFreezeTime * (jumpBonus) end -function uninit() - unsetWallClingAbility() - releaseWall() +function init() + self.energyCost = config.getParameter("energyCost") + self.multiJumpCount = config.getParameter("multiJumpCount") + self.multiJumpModifier = config.getParameter("multiJumpModifier") + + self.wallSlideParameters = config.getParameter("wallSlideParameters") + self.initialWallJumpXVelocity = config.getParameter("wallJumpXVelocity") + self.initialWallJumpYVelocity = config.getParameter("wallJumpYVelocity") + self.initialWallGrabFreezeTime = config.getParameter("wallGrabFreezeTime") + self.wallGrabFreezeTimer = 0 + self.wallReleaseTime = config.getParameter("wallReleaseTime") + self.wallReleaseTimer = 0 + + self.healTimer = 0 + self.pressDown = false + self.soundPlay = false + self.effectTimer = 0 + self.effectDelay = 0.8 + self.invisibleBlockTimer = 0.0 + self.setInv = false + + buildSensors() + self.wallDetectThreshold = config.getParameter("wallDetectThreshold") + self.wallCollisionSet = {"Dynamic", "Block"} + + refreshJumps() + releaseWall() end -function applyTechBonus() - self.jumpBonus = 1 + status.stat("jumptechBonus") -- apply bonus from certain items and armor - self.wallJumpXVelocity = config.getParameter("wallJumpXVelocity") * (self.jumpBonus) - self.wallJumpYVelocity = config.getParameter("wallJumpYVelocity") * (self.jumpBonus) - self.wallGrabFreezeTime = config.getParameter("wallGrabFreezeTime") * (self.jumpBonus) +function uninit() + unsetWallClingAbility() + releaseWall() end function update(args) - applyTechBonus() - local jumpActivated = args.moves["jump"] and not self.lastJump - self.lastJump = args.moves["jump"] - - self.pressDown = args.moves["down"] - if mcontroller.onGround() then - self.effectTimer = 0 - end - - updateJumpModifier() - - local lrInput - if args.moves["left"] and not args.moves["right"] then - lrInput = "left" - elseif args.moves["right"] and not args.moves["left"] then - lrInput = "right" - end - - if mcontroller.groundMovement() or mcontroller.liquidMovement() then - refreshJumps() - if self.wall then - releaseWall() - end - elseif self.wall then - refreshJumps() - mcontroller.controlParameters(self.wallSlideParameters) - - if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then - releaseWall() - elseif jumpActivated and status.overConsumeResource("energy", self.energyCost) then - doWallJump() - animator.playSound("wallJumpSound") - else - if lrInput and lrInput ~= self.wall then - self.wallReleaseTimer = self.wallReleaseTimer + args.dt - else - self.wallReleaseTimer = 0 - end - - if self.wallReleaseTimer > self.wallReleaseTime then - releaseWall() - else - mcontroller.controlFace(self.wall == "left" and 1 or -1) - - if args.moves["up"] and not self.pressDown then - goUpside() - end - - if not self.pressDown then - mcontroller.controlApproachVelocity({0, 0}, 1000) - animator.stopAllSounds("wallSlideLoop") - self.soundPlay = false - else - if not self.soundPlay then - self.soundPlay = true - animator.setParticleEmitterActive("wallSlide."..self.wall, true) - animator.playSound("wallSlideLoop", -1) - end - end - end - end - elseif not status.statPositive("activeMovementAbilities") then - if lrInput and not mcontroller.jumping() and checkWall(lrInput) then - grabWall(lrInput) - elseif jumpActivated and canMultiJump() then - doMultiJump() - end - end - - if self.wall then - self.effectTimer = self.effectDelay - else - self.effectTimer = self.effectTimer - args.dt - end - - self.invisibleBlockTimer = self.invisibleBlockTimer - args.dt - - if args.moves["primaryFire"] or args.moves["altFire"] then - self.invisibleBlockTimer = 0.5 - end - - if self.setInv and self.invisibleBlockTimer <= 0 then - setWallClingAbility() - else - unsetWallClingAbility() - end + local jumpActivated = args.moves["jump"] and not self.lastJump + self.lastJump = args.moves["jump"] + + self.pressDown = args.moves["down"] + if mcontroller.onGround() then + self.effectTimer = 0 + end + + updateJumpModifier() + + local lrInput + if args.moves["left"] and not args.moves["right"] then + lrInput = "left" + elseif args.moves["right"] and not args.moves["left"] then + lrInput = "right" + end + + if mcontroller.groundMovement() or mcontroller.liquidMovement() then + refreshJumps() + if self.wall then + releaseWall() + end + elseif self.wall then + refreshJumps() + mcontroller.controlParameters(self.wallSlideParameters) + + if not checkWall(self.wall) or status.statPositive("activeMovementAbilities") then + releaseWall() + elseif jumpActivated and status.overConsumeResource("energy", self.energyCost) then + doWallJump() + animator.playSound("wallJumpSound") + else + if lrInput and lrInput ~= self.wall then + self.wallReleaseTimer = self.wallReleaseTimer + args.dt + else + self.wallReleaseTimer = 0 + end + + if self.wallReleaseTimer > self.wallReleaseTime then + releaseWall() + else + mcontroller.controlFace(self.wall == "left" and 1 or -1) + + if args.moves["up"] and not self.pressDown then + goUpside() + end + + if not self.pressDown then + mcontroller.controlApproachVelocity({0, 0}, 1000) + animator.stopAllSounds("wallSlideLoop") + self.soundPlay = false + else + if not self.soundPlay then + self.soundPlay = true + animator.setParticleEmitterActive("wallSlide."..self.wall, true) + animator.playSound("wallSlideLoop", -1) + end + end + end + end + elseif not status.statPositive("activeMovementAbilities") then + if lrInput and not mcontroller.jumping() and checkWall(lrInput) then + grabWall(lrInput) + elseif jumpActivated and canMultiJump() then + doMultiJump() + end + end + + if self.wall then + self.effectTimer = self.effectDelay + else + self.effectTimer = self.effectTimer - args.dt + end + + self.invisibleBlockTimer = self.invisibleBlockTimer - args.dt + + if args.moves["primaryFire"] or args.moves["altFire"] then + self.invisibleBlockTimer = 0.5 + end + + if self.setInv and self.invisibleBlockTimer <= 0 then + setWallClingAbility() + else + unsetWallClingAbility() + end end function buildSensors() - local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) - self.wallSensors = { - right = {}, - left = {} - } - for _, offset in pairs(config.getParameter("wallSensors")) do - table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) - table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) - end + local bounds = poly.boundBox(mcontroller.baseParameters().standingPoly) + self.wallSensors = { + right = {}, + left = {} + } + for _, offset in pairs(config.getParameter("wallSensors")) do + table.insert(self.wallSensors.left, {bounds[1] - 0.1, bounds[2] + offset}) + table.insert(self.wallSensors.right, {bounds[3] + 0.1, bounds[2] + offset}) + end end function checkWall(wall) - local pos = mcontroller.position() - local wallCheck = 0 - for _, offset in pairs(self.wallSensors[wall]) do - if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then - wallCheck = wallCheck + 1 - end - end - return wallCheck >= self.wallDetectThreshold + local pos = mcontroller.position() + local wallCheck = 0 + for _, offset in pairs(self.wallSensors[wall]) do + if world.pointCollision(vec2.add(pos, offset), self.wallCollisionSet) then + wallCheck = wallCheck + 1 + end + end + return wallCheck >= self.wallDetectThreshold end function doWallJump() - mcontroller.controlJump(true) - animator.playSound("wallJumpSound") - animator.burstParticleEmitter("wallJump."..self.wall) - mcontroller.setXVelocity(self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity) - mcontroller.setYVelocity(20) - releaseWall() + mcontroller.controlJump(true) + animator.playSound("wallJumpSound") + animator.burstParticleEmitter("wallJump."..self.wall) + mcontroller.setXVelocity(self.wall == "left" and self.wallJumpXVelocity or -self.wallJumpXVelocity) + mcontroller.setYVelocity(20) + releaseWall() end function grabWall(wall) - self.wall = wall - self.wallGrabFreezeTimer = self.wallGrabFreezeTime - self.wallReleaseTimer = 0 - mcontroller.setVelocity({0, 0}) - tech.setParentState("fly") - animator.playSound("wallGrab") - refreshJumps() - self.setInv = true + self.wall = wall + self.wallGrabFreezeTimer = self.wallGrabFreezeTime + self.wallReleaseTimer = 0 + mcontroller.setVelocity({0, 0}) + tech.setParentState("fly") + animator.playSound("wallGrab") + refreshJumps() + self.setInv = true end function releaseWall() - self.wall = nil - tech.setToolUsageSuppressed(false) - tech.setParentState() - animator.setParticleEmitterActive("wallSlide.left", false) - animator.setParticleEmitterActive("wallSlide.right", false) - animator.stopAllSounds("wallSlideLoop") - self.setInv = false - self.soundPlay = false + self.wall = nil + tech.setToolUsageSuppressed(false) + tech.setParentState() + animator.setParticleEmitterActive("wallSlide.left", false) + animator.setParticleEmitterActive("wallSlide.right", false) + animator.stopAllSounds("wallSlideLoop") + self.setInv = false + self.soundPlay = false end function goUpside() - doWallJump(); + doWallJump(); end function setWallClingAbility() - --status.addPersistentEffect("wallCling", "percentenergyboost20", math.huge); - status.addPersistentEffect("wallCling", "percentarmorboost10", math.huge); + --status.addPersistentEffect("wallCling", "percentenergyboost20", math.huge); + status.addPersistentEffect("wallCling", "percentarmorboost10", math.huge); end function unsetWallClingAbility() - status.clearPersistentEffects("wallCling"); + status.clearPersistentEffects("wallCling"); end