-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoneGEN.lua
More file actions
51 lines (40 loc) · 924 Bytes
/
DoneGEN.lua
File metadata and controls
51 lines (40 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
print("Welcome to DoneGEN, a (hopfully) procedural generated dungeon craller.")
w1 = true -- while loop set
difficulty = 0
pHP = 20 -- Player HealthPoints
eHP = 1 -- Enemy HealthPoints
lvl = 1 -- player LeVeL
maxHP = 20 -- max player HP
function fightGen(difficulty, lvl, pHP)
eHP = 5 * difficulty
while w2 =< difficulty do -- why?! just work! >:/
w2 = w2 + 1
if eHP > 0 then
pHP = pHP - difficulty
eHP = eHP - 2 * lvl
end
end
return pHP
end
while w1 == true do
-- difficulty select
print("Difficulty? (1-5)")
n1 = tonumber(io.read())
if n1 < 1 then
print("Number can not be under 1")
elseif n1 > 5 then
print("Number can not be over 5")
else
difficulty = n1
print("Difficulty:")
print(difficulty)
w1 = false
end
end
while pHP > 0
pHP = fightGen(difficulty, lvl, pHP)
print("Level:")
print(lvl)
print("HP:")
print(pHP)
print("Game Over")