From: Lukas Krickl Date: Tue, 9 Jun 2020 10:36:02 +0000 (+0200) Subject: Fixed player being able to kill dragon on any map X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=694dfcb968cc62a046c7a8dc756e5cc8da445143;p=10LineAdventure%2F.git Fixed player being able to kill dragon on any map --- diff --git a/10lineadv.lua b/10lineadv.lua index 29b7a59..7631613 100644 --- a/10lineadv.lua +++ b/10lineadv.lua @@ -4,7 +4,7 @@ a, m = {"open chest", "get sword", "look", 'inspect', 'get sword'}, {north=1, s while input ~= 'quit' do io.write('You are in a ') io.write(l[i]); io.write('\n?'); input = io.read() if m[input] ~= nil then i = m[input]; io.write(string.format("%s %s\n", x[2], input)); elseif input == a[3] then print((p==2 and i == 4) and x[6] or y[i]) elseif input == a[5] and i == 4 then print(x[6]);p=3 - elseif input == 'kill dragon' then print(((p ~= 3) and 'You died.' or 'You win!'));break + elseif input == 'kill dragon' and i == 2 then print(((p ~= 3) and 'You died.' or 'You win!'));break elseif input == 'inventory'then print(((p >= 1) and x[5]or''),((p >= 3) and x[6]or'')) elseif a[1] and i == 4 then print((p < 1) and x[4] or x[3]); if p >= 1 then p = 2 end elseif input == a[4] and i == 3 and p < 1 then print(x[5]);p=1 else print(x[1]) end end