diff --git a/lua_testbay/abilities.lua b/lua_testbay/abilities.lua new file mode 100644 index 0000000..7103a5d --- /dev/null +++ b/lua_testbay/abilities.lua @@ -0,0 +1,32 @@ +--[[ + Testclass for "Filthy Peasants" peasant + ©LazyProggers +]]-- + +-- LIBARIES (uncomment to use) + -- require "peasant" -- Peasant class for peasant creation, deletion, adjustment + require "gamer" -- Class for global variables and some player content + +-- Start of the abilities.lua program + +-- VARIABLES + +-- FUNCTIONS +function ability1(gpower, civilisation) + if (gpower > 20) then + print("Ability 1 takes effect") + else + print("Not enough power for that Sir.") + end +end + +-- TESTING AREA +print(gpower) +ability1(gpower, civilisation) + +--[[ + Notes: + + Known errors: + +]]-- diff --git a/lua_testbay/gamer.lua b/lua_testbay/gamer.lua index d200a56..edf5feb 100644 --- a/lua_testbay/gamer.lua +++ b/lua_testbay/gamer.lua @@ -13,6 +13,12 @@ gpower = 0 gawe = 0 gworship = 0 glove = 0 gfear = 0 ghatred = 0 playerstats = {gawe, gworship, glove, gfear, ghatred} -- Create array for some cases of storage of the variables/ Idea for storage -- FUNCTIONS +function calc_power(civilisation) + calc_all(civilisation) + -- gpower = algorithm to calculate the power + return gpower +end + function calc_gawe(civilisation) -- This function adds up the awe of the civilisation for i, peasant in ipairs(civilisation) do gawe = peasant.awe + gawe @@ -56,10 +62,19 @@ function calc_all(civilisation) -- This function adds up all the values for one gfear = peasant.fear + gfear ghatred = peasant.hatred + ghatred end - return -- No value jet + return gawe, gworship, glove, gfear, ghatred end -- TESTING AREA +peasant1 = birth(peasant1) +peasant2 = birth(peasant2) +peasant3 = birth(peasant3) +change_love(peasant1, 20) +change_love(peasant2, -12) +change_love(peasant3, 130) +civilisation = {peasant1, peasant2, peasant3} +calc_glove(civilisation) + --[[ peasant1 = birth(peasant1) change_love(peasant1, 20) diff --git a/lua_testbay/template_luascript.lua b/lua_testbay/template_luascript.lua index 6759643..d669faf 100644 --- a/lua_testbay/template_luascript.lua +++ b/lua_testbay/template_luascript.lua @@ -4,8 +4,8 @@ ]]-- -- LIBARIES (uncomment to use) - -- require "peasant" Peasant class for peasant creation, deletion, adjustment - -- require "gamer" Class for global variables and some player content + -- require "peasant" -- Peasant class for peasant creation, deletion, adjustment + -- require "gamer" -- Class for global variables and some player content -- Start of the NAME.lua program