diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-01-03 00:37:48 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-01-03 00:37:48 -0700 |
commit | fcd30be44982cfe79ed777b19b2543fe3e72e239 (patch) | |
tree | 1b8d5f5aebbf828d1da4a2c68c3ed22a40a7cbb7 /bloodfields.stage | |
parent | 8b9a15a755ebc6681ff6be808615e375cb567080 (diff) | |
download | stage-fcd30be44982cfe79ed777b19b2543fe3e72e239.tar.gz stage-fcd30be44982cfe79ed777b19b2543fe3e72e239.tar.bz2 stage-fcd30be44982cfe79ed777b19b2543fe3e72e239.tar.xz stage-fcd30be44982cfe79ed777b19b2543fe3e72e239.zip |
+=, -=, *=, /= works with indexed dicts/lists
Diffstat (limited to 'bloodfields.stage')
-rw-r--r-- | bloodfields.stage | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/bloodfields.stage b/bloodfields.stage index 91bee08..58a24a2 100644 --- a/bloodfields.stage +++ b/bloodfields.stage | |||
@@ -78,21 +78,15 @@ function status() | |||
78 | 78 | ||
79 | function look() | 79 | function look() |
80 | { | 80 | { |
81 | display('''You are standing in a field of wheat.'''); | ||
81 | if exists(global.enemy) then | 82 | if exists(global.enemy) then |
82 | { | 83 | { |
83 | display('''You are standing in a field of wheat. You see a ''' + | 84 | display('You see a ' + global.enemy['name'] + ' in front of you.'); |
84 | global.enemy['name'] + ''' in front of you.'''); | ||
85 | } | 85 | } |
86 | else if exists( global.treasure ) then | 86 | else if exists( global.treasure ) then |
87 | { | 87 | { |
88 | display('''You are standing in a field of wheat. You find a ''' + | 88 | display('You find a ' + global.treasure['name'] + ' lying here!'); |
89 | global.treasure['name'] + ''' lying here!'''); | ||
90 | } | 89 | } |
91 | else | ||
92 | { | ||
93 | display('''You are standing in a field of wheat.'''); | ||
94 | } | ||
95 | // status(); | ||
96 | } | 90 | } |
97 | 91 | ||
98 | function mkEnemy() | 92 | function mkEnemy() |
@@ -107,9 +101,8 @@ function mkEnemy() | |||
107 | } | 101 | } |
108 | global.enemy['name'] = global.enemyMods[mod]['name'] + ' ' + | 102 | global.enemy['name'] = global.enemyMods[mod]['name'] + ' ' + |
109 | global.enemy['name']; | 103 | global.enemy['name']; |
110 | global.enemy['attack'] = global.enemy['attack'] + | 104 | global.enemy['attack'] += global.enemyMods[mod]['attack']; |
111 | global.enemyMods[mod]['attack']; | 105 | global.enemy['hp'] += global.enemyMods[mod]['hp']; |
112 | global.enemy['hp'] = global.enemy['hp'] + global.enemyMods[mod]['hp']; | ||
113 | global.enemy['level'] = mod; | 106 | global.enemy['level'] = mod; |
114 | } | 107 | } |
115 | 108 | ||
@@ -137,7 +130,7 @@ function playerAttack() | |||
137 | display('You killed the ' + global.enemy['name'] + '! You gained ' + | 130 | display('You killed the ' + global.enemy['name'] + '! You gained ' + |
138 | xp + ' experience points.'); | 131 | xp + ' experience points.'); |
139 | player.xp += xp; | 132 | player.xp += xp; |
140 | if player.xp >= 100 then | 133 | while player.xp >= 100 do |
141 | { | 134 | { |
142 | player.xp -= 100; | 135 | player.xp -= 100; |
143 | player.level += 1; | 136 | player.level += 1; |
@@ -176,16 +169,12 @@ function enemyAttack() | |||
176 | 169 | ||
177 | situation <<travel>> | 170 | situation <<travel>> |
178 | { | 171 | { |
179 | command: "hi" | ||
180 | { | ||
181 | display("Yup, you're in travel."); | ||
182 | } | ||
183 | |||
184 | enter | 172 | enter |
185 | { | 173 | { |
186 | delete( global.enemy ); | 174 | delete( global.enemy ); |
175 | delete( global.treasure ); | ||
187 | 176 | ||
188 | display('You wander aimlessly through the seemingly endless field of wheat.'); | 177 | display('You wander aimlessly through the endless field of wheat.'); |
189 | 178 | ||
190 | select = random(1,6); | 179 | select = random(1,6); |
191 | if select <= 4 then // 66% of the time, enemy! | 180 | if select <= 4 then // 66% of the time, enemy! |