game.nv
· 1.1 KiB · Text
Sin formato
Playground
||:@include: lib/math.nv
| :enemies: spawn enemies |
:enemies: automaton hp 10
:enemies: slime hp 4
:enemies: skeleton hp 5
|# handle player stats #|
|| :player atk: 1
| :equipped: sword? :player atk: 1|
:player atk: 5
|# handle attacking enemies #|
| :actions: attack $enemy :enemies: $enemy hp $val :player atk: $dmg?|
:enemies: $enemy hp temp :@math: subtract $val $dmg
| :enemies: $name hp temp :@math: $val |
:enemies: $name hp $val
|# searching for item #|
| :actions: equip $item :equipment: $item|
:equipped: $item
:actions: re-pack equipment
:log: equipped sword
| :actions: equip $item? :equipment: $other|
:temp equipment: $other
:log: looking for $item put $other in temp
| :actions: equip $item|
:actions: re-pack equipment
:log: failed to equip $item
|# rules to restore equipment after search #|
| :actions: re-pack equipment? :temp equipment: $item |
:equipment: $item
| :actions: re-pack equipment |
:log: cleanup finished
|| :enemies: spawn enemies
|| :equipment: ( apple sword )
|| :actions: equip egg
|| :actions: equip sword
|| :actions: attack automaton
| 1 | ||:@include: lib/math.nv |
| 2 | |
| 3 | | :enemies: spawn enemies | |
| 4 | :enemies: automaton hp 10 |
| 5 | :enemies: slime hp 4 |
| 6 | :enemies: skeleton hp 5 |
| 7 | |
| 8 | |# handle player stats #| |
| 9 | || :player atk: 1 |
| 10 | | :equipped: sword? :player atk: 1| |
| 11 | :player atk: 5 |
| 12 | |
| 13 | |# handle attacking enemies #| |
| 14 | | :actions: attack $enemy :enemies: $enemy hp $val :player atk: $dmg?| |
| 15 | :enemies: $enemy hp temp :@math: subtract $val $dmg |
| 16 | |
| 17 | | :enemies: $name hp temp :@math: $val | |
| 18 | :enemies: $name hp $val |
| 19 | |
| 20 | |# searching for item #| |
| 21 | | :actions: equip $item :equipment: $item| |
| 22 | :equipped: $item |
| 23 | :actions: re-pack equipment |
| 24 | :log: equipped sword |
| 25 | |
| 26 | | :actions: equip $item? :equipment: $other| |
| 27 | :temp equipment: $other |
| 28 | :log: looking for $item put $other in temp |
| 29 | |
| 30 | | :actions: equip $item| |
| 31 | :actions: re-pack equipment |
| 32 | :log: failed to equip $item |
| 33 | |
| 34 | |# rules to restore equipment after search #| |
| 35 | | :actions: re-pack equipment? :temp equipment: $item | |
| 36 | :equipment: $item |
| 37 | |
| 38 | | :actions: re-pack equipment | |
| 39 | :log: cleanup finished |
| 40 | |
| 41 | || :enemies: spawn enemies |
| 42 | || :equipment: ( apple sword ) |
| 43 | || :actions: equip egg |
| 44 | || :actions: equip sword |
| 45 | || :actions: attack automaton |