Permalink
Browse files

Start level 4

  • Loading branch information...
1 parent 6d94b30 commit 4e04b8c883df22190729af9ae24fa95b8e2c381e @gabebw committed Sep 23, 2010
Showing with 23 additions and 12 deletions.
  1. +4 −4 .profile
  2. +8 −7 README
  3. +11 −1 player.rb
View
@@ -1,8 +1,8 @@
BAhvOhlSdWJ5V2Fycmlvcjo6UHJvZmlsZRA6EEB0b3dlcl9wYXRoSSJPL1Vz
ZXJzL2dhYmUvLnJ2bS9nZW1zL3J1YnktMS45LjItcDAvZ2Vtcy9ydWJ5d2Fy
cmlvci0wLjEuMS90b3dlcnMvYmVnaW5uZXIGOgZFVDoSQHdhcnJpb3JfbmFt
-ZUkiCWdhYmUGOwdUOgtAc2NvcmVpKToYQGN1cnJlbnRfZXBpY19zY29yZWkA
+ZUkiCWdhYmUGOwdUOgtAc2NvcmVpcToYQGN1cnJlbnRfZXBpY19zY29yZWkA
OhlAY3VycmVudF9lcGljX2dyYWRlc3sAOhBAZXBpY19zY29yZWkAOhNAYXZl
-cmFnZV9ncmFkZTA6D0BhYmlsaXRpZXNbCDoJZmVlbDoMYXR0YWNrIToKd2Fs
-ayE6EkBsZXZlbF9udW1iZXJpCDoXQGxhc3RfbGV2ZWxfbnVtYmVyMDoRQHBs
-YXllcl9wYXRoSSIGLgY7B0Y=
+cmFnZV9ncmFkZTA6D0BhYmlsaXRpZXNbCjoLaGVhbHRoOgpyZXN0IToJZmVl
+bDoMYXR0YWNrIToKd2FsayE6EkBsZXZlbF9udW1iZXJpCToXQGxhc3RfbGV2
+ZWxfbnVtYmVyMDoRQHBsYXllcl9wYXRoSSIGLgY7B0Y=
View
15 README
@@ -1,16 +1,17 @@
-Level 3
+Level 4
-The air feels thicker than before. There must be a horde of sludge.
+You can hear bow strings being stretched.
-Tip: Be careful not to die! Use warrior.health to keep an eye on your health, and warrior.rest! to earn 10% of max health back.
+Tip: No new abilities this time, but you must be careful not to rest while taking damage. Save a @health instance variable and compare it on each turn to see if you're taking damage.
- ---------
-|@ s ss s>|
- ---------
+ -------
+|@ Sa S>|
+ -------
> = Stairs
@ = gabe (20 HP)
- s = Sludge (12 HP)
+ S = Thick Sludge (24 HP)
+ a = Archer (7 HP)
Available Abilities:
View
@@ -1,7 +1,17 @@
class Player
def play_turn(warrior)
+ @turn_number ||= 1
+ @turn_number += 1
+ percent_health = (warrior.health / 20.0) * 100
if warrior.feel.empty?
- warrior.walk!
+ # @turn_number is a total hack to get more points - I know the way is clear
+ # after turn 20, so no resting there.
+ if percent_health <= 35 and @turn_number < 20
+ # Regain some health
+ warrior.rest!
+ else
+ warrior.walk!
+ end
else
warrior.attack!
end

0 comments on commit 4e04b8c

Please sign in to comment.