From fcd30be44982cfe79ed777b19b2543fe3e72e239 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Jan 2012 00:37:48 -0700 Subject: +=, -=, *=, /= works with indexed dicts/lists --- bloodfields.stage | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'bloodfields.stage') diff --git a/bloodfields.stage b/bloodfields.stage index 91bee08..58a24a2 100644 --- a/bloodfields.stage +++ b/bloodfields.stage @@ -78,21 +78,15 @@ function status() function look() { + display('''You are standing in a field of wheat.'''); if exists(global.enemy) then { - display('''You are standing in a field of wheat. You see a ''' + - global.enemy['name'] + ''' in front of you.'''); + display('You see a ' + global.enemy['name'] + ' in front of you.'); } else if exists( global.treasure ) then { - display('''You are standing in a field of wheat. You find a ''' + - global.treasure['name'] + ''' lying here!'''); + display('You find a ' + global.treasure['name'] + ' lying here!'); } - else - { - display('''You are standing in a field of wheat.'''); - } -// status(); } function mkEnemy() @@ -107,9 +101,8 @@ function mkEnemy() } global.enemy['name'] = global.enemyMods[mod]['name'] + ' ' + global.enemy['name']; - global.enemy['attack'] = global.enemy['attack'] + - global.enemyMods[mod]['attack']; - global.enemy['hp'] = global.enemy['hp'] + global.enemyMods[mod]['hp']; + global.enemy['attack'] += global.enemyMods[mod]['attack']; + global.enemy['hp'] += global.enemyMods[mod]['hp']; global.enemy['level'] = mod; } @@ -137,7 +130,7 @@ function playerAttack() display('You killed the ' + global.enemy['name'] + '! You gained ' + xp + ' experience points.'); player.xp += xp; - if player.xp >= 100 then + while player.xp >= 100 do { player.xp -= 100; player.level += 1; @@ -176,16 +169,12 @@ function enemyAttack() situation <> { - command: "hi" - { - display("Yup, you're in travel."); - } - enter { delete( global.enemy ); + delete( global.treasure ); - display('You wander aimlessly through the seemingly endless field of wheat.'); + display('You wander aimlessly through the endless field of wheat.'); select = random(1,6); if select <= 4 then // 66% of the time, enemy! -- cgit v1.2.3