Skip to content

Commit

Permalink
completed previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RokonShimo committed Oct 8, 2018
1 parent 7f50ad5 commit b180b88
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
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
9 changes: 6 additions & 3 deletions animation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
]]--

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions animationguiline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b180b88

Please sign in to comment.