diff --git a/lua_testbay/gamer.lua b/lua_testbay/gamer.lua index 95e8034..d200a56 100644 --- a/lua_testbay/gamer.lua +++ b/lua_testbay/gamer.lua @@ -3,15 +3,16 @@ ©LazyProggers ]]-- --- Required libaries +-- LIBARIES require "math" require "peasant" -- Start of the gamer.lua program +-- VARIABLES 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 to calculate the global stats +-- FUNCTIONS function calc_gawe(civilisation) -- This function adds up the awe of the civilisation for i, peasant in ipairs(civilisation) do gawe = peasant.awe + gawe @@ -58,8 +59,8 @@ function calc_all(civilisation) -- This function adds up all the values for one return -- No value jet end --- Testing area: - +-- TESTING AREA +--[[ peasant1 = birth(peasant1) change_love(peasant1, 20) print(peasant1.name) @@ -75,6 +76,7 @@ print(peasant3.name) civilisation = {peasant1, peasant2, peasant3} calc_glove(civilisation) print(glove) +]]-- --[[ Notes: diff --git a/lua_testbay/peasant.lua b/lua_testbay/peasant.lua index f7d4977..8e35a18 100644 --- a/lua_testbay/peasant.lua +++ b/lua_testbay/peasant.lua @@ -3,7 +3,7 @@ ©LazyProggers ]]-- --- Required libaries +-- LIBARIES require "math" -- Start of the peasant class and methods @@ -11,10 +11,10 @@ require "math" math.randomseed(os.time()) -- Seed the random function with the time math.random(); math.random(); math.random() -- To avoid an error, where the "random" number equals 1 generate 3 numbers first --- Standard blueprint variables: +-- VARIABLES names = {"Daniel", "Bruno", "Clemens", "Toelpel", "Nichtsnutz", "Idiot", "Dumbaf"} -- All possible names are cached in this table --- Basic functions +-- FUNCTIONS function checkvalues(peasant_id) if peasant_id.love > 100 then peasant_id.love = 100 end -- Check if the love is over 100% and if yes correct it if peasant_id.love < 0 then peasant_id.love = 0 end -- Check if the love is under 0% and if yes correct it @@ -40,7 +40,7 @@ function change_love(peasant_id, lovevalue) return peasant_id end --- Testing area: +-- TESTING AREA --[[ testguy = birth(testguy) -- Create a monser... or a testguy change_love(testguy, 5) -- Give him his first lovepoints diff --git a/lua_testbay/template_luascript.lua b/lua_testbay/template_luascript.lua index 60089cf..6759643 100644 --- a/lua_testbay/template_luascript.lua +++ b/lua_testbay/template_luascript.lua @@ -3,13 +3,17 @@ ©LazyProggers ]]-- --- Required libaries (uncomment to use) +-- 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 NAME.lua program --- Testing area: +-- VARIABLES + +-- FUNCTIONS + +-- TESTING AREA --[[ Notes: diff --git a/lua_testbay/calc.lua b/lua_testbay/testcalc.lua similarity index 100% rename from lua_testbay/calc.lua rename to lua_testbay/testcalc.lua