diff --git a/README.md b/README.md index 7cb4fd6..c5d7bbb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ region triggers can now detect a specific enemy category - just type a number in added givesacoin, givesdecacoin, and givestime for custom enemies. these override givesalife. -also added givestimeamount. +also added givestimeamount and givescoinamount. changed folder to mari0_fe so that things don't crash in unmodded SE. @@ -28,4 +28,8 @@ deleted the map previews of /smb/ so it fit. minor text and QoL changes - logic gates are invisible by default, other things that shouldn't change anything -added internal flags --GCP for a modular function that's being worked on, --HAK for a particularly hacky piece of code, and more to come \ No newline at end of file +added internal flags --GCP for a modular function that's being worked on, --HAK for a particularly hacky piece of code, --DOC for documentation of what something is supposed to do, --DB for debug, --TODO for obvious reasons and more to come + +added globools, globints, and globoolSH(id, func) to game.lua --TODO: add more + +added a globool related condition and trigger to animations, action to come \ No newline at end of file diff --git a/animation.lua b/animation.lua index 4576d41..26cfb8a 100644 --- a/animation.lua +++ b/animation.lua @@ -62,8 +62,8 @@ disableportalgun:player disable portal gun of player --[[ FES: (--DOC) -TRIGGER whenboolis whenever a boolean is true #needs v[2] #imp -CONDITION ifbool only if a boolean is true (can be inverted) #undef #unimp +TRIGGER whenboolis whenever a boolean is true #def #imp +CONDITION ifbool only if a boolean is true (can be inverted) #def #imp ACTION dotobool set and/or flip a boolean (three modes of one action) #undef #unimp ]]-- @@ -431,6 +431,7 @@ function animation:update(dt) elseif v[1] == "enableportalgun" then if v[2] == "everyone" then + for i = 1, players do objects["player"][i].portalgundisabled = false end @@ -440,6 +441,8 @@ function animation:update(dt) objects["player"][i].portalgundisabled = false end end + elseif v[1] == "dotobool" then + globoolSH(v[2],v[3]) end self.currentaction = self.currentaction + 1 @@ -484,7 +487,7 @@ function animation:trigger() break end elseif v[1] == "ifbool" then - if globoolsSH(v[2], "check") ~= v[3] then + if globoolSH(v[2], "check") ~= v[3] then pass = false break end diff --git a/animationguiline.lua b/animationguiline.lua index 6c74a9f..01062ed 100644 --- a/animationguiline.lua +++ b/animationguiline.lua @@ -836,6 +836,27 @@ table.insert(toenter, {name = "enableportalgun", } }) +table.insert(toenter, {name = "dotobool", + t = { + t="action", + nicename="set global boolean", + entries={ + { + t="input" + }, + + { + t="text", + value="to", + }, + + { + t="booleanselection" + } + } + } +}) + --SORT ALPHABETICALLY (I didn't even know you could greater/less compare strings.) table.sort(toenter, function(a, b) return a.t.nicename < b.t.nicename end) diff --git a/game.lua b/game.lua index 9cd8740..b8e0424 100644 --- a/game.lua +++ b/game.lua @@ -5653,6 +5653,5 @@ globools[id] = true elseif para == "false" then globools[id] = false end - -return globools[id] or false --sanitise outputs so nil is never returned +return globools[id] --sanitise outputs so nil is never returned end \ No newline at end of file