diff options
Diffstat (limited to '')
-rw-r--r-- | bloodfields.stage | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/bloodfields.stage b/bloodfields.stage new file mode 100644 index 0000000..81ff6e1 --- /dev/null +++ b/bloodfields.stage | |||
@@ -0,0 +1,162 @@ | |||
1 | game.title = "Bloodfields"; | ||
2 | |||
3 | global | ||
4 | { | ||
5 | command: "quit" | ||
6 | { | ||
7 | exit(); | ||
8 | } | ||
9 | } | ||
10 | |||
11 | situation <<start>> | ||
12 | { | ||
13 | setup | ||
14 | { | ||
15 | player.hpMax = 10; | ||
16 | player.hpCur = player.hpMax; | ||
17 | player.xp = 0; | ||
18 | player.attack = 3; | ||
19 | |||
20 | global.bJustTravelled = false; | ||
21 | |||
22 | goto( <<field>> ); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | function status() | ||
27 | { | ||
28 | display('You have ' + player.hpCur + ' of ' + player.hpMax + ' hp.'); | ||
29 | } | ||
30 | |||
31 | function look() | ||
32 | { | ||
33 | if( exists(global.enemy) )then | ||
34 | { | ||
35 | display('''You are standing in a field of wheat. You see a ''' + | ||
36 | global.enemy['name'] + ''' in front of you.'''); | ||
37 | } | ||
38 | else | ||
39 | { | ||
40 | display('''You are standing in a field of wheat.'''); | ||
41 | } | ||
42 | // status(); | ||
43 | } | ||
44 | |||
45 | function mkEnemy() | ||
46 | { | ||
47 | global.enemy = { | ||
48 | 'name': 'Snail', | ||
49 | 'weapon': 'Tooth', | ||
50 | 'attack': 3, | ||
51 | 'hp': 5 | ||
52 | }; | ||
53 | } | ||
54 | |||
55 | function rollAttack( attack ) | ||
56 | { | ||
57 | return( random( attack-attack/3, attack+attack/3 ) ); | ||
58 | } | ||
59 | |||
60 | function playerAttack() | ||
61 | { | ||
62 | damage = rollAttack( player.attack ); | ||
63 | global.enemy['hp'] = global.enemy['hp'] - damage; | ||
64 | display('You strike the ' + global.enemy['name'] + ' for ' + damage + | ||
65 | ' damage.'); | ||
66 | if global.enemy['hp'] <= 0 then | ||
67 | { | ||
68 | display('You killed the ' + global.enemy['name'] + '!'); | ||
69 | delete( global.enemy ); | ||
70 | } | ||
71 | } | ||
72 | |||
73 | function enemyAttack() | ||
74 | { | ||
75 | damage = rollAttack( global.enemy['attack'] ); | ||
76 | player.hpCur -= damage; | ||
77 | display("The " + global.enemy['name'] + ' strikes you for ' + damage + | ||
78 | ' damage.'); | ||
79 | if player.hpCur <= 0 then | ||
80 | { | ||
81 | display('The ' + global.enemy['name'] + ' killed you!'); | ||
82 | exit(); | ||
83 | } | ||
84 | } | ||
85 | |||
86 | situation <<travel>> | ||
87 | { | ||
88 | enter | ||
89 | { | ||
90 | delete( global.enemy ); | ||
91 | |||
92 | display('You wander aimlessly through the seemingly endless field of wheat.'); | ||
93 | |||
94 | select = random(1,3); | ||
95 | if select == 1 then | ||
96 | { | ||
97 | mkEnemy(); | ||
98 | display('''There's a ''' + global.enemy['name'] + ''' here!'''); | ||
99 | } | ||
100 | |||
101 | global.bJustTravelled = true; | ||
102 | |||
103 | goto( <<field>> ); | ||
104 | } | ||
105 | } | ||
106 | |||
107 | situation <<field>> | ||
108 | { | ||
109 | command: "attack" | ||
110 | { | ||
111 | if exists(global.enemy) then | ||
112 | { | ||
113 | playerAttack(); | ||
114 | goto( <<field>> ); | ||
115 | } | ||
116 | else | ||
117 | { | ||
118 | display('''There's nothing here to attack...'''); | ||
119 | } | ||
120 | } | ||
121 | |||
122 | command: "look" | ||
123 | { | ||
124 | look(); | ||
125 | } | ||
126 | |||
127 | command: "walk" | ||
128 | { | ||
129 | if not exists(global.enemy) then | ||
130 | { | ||
131 | goto( <<travel>> ); | ||
132 | } | ||
133 | else | ||
134 | { | ||
135 | display("You can't walk around with an enemy in front of you! | ||
136 | You can try to flee if you'd like..."); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | setup | ||
141 | { | ||
142 | look(); | ||
143 | } | ||
144 | |||
145 | enter | ||
146 | { | ||
147 | if not global.bJustTravelled then | ||
148 | { | ||
149 | if exists( global.enemy ) then | ||
150 | { | ||
151 | enemyAttack(); | ||
152 | } | ||
153 | status(); | ||
154 | // look(); | ||
155 | } | ||
156 | else | ||
157 | { | ||
158 | } | ||
159 | global.bJustTravelled = false; | ||
160 | } | ||
161 | } | ||
162 | |||