From 340de5ebabbc60727b2aeb85b9faa72a75f1628b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 2 Jan 2012 08:37:51 -0700 Subject: Bloodfields, now with three types of monster! --- bloodfields.stage | 58 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 8 deletions(-) (limited to 'bloodfields.stage') diff --git a/bloodfields.stage b/bloodfields.stage index 81ff6e1..7b61dd4 100644 --- a/bloodfields.stage +++ b/bloodfields.stage @@ -12,6 +12,45 @@ situation <> { setup { + global.enemyTypes = { + 1: { + 'name': 'Snail', + 'action': 'bites', + 'hp': 3, + 'attack': 2 + }, + 2: { + 'name': 'Wolf', + 'action': 'bites', + 'hp': 7, + 'attack': 3 + }, + 3: { + 'name': 'Snake', + 'action': 'strikes at', + 'hp': 3, + 'attack': 3 + } + }; + + global.enemyMods = { + 1: { + 'name': 'Pathetic', + 'hp': 0, + 'attack': 0 + }, + 2: { + 'name': 'Sickly', + 'hp': 3, + 'attack': 1 + }, + 3: { + 'name': 'Wimpy', + 'hp': 5, + 'attack': 2 + } + }; + player.hpMax = 10; player.hpCur = player.hpMax; player.xp = 0; @@ -44,12 +83,15 @@ function look() function mkEnemy() { - global.enemy = { - 'name': 'Snail', - 'weapon': 'Tooth', - 'attack': 3, - 'hp': 5 - }; + eid = random( 1, 3 ); + global.enemy = global.enemyTypes[eid]; + + mod = 1; + 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']; } function rollAttack( attack ) @@ -74,8 +116,8 @@ function enemyAttack() { damage = rollAttack( global.enemy['attack'] ); player.hpCur -= damage; - display("The " + global.enemy['name'] + ' strikes you for ' + damage + - ' damage.'); + display("The " + global.enemy['name'] + ' ' + global.enemy['action'] + + ' you for ' + damage + ' damage.'); if player.hpCur <= 0 then { display('The ' + global.enemy['name'] + ' killed you!'); -- cgit v1.2.3