From 0d8b554f4fbcc466da901f83b51ce58d0e354e15 Mon Sep 17 00:00:00 2001 From: Kherae Date: Tue, 12 Dec 2023 14:58:52 -0800 Subject: [PATCH 1/3] add mementomori to includes --- .metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.metadata b/.metadata index 9ec48150aa..1ff9851d0b 100644 --- a/.metadata +++ b/.metadata @@ -2,11 +2,11 @@ "author" : "sayter", "description" : "[h3]FU Discord:[/h3]http:://discord.gg/eTp4ewVHFA\n[h3]Wiki: [/h3]https://frackinuniverse.miraheze.org/wiki/Main_Page\n\n[h1][b]Disclaimer: Installing FU is a one-way trip. FU will affect your game universe [u]and[/u] ALL characters.[/b][/h1]\n\nNote: Uninstalling the mod will cause crashes, unless you wipe your universe and player folders. This is not avoidable. Be sure to back up your universe and player folders before installing.\n\n[h2]Frackin Races is not compatible, as it is already included. If you install it as well, you will crash.[/h2]\n\n[h3][b]Incompatible Mods[/b][/h3]\nFor a list of incompatible mods: frackinuniverse.miraheze.org/wiki/Incompatible\n\n[img]http://sayterdarkwynd.github.io/images/fu/bugreport.png[/img]\nError reports will be [u]much easier[/u] to fix if you provide a link to starbound.log file. How to do that?\n[list][*] Go to starbound/storage/starbound.log\n[*] Open that with text editor like Notepad\n[*] Copy and paste its contents to pastebin.com\n[*] Report with the link to that pastebin[/list]\n \n[b]starbound.log helps us to detect what is the CAUSE of your error.[/b]\n\n[img]http://sayterdarkwynd.github.io/images/fu/whatis.png[/img]\n\nThe largest mod for Starbound, FrackinUniverse combines new biomes, a completely overhauled crafting system, science, research, monsters, tiles and hundreds of other assets to the game. Nearly every major game system is changed.\n\n[img]http://sayterdarkwynd.github.io/images/fu/gamechanges.png[/img]\n[b]Major Gameplay Changes[/b] : https://frackinuniverse.miraheze.org/wiki/Gameplay_Changes\n[b]New Races[/b] : https://frackinuniverse.miraheze.org/wiki/Races\n[b]Mech Changes[/b] : https://frackinuniverse.miraheze.org/wiki/Mechs\n\n[img]http://sayterdarkwynd.github.io/images/fu/getstarted.png[/img]\n\n[img]http://sayterdarkwynd.github.io/images/fu/addons.png[/img]\n\n[h1][b]SAIL changes for modded races/ships[/b][/h1] https://steamcommunity.com/sharedfiles/filedetails/?id=1411331676 \nor its git link - https://github.com/xn-5o8h/FUSAILModdedRaceSupport\n\n[b]If using *modded* races, you will want the FU BYOS addon here https://steamcommunity.com/sharedfiles/filedetails/?id=1194878261&searchtext=FU+BYOS[/b]\n\n[b]Avali Triage[/b] Players will require this: https://steamcommunity.com/sharedfiles/filedetails/?id=2052758462 \n\n[h2][b]Recommended Mods[/b][/h2]\nThe following are all top-notch mods we heartily recommend using with FU: https://frackinuniverse.miraheze.org/wiki/Recommended\n \n[img]http://sayterdarkwynd.github.io/images/fu/itemnetwork.png[/img]\n\n[b]For a detailed guide on how to use the included automation systems in FU, refer to this guide-\nhttps://steamcommunity.com/sharedfiles/filedetails/?id=1618972523[/b]\n\n[img]http://sayterdarkwynd.github.io/images/fu/faq.png[/img]\n \nQ: How do I tell if it's working?\nA: Quite simple. When you launch starbound, look at the main menu screen. Do you see \"Powered by Frackin Universe\"? If so, you're good to go!\n \nQ: Will this work on a server?\nA: Read : http://steamcommunity.com/sharedfiles/filedetails/?id=734496146&searchtext=Frackin+Universe\n \nQ: How do I run a server?\nA: Read : http://steamcommunity.com/sharedfiles/filedetails/?id=735510285\n \nQ: Do I need to delete my characters and universe before I start? Will it work with the character I already have?\n(or any possible variation of this question)\nA: No, you do not.\nHowever, you will need to travel a fair ways away on your starmap in order to generate the new biome types. Generally a few seconds will do. So yes, it will work with your existing character. I recommend a clean universe, personally, but that's only if you absolutely want to have FU planets right near your starting location.\n \nQ: I seem to be taking forever to generate my starting planets. It's in warp for like...ever.\nA: Starbound is generating a universe and looking for a starting system that fits exact specifications. Because FU adds so many biomes it increases the time it takes to find the setup. I recommend visiting the Science Outpost when this happens, which can be triggered from your shiplocker items. By the time you come back you'll have your starting planet visible and a quest to begin!\n\nQ: Where do I find (ITEM NAME)?!?!?!\nA: Everything has a source. You just need to figure out what that source is. That's part of the mod. Exploration, experimentation...just seeing what sort of things lead to others and eventually ending up with a hard-core science lab. The wiki link given on this page right after the FAQ is a good source of information.\n \nQ: Does FU add quests/missions or bosses?\nA: Yes\n \nQ: Does FU affect the main storyline or game progression?\nA: No. The only true progression change is with EPP packs (see above sections for info on that). Otherwise you can progress exactly as normal through the base game.\n \nQ: I can't find something on the Wiki\nA: The wiki is player maintained. So, if you find something missing you can feel free to add it in.\n \nQ: My EPP pack isn't working\nA: Yes it is. Read the mod description information above for more details about how they operate now.\n \nIf for some reason you want to hurl money at me for my labors: https://www.patreon.com/sayter\nWiki (player maintained): https://frackinuniverse.miraheze.org/wiki/Main_Page\nCF Forum version found here: http://community.playstarbound.com/resources/frackinuniverse.2920/\nGitHub project version location is here: https://github.com/sayterdarkwynd/FrackinUniverse\n\nA great number of mods and features in FU are from contributors or other authors. Check out the included credits.txt here: https://github.com/sayterdarkwynd/FrackinUniverse/blob/master/_FUcredits.config or visit https://github.com/sayterdarkwynd/FrackinUniverse for info", "friendlyName" : "Frackin' Universe", - "includes" : ["Working Solar panels for BYOS (Frackin Universe)", "bunnine", "Skath Race", "GunsNAmmo", "Alchemical Reactions", "shieldBars", "Callistan Race Mod", "FreedomOfMovement", "SlimeRaceMod", "MMI", "AnTiVegetation", "StardustLib", "QuickbarMini", "CustomCollectionsUI", "Sergal Race Mod Langy's Branch", "Elithian_Races_Mod", "MoiCo Pack [Guns, Monster, Mech Parts & Armor]", "Aperture Laboratories Mech", "Gundam Zaku Mech", "Mekanor mech-body", "mechavali", "Barrage heavy mecha", "Deb's Mechs", "Huckebein MK-II mech", "I Want to MECHANIZE That Van", "Anvil Mechs", "SRW mechs", "XS Mechs : Modular Edition (BETA)", "xsmm_weapons", "scriptedail", "SexboundAPI_Thelusian", "SexboundAPI_fukihros", "The Nightars", "USCM_expansion", "Extended Story", "ztarbound", "Galactic Shops - FU Addon", "PlayableCatsRedux", "Playable Fenerox!", "mechoverhaul", "Frontier Expansion", "Foodie's Furniture", "TabulaRasa", "manyFrogs", "PropPack", "shreddysblocks", "Racial Kitchen Counters", "Racial Shop Counters", "miscmechgear", "FreeSwim_SayterIsALiar", "FreeSwim", "The Juuxian Federation", "Inkling Race Mod", "saturnians", "Draconis Race(Humanoid Dragon Race)", "Deerfolk Race Mod", "kirhos", "kitsunerace", "tirastrolls", "WIP: The Viera of Ivalice", "Mauskin", "peglaci", "Felins", "Bunnykin", "GreckanRaceMod", "kazdrareloaded", "Gyrusens", "Hive Wasp Race", "Vulpes race for Starbound 1.X", "Vespoids", "Orcana", "Race - Munari", "Ningen [Fixed for 1.3]", "mantizi", "Skelekin Race", "Neko Alternate", "Kemono", "Familiars", "Elunite", "argonian", "lamia", "Indix", "Arsenalbound", "Lastree Race", "Skittles Advanced Race Template", "Gardevan", "Woggles", "The Tauren of Warcraft", "lucario", "lombax", "novalirace", "everis", "changenykt", "Demon Race", "Shadow Race 2.0!", "Deerkin", "Terrakin Race", "Merrkin", "Ori Mod Redux", "Spirit Tree Race", "Mantid Species", "Remorian Race Mod", "Lutrin Race Mod", "Xeno's InvaderZim Mod", "The Carakinox", "Cuteness Unbound - Harpies", "The Pony Modpack", "Attaran", "pilch_fieldgenerator", "shoggothracemod", "Starbound Awakens", "p_Pets", "Zombie Race Mod Redux", "AnTiVegetation", "HullPlatingBlocks", "Kyani - Mission to the Multiverse", "bk3k_inventory", "The Viera of Ivalice, Fixed for FU", "cskscyphojel", "Vash'Knaaren Race"], + "includes" : ["Working Solar panels for BYOS (Frackin Universe)", "bunnine", "Skath Race", "GunsNAmmo", "Alchemical Reactions", "shieldBars", "Callistan Race Mod", "FreedomOfMovement", "SlimeRaceMod", "MMI", "AnTiVegetation", "StardustLib", "QuickbarMini", "CustomCollectionsUI", "Sergal Race Mod Langy's Branch", "Elithian_Races_Mod", "MoiCo Pack [Guns, Monster, Mech Parts & Armor]", "Aperture Laboratories Mech", "Gundam Zaku Mech", "Mekanor mech-body", "mechavali", "Barrage heavy mecha", "Deb's Mechs", "Huckebein MK-II mech", "I Want to MECHANIZE That Van", "Anvil Mechs", "SRW mechs", "XS Mechs : Modular Edition (BETA)", "xsmm_weapons", "scriptedail", "SexboundAPI_Thelusian", "SexboundAPI_fukihros", "The Nightars", "USCM_expansion", "Extended Story", "ztarbound", "Galactic Shops - FU Addon", "PlayableCatsRedux", "Playable Fenerox!", "mechoverhaul", "Frontier Expansion", "Foodie's Furniture", "TabulaRasa", "manyFrogs", "PropPack", "shreddysblocks", "Racial Kitchen Counters", "Racial Shop Counters", "miscmechgear", "FreeSwim_SayterIsALiar", "FreeSwim", "The Juuxian Federation", "Inkling Race Mod", "saturnians", "Draconis Race(Humanoid Dragon Race)", "Deerfolk Race Mod", "kirhos", "kitsunerace", "tirastrolls", "WIP: The Viera of Ivalice", "Mauskin", "peglaci", "Felins", "Bunnykin", "GreckanRaceMod", "kazdrareloaded", "Gyrusens", "Hive Wasp Race", "Vulpes race for Starbound 1.X", "Vespoids", "Orcana", "Race - Munari", "Ningen [Fixed for 1.3]", "mantizi", "Skelekin Race", "Neko Alternate", "Kemono", "Familiars", "Elunite", "argonian", "lamia", "Indix", "Arsenalbound", "Lastree Race", "Skittles Advanced Race Template", "Gardevan", "Woggles", "The Tauren of Warcraft", "lucario", "lombax", "novalirace", "everis", "changenykt", "Demon Race", "Shadow Race 2.0!", "Deerkin", "Terrakin Race", "Merrkin", "Ori Mod Redux", "Spirit Tree Race", "Mantid Species", "Remorian Race Mod", "Lutrin Race Mod", "Xeno's InvaderZim Mod", "The Carakinox", "Cuteness Unbound - Harpies", "The Pony Modpack", "Attaran", "pilch_fieldgenerator", "shoggothracemod", "Starbound Awakens", "p_Pets", "Zombie Race Mod Redux", "AnTiVegetation", "HullPlatingBlocks", "Kyani - Mission to the Multiverse", "bk3k_inventory", "The Viera of Ivalice, Fixed for FU", "cskscyphojel", "Vash'Knaaren Race","mementomori"], "link" : "steam://url/CommunityFilePage/729480149", "name" : "FrackinUniverse", "requires" : [], "steamContentId" : "729480149", "tags" : "Crafting and Building|Miscellaneous|Planets and Environments|NPCs and Creatures|Weapons|Quests|Dungeons|Ships|Species|User Interface|Furniture and Objects|Food and Farming|Mechanics|Vehicles and Mounts|Armor and Clothes", "version" : "6.3.8" -} \ No newline at end of file +} From 0ff7a96dfc0b72e788f770a6eeb51af13ba8f96a Mon Sep 17 00:00:00 2001 From: Kherae Date: Tue, 12 Dec 2023 14:59:15 -0800 Subject: [PATCH 2/3] sanitycheck, args verification --- scripts/fubasictilegroundeffects.lua | 296 +++++++++++++-------------- 1 file changed, 148 insertions(+), 148 deletions(-) diff --git a/scripts/fubasictilegroundeffects.lua b/scripts/fubasictilegroundeffects.lua index beedba09cd..94f5e3a2c1 100644 --- a/scripts/fubasictilegroundeffects.lua +++ b/scripts/fubasictilegroundeffects.lua @@ -10,173 +10,173 @@ collisionParams = {} require "/scripts/furesearchGenerators.lua" -function init() - tileMaterials() - self.airJumpModifier = 1 - collisionParams = root.assetJson("/player.config:collisionParams") - tileEffects_Init() -- old Init() +function init(...) + tileMaterials() + self.airJumpModifier = 1 + collisionParams = root.assetJson("/player.config:collisionParams") + if tileEffects_Init then tileEffects_Init(...) end -- old Init() end -function update(dt) - if mcontroller.isNullColliding() then - --skip update when behind on loading chucks, plus there is nothing to collide with anyhow. - return - end - - local groundMat, offset - local onGround = mcontroller.onGround() - local softness = 1 - self.position = mcontroller.position() - if not onGround and self.airJumpModifier ~= 1 then - mcontroller.controlModifiers({airJumpModifier = self.airJumpModifier}) - end - - - --reworked falling to apply Softness and Brittle tiles - local minimumFallDistance = collisionParams.minimumFallDistance - local fallDistanceDamageFactor = collisionParams.fallDistanceDamageFactor - local minimumFallVel = collisionParams.minimumFallVel - local baseGravity = collisionParams.baseGravity - local gravityDiffFactor = collisionParams.gravityDiffFactor - local curYVelocity = mcontroller.yVelocity() - local yVelChange = curYVelocity - self.lastYVelocity - - if onGround then - self.airJumpModifier = 1 - groundMat, offset = groundContact() - - if currentTile then - applyTileEffects() - - -- check if player gets Research randomly - if not self.researchTimer then self.researchTimer = 0 end - if self.researchTimer == 0 then - checkResearchBonus() - self.researchTimer = 100 - else - self.researchTimer = self.researchTimer - dt - end - - --applyTileEffects(groundMat) - softness = currentTile["softness"] - --softness = self.matCheck[groundMat][9] - -- check for brittle tiles and damage them - brittleTiles(yVelChange, minimumFallVel, groundMat, offset) - end - end - - -- falling damage - if self.fallDistance > minimumFallDistance and yVelChange > minimumFallVel and onGround then - local damage = (self.fallDistance - minimumFallDistance) * fallDistanceDamageFactor * softness - damage = damage * (1.0 + (world.gravity(self.position) - baseGravity) * gravityDiffFactor) - damage = damage * status.stat("fallDamageMultiplier") - status.applySelfDamageRequest({ - damageType = "IgnoresDef", - damage = damage, - damageSourceKind = "falling", - sourceEntityId = entity.id() - }) - -- set self.fallDistance to 0 to prevent old updates fall damage check from triggering additional falling damage - self.fallDistance = 0 - end - - tileEffects_Update(dt) -- old update() +function update(dt,...) + if mcontroller.isNullColliding() then + --skip update when behind on loading chucks, plus there is nothing to collide with anyhow. + return + end + + local groundMat, offset + local onGround = mcontroller.onGround() + local softness = 1 + self.position = mcontroller.position() + if not onGround and self.airJumpModifier ~= 1 then + mcontroller.controlModifiers({airJumpModifier = self.airJumpModifier}) + end + + + --reworked falling to apply Softness and Brittle tiles + local minimumFallDistance = collisionParams.minimumFallDistance + local fallDistanceDamageFactor = collisionParams.fallDistanceDamageFactor + local minimumFallVel = collisionParams.minimumFallVel + local baseGravity = collisionParams.baseGravity + local gravityDiffFactor = collisionParams.gravityDiffFactor + local curYVelocity = mcontroller.yVelocity() + local yVelChange = curYVelocity - self.lastYVelocity + + if onGround then + self.airJumpModifier = 1 + groundMat, offset = groundContact() + + if currentTile then + applyTileEffects() + + -- check if player gets Research randomly + if not self.researchTimer then self.researchTimer = 0 end + if self.researchTimer == 0 then + checkResearchBonus() + self.researchTimer = 100 + else + self.researchTimer = self.researchTimer - dt + end + + --applyTileEffects(groundMat) + softness = currentTile["softness"] + --softness = self.matCheck[groundMat][9] + -- check for brittle tiles and damage them + brittleTiles(yVelChange, minimumFallVel, groundMat, offset) + end + end + + -- falling damage + if self.fallDistance > minimumFallDistance and yVelChange > minimumFallVel and onGround then + local damage = (self.fallDistance - minimumFallDistance) * fallDistanceDamageFactor * softness + damage = damage * (1.0 + (world.gravity(self.position) - baseGravity) * gravityDiffFactor) + damage = damage * status.stat("fallDamageMultiplier") + status.applySelfDamageRequest({ + damageType = "IgnoresDef", + damage = damage, + damageSourceKind = "falling", + sourceEntityId = entity.id() + }) + -- set self.fallDistance to 0 to prevent old updates fall damage check from triggering additional falling damage + self.fallDistance = 0 + end + + if tileEffects_Update then tileEffects_Update(dt,...) end -- old update() end applyTileEffects = function(groundMat) - status.addEphemeralEffects(currentTile["effects"]) - mcontroller.controlModifiers(currentTile["controlModifiers"]) - mcontroller.controlParameters(currentTile["controlParameters"]) + status.addEphemeralEffects(currentTile["effects"]) + mcontroller.controlModifiers(currentTile["controlModifiers"]) + mcontroller.controlParameters(currentTile["controlParameters"]) - local airJumpModifier = currentTile.controlModifiers.airJumpModifier - if airJumpModifier ~= 1 then - self.airJumpModifier = airJumpModifier - end + local airJumpModifier = currentTile.controlModifiers.airJumpModifier + if airJumpModifier ~= 1 then + self.airJumpModifier = airJumpModifier + end end groundContact = function() - local mpos = self.position - local position = {mpos[1],math.floor(mpos[2])} - local groundMat = world.material(vec2.add({position[1],position[2]}, {0,-2.5}), "foreground") - local offset = 0 - local stoodOn - - if groundMat == false then - if mpos[1] - math.floor(mpos[1]) < 0.5 then - groundMat = world.material(vec2.add(position, {-1,-2.5}), "foreground") - --world.debugLine({position[1], position[2]-1.5}, {position[1]-1, position[2]-2.5}, "green") - offset = -1 - else - groundMat = world.material(vec2.add(position, {1,-2.5}), "foreground") - --world.debugLine({position[1], position[2]-1.5}, {position[1]+1, position[2]-2.5}, "green") - offset = 1 - end - end - if groundMat == false then - local stoodOnObject = world.objectQuery(vec2.add({position[1],position[2]}, {0,-2.5}), 0.1, {order = "nearest"}) - if stoodOnObject == false then - if mpos[1] - math.floor(mpos[1]) < 0.5 then - stoodOnObject = world.objectQuery(vec2.add(position, {-1,-2.5}), 0.1, {order = "nearest"}) - offset = -1 - else - stoodOnObject = world.objectQuery(vec2.add(position, {1,-2.5}), 0.1, {order = "nearest"}) - offset = 1 - end - end - if #stoodOnObject >= 1 then - stoodOn = tostring(world.entityName(stoodOnObject[1])) - --world.debugText(stoodOn,{position[1]-(string.len(stoodOn)*0.25),position[2]-3.5},"green") - end - else - --world.debugText(tostring(groundMat),{position[1]-(string.len(tostring(groundMat))*0.25),position[2]-3.5},"green") - end - - currentTile = tileEffects[groundMat] - return groundMat, offset, stoodOn or false + local mpos = self.position + local position = {mpos[1],math.floor(mpos[2])} + local groundMat = world.material(vec2.add({position[1],position[2]}, {0,-2.5}), "foreground") + local offset = 0 + local stoodOn + + if groundMat == false then + if mpos[1] - math.floor(mpos[1]) < 0.5 then + groundMat = world.material(vec2.add(position, {-1,-2.5}), "foreground") + --world.debugLine({position[1], position[2]-1.5}, {position[1]-1, position[2]-2.5}, "green") + offset = -1 + else + groundMat = world.material(vec2.add(position, {1,-2.5}), "foreground") + --world.debugLine({position[1], position[2]-1.5}, {position[1]+1, position[2]-2.5}, "green") + offset = 1 + end + end + if groundMat == false then + local stoodOnObject = world.objectQuery(vec2.add({position[1],position[2]}, {0,-2.5}), 0.1, {order = "nearest"}) + if stoodOnObject == false then + if mpos[1] - math.floor(mpos[1]) < 0.5 then + stoodOnObject = world.objectQuery(vec2.add(position, {-1,-2.5}), 0.1, {order = "nearest"}) + offset = -1 + else + stoodOnObject = world.objectQuery(vec2.add(position, {1,-2.5}), 0.1, {order = "nearest"}) + offset = 1 + end + end + if #stoodOnObject >= 1 then + stoodOn = tostring(world.entityName(stoodOnObject[1])) + --world.debugText(stoodOn,{position[1]-(string.len(stoodOn)*0.25),position[2]-3.5},"green") + end + else + --world.debugText(tostring(groundMat),{position[1]-(string.len(tostring(groundMat))*0.25),position[2]-3.5},"green") + end + + currentTile = tileEffects[groundMat] + return groundMat, offset, stoodOn or false end brittleTiles = function(yVelChange,minimumFallVel, groundMat, offset) - local brittle = currentTile["brittle"] or false - local opts = currentTile["options"] or false - - if brittle and self.fallDistance > brittle and yVelChange > minimumFallVel - brittle then - local damage = math.random(currentTile["damage"])+1 - local position = {self.position[1],math.floor(self.position[2])} - world.damageTiles({vec2.add(position,{offset,-3})}, "foreground", position, "blockish", damage, 0) - for y = -1, 0 do - for x = -1, 1 do - local tilePos = vec2.add({position[1]+x, position[2]+y}, {offset,-3}) - local tile = world.material(tilePos, "foreground") - if not (x == 0 and y == 0) and type(tile) == "string" and tile == groundMat then - world.damageTiles({tilePos}, "foreground", position, "blockish", math.random(0,damage), 0) - end - end - end - if (opts) then - world.spawnProjectile( - "invisibleprojectile", position, entity.id(), {0,0}, false, - { - timeToLive = 0, - damageType = "noDamage", - actionOnReap = { - { - action = "sound", - options = opts - } - } - } - ) - end - end + local brittle = currentTile["brittle"] or false + local opts = currentTile["options"] or false + + if brittle and self.fallDistance > brittle and yVelChange > minimumFallVel - brittle then + local damage = math.random(currentTile["damage"])+1 + local position = {self.position[1],math.floor(self.position[2])} + world.damageTiles({vec2.add(position,{offset,-3})}, "foreground", position, "blockish", damage, 0) + for y = -1, 0 do + for x = -1, 1 do + local tilePos = vec2.add({position[1]+x, position[2]+y}, {offset,-3}) + local tile = world.material(tilePos, "foreground") + if not (x == 0 and y == 0) and type(tile) == "string" and tile == groundMat then + world.damageTiles({tilePos}, "foreground", position, "blockish", math.random(0,damage), 0) + end + end + end + if (opts) then + world.spawnProjectile( + "invisibleprojectile", position, entity.id(), {0,0}, false, + { + timeToLive = 0, + damageType = "noDamage", + actionOnReap = { + { + action = "sound", + options = opts + } + } + } + ) + end + end end function tileMaterials() - tileEffects = root.assetJson("/tileEffects.config:vanilla_tiles") - tileEffects.__index = function() return false end + tileEffects = root.assetJson("/tileEffects.config:vanilla_tiles") + tileEffects.__index = function() return false end end From 3dedbe703bdb2b3dbe55677dcaae4883c928648f Mon Sep 17 00:00:00 2001 From: Kherae Date: Tue, 12 Dec 2023 14:59:35 -0800 Subject: [PATCH 3/3] revision to cleaner code --- scripts/fumm_player_primary.lua | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/scripts/fumm_player_primary.lua b/scripts/fumm_player_primary.lua index e8dcb72f35..d2b07c469d 100644 --- a/scripts/fumm_player_primary.lua +++ b/scripts/fumm_player_primary.lua @@ -1,15 +1,15 @@ require "/scripts/fumementomori.lua" -if not _mm_wrapped then - _applyDamageRequest = applyDamageRequest - _init = init - _update = update - _teleportOut = teleportOut - _mm_wrapped = true -end +local fummApplyDamageRequest = applyDamageRequest +local fummInit = init +local fummUpdate = update +local fummTeleportOut = teleportOut +local promise +local promise2 +local mm_timer=5.0 function applyDamageRequest(damageRequest) - local r = _applyDamageRequest(damageRequest) + local r = fummApplyDamageRequest(damageRequest) if (not playerIsAdmin) and next(r) ~= nil and r[1].hitType == "kill" and worldId then status.setStatusProperty("fuEnhancerActive", false) status.setStatusProperty(mementomori.deathPositionKey.."."..worldId,{position=mcontroller.position()}) @@ -18,12 +18,11 @@ function applyDamageRequest(damageRequest) return r end -function init() - mm_timer=5.0 - _init() +function init(...) + if fummInit then fummInit(...) end end -function update(dt) +function update(dt,...) if not mm_timer then mm_timer=0.0 elseif mm_timer > 5.0 then @@ -47,10 +46,10 @@ function update(dt) end end end - _update(dt) + if fummUpdate then fummUpdate(dt,...) end end function teleportOut(...) mm_timer=0.0 - _teleportOut(...) + if fummTeleportOut then fummTeleportOut(...) end end