Fixed player being able to kill dragon on any map master origin/HEAD origin/master
authorLukas Krickl <lukaskrickl@gmail.com>
Tue, 9 Jun 2020 10:36:02 +0000 (12:36 +0200)
committerLukas Krickl <lukaskrickl@gmail.com>
Tue, 9 Jun 2020 10:36:02 +0000 (12:36 +0200)
10lineadv.lua

index 29b7a597cfef2aa719c7286beb7fb42336cfaaf0..7631613f676f97d13e50df41a2cb4f85b24641ff 100644 (file)
@@ -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