Skip to content
This repository has been archived by the owner on Nov 8, 2020. It is now read-only.

Commit

Permalink
Minor Template Change
Browse files Browse the repository at this point in the history
Changed lua template and adjusted the existent docs this way.
  • Loading branch information
creyD committed May 3, 2017
1 parent ef71c0a commit e5fa33a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
10 changes: 6 additions & 4 deletions lua_testbay/gamer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -75,6 +76,7 @@ print(peasant3.name)
civilisation = {peasant1, peasant2, peasant3}
calc_glove(civilisation)
print(glove)
]]--

--[[
Notes:
Expand Down
8 changes: 4 additions & 4 deletions lua_testbay/peasant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
©LazyProggers
]]--

-- Required libaries
-- LIBARIES
require "math"

-- Start of the peasant class and methods
-- Lua stuff (to make this work correctly)
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
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions lua_testbay/template_luascript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.

0 comments on commit e5fa33a

Please sign in to comment.