diff options
Diffstat (limited to 'bloodfields.stage')
-rw-r--r-- | bloodfields.stage | 58 |
1 files changed, 50 insertions, 8 deletions
diff --git a/bloodfields.stage b/bloodfields.stage index 81ff6e1..7b61dd4 100644 --- a/bloodfields.stage +++ b/bloodfields.stage | |||
@@ -12,6 +12,45 @@ situation <<start>> | |||
12 | { | 12 | { |
13 | setup | 13 | setup |
14 | { | 14 | { |
15 | global.enemyTypes = { | ||
16 | 1: { | ||
17 | 'name': 'Snail', | ||
18 | 'action': 'bites', | ||
19 | 'hp': 3, | ||
20 | 'attack': 2 | ||
21 | }, | ||
22 | 2: { | ||
23 | 'name': 'Wolf', | ||
24 | 'action': 'bites', | ||
25 | 'hp': 7, | ||
26 | 'attack': 3 | ||
27 | }, | ||
28 | 3: { | ||
29 | 'name': 'Snake', | ||
30 | 'action': 'strikes at', | ||
31 | 'hp': 3, | ||
32 | 'attack': 3 | ||
33 | } | ||
34 | }; | ||
35 | |||
36 | global.enemyMods = { | ||
37 | 1: { | ||
38 | 'name': 'Pathetic', | ||
39 | 'hp': 0, | ||
40 | 'attack': 0 | ||
41 | }, | ||
42 | 2: { | ||
43 | 'name': 'Sickly', | ||
44 | 'hp': 3, | ||
45 | 'attack': 1 | ||
46 | }, | ||
47 | 3: { | ||
48 | 'name': 'Wimpy', | ||
49 | 'hp': 5, | ||
50 | 'attack': 2 | ||
51 | } | ||
52 | }; | ||
53 | |||
15 | player.hpMax = 10; | 54 | player.hpMax = 10; |
16 | player.hpCur = player.hpMax; | 55 | player.hpCur = player.hpMax; |
17 | player.xp = 0; | 56 | player.xp = 0; |
@@ -44,12 +83,15 @@ function look() | |||
44 | 83 | ||
45 | function mkEnemy() | 84 | function mkEnemy() |
46 | { | 85 | { |
47 | global.enemy = { | 86 | eid = random( 1, 3 ); |
48 | 'name': 'Snail', | 87 | global.enemy = global.enemyTypes[eid]; |
49 | 'weapon': 'Tooth', | 88 | |
50 | 'attack': 3, | 89 | mod = 1; |
51 | 'hp': 5 | 90 | global.enemy['name'] = global.enemyMods[mod]['name'] + ' ' + |
52 | }; | 91 | global.enemy['name']; |
92 | global.enemy['attack'] = global.enemy['attack'] + | ||
93 | global.enemyMods[mod]['attack']; | ||
94 | global.enemy['hp'] = global.enemy['hp'] + global.enemyMods[mod]['hp']; | ||
53 | } | 95 | } |
54 | 96 | ||
55 | function rollAttack( attack ) | 97 | function rollAttack( attack ) |
@@ -74,8 +116,8 @@ function enemyAttack() | |||
74 | { | 116 | { |
75 | damage = rollAttack( global.enemy['attack'] ); | 117 | damage = rollAttack( global.enemy['attack'] ); |
76 | player.hpCur -= damage; | 118 | player.hpCur -= damage; |
77 | display("The " + global.enemy['name'] + ' strikes you for ' + damage + | 119 | display("The " + global.enemy['name'] + ' ' + global.enemy['action'] + |
78 | ' damage.'); | 120 | ' you for ' + damage + ' damage.'); |
79 | if player.hpCur <= 0 then | 121 | if player.hpCur <= 0 then |
80 | { | 122 | { |
81 | display('The ' + global.enemy['name'] + ' killed you!'); | 123 | display('The ' + global.enemy['name'] + ' killed you!'); |