| summaryrefslogtreecommitdiff | 
diff options
Diffstat (limited to 'data/examples/monster_battle')
| -rw-r--r-- | data/examples/monster_battle/battle.fate | 5 | ||||
| -rw-r--r-- | data/examples/monster_battle/in_your_room.fate | 92 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/attacks.fate | 3 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/creatures.fate | 30 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/events.fate | 3 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/items.fate | 13 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/player.fate | 5 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/progress.fate | 5 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/text_effects.fate | 5 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/types/attack.fate | 11 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/types/creature.fate | 17 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/types/element.fate | 13 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/types/item.fate | 9 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/types/player.fate | 10 | ||||
| -rw-r--r-- | data/examples/monster_battle/include/types/tag.fate | 5 | ||||
| -rw-r--r-- | data/examples/monster_battle/main.fate | 25 | 
16 files changed, 251 insertions, 0 deletions
| diff --git a/data/examples/monster_battle/battle.fate b/data/examples/monster_battle/battle.fate new file mode 100644 index 0000000..cfdce39 --- /dev/null +++ b/data/examples/monster_battle/battle.fate @@ -0,0 +1,5 @@ +(fate_version 1) + +(define_sequence start_battle +   nothing yet +) diff --git a/data/examples/monster_battle/in_your_room.fate b/data/examples/monster_battle/in_your_room.fate new file mode 100644 index 0000000..8f30a00 --- /dev/null +++ b/data/examples/monster_battle/in_your_room.fate @@ -0,0 +1,92 @@ +(fate_version 1) + +(require include/creatures.fate) +(require include/events.fate) +(require include/items.fate) +(require include/player.fate) +(require include/progress.fate) +(require include/text_effects.fate) + +(require battle.fate) + +(define_sequence in_your_room +   (ifelse +      (is_member visited_your_room progress) +      (text_effect narrator +         You room is still a mess. You don't have time to clean things up, +         though. +      ) +      (text_effect narrator +         You room is a mess. You recall having been through every drawer while +         preparing your bag yesterday. While still unclear on how you are +         supposed to pack all the necessary things for what promises to be at +         least a year-long journey inside a small backpack, you cannot avoid +         but wasting more time contemplating the piles of items that didn't +         make the cut. +      ) +   ) +   (add visited_your_room progress) +   (player_choice +      ( +         ( Look for healing items ) +         (sequence look_for_healing_items) +      ) +      ( +         ( No time! Let's go adventuring! ) +         (sequence leave_your_room) +      ) +   ) +) + +(define_sequence look_for_healing_items +   (text_effect narrator +      You anxiously alternate between looking at the clock and looking at piles +      of mess for healing items. +      (newline) +   ) +   (ifelse +      (=< (rand 0 99) 25) +      ( +         (text_effect surprise +            (text_effect narrator +               Oh! You found something! +            ) +         ) +         (macro get_item (ref (var potion))) +      ) +      (text_effect narrator +         No, you don't find anything. +      ) +   ) +   (sequence in_your_room) +) + +(define_sequence leave_your_room +   (text_effect narrator +      As you rush through the door of your room, you fail to notice the obstacle +      in your path and trip on something that was clearly meant for you. +   ) +   (event pause) +   (text_effect narrator +      It's a monster-holder! There's a note, too. +   ) +   (macro generate_random_creature (var player.creature)) +   (event pause) +   (text_effect note_reading +      Hey sleepyhead. I couldn't wake you up for your big day, but lucky you, +      someone noticed that you weren't going to make it in time and got this for +      you. +      (newline) +      Looks like it's a (variable player.creature.name). Good for you! My first +      creature may not have been as powerful, but I wouldn't trade it for +      anything. +      (newline) +      Now go! Aand don't come back until you've achieved your dreams! +   ) +   (text_effect narrator +      Teary eyed, you pick up the monster-holder and leave your house. And +      immediately get challenged by some grinning kid who clearly knew you +      haven't had time to train and wants to score an easy victory. +   ) +   (sequence start_battle) +) diff --git a/data/examples/monster_battle/include/attacks.fate b/data/examples/monster_battle/include/attacks.fate new file mode 100644 index 0000000..8104727 --- /dev/null +++ b/data/examples/monster_battle/include/attacks.fate @@ -0,0 +1,3 @@ +(fate_version 1) + +(require types/attack.fate) diff --git a/data/examples/monster_battle/include/creatures.fate b/data/examples/monster_battle/include/creatures.fate new file mode 100644 index 0000000..2ce30c9 --- /dev/null +++ b/data/examples/monster_battle/include/creatures.fate @@ -0,0 +1,30 @@ +(fate_version 1) + +(require types/creature.fate) + +(declare_variable creature monster_0) +(declare_variable creature monster_1) +(declare_variable creature monster_2) +(declare_variable creature monster_3) +(declare_variable creature monster_4) +(declare_variable creature monster_5) + +(declare_variable int i) + +(define_macro generate_random_creature +   ( +      (creature creature) +   ) + +   (set i (rand 0 5)) +   (set (param creature) +      (cond +         ((= (var i) 0) (var monster_0)) +         ((= (var i) 1) (var monster_1)) +         ((= (var i) 2) (var monster_2)) +         ((= (var i) 3) (var monster_3)) +         ((= (var i) 4) (var monster_4)) +         ((= (var i) 5) (var monster_5)) +      ) +   ) +) diff --git a/data/examples/monster_battle/include/events.fate b/data/examples/monster_battle/include/events.fate new file mode 100644 index 0000000..3749427 --- /dev/null +++ b/data/examples/monster_battle/include/events.fate @@ -0,0 +1,3 @@ +(fate_version 1) + +(declare_event_type pause) diff --git a/data/examples/monster_battle/include/items.fate b/data/examples/monster_battle/include/items.fate new file mode 100644 index 0000000..3ddca93 --- /dev/null +++ b/data/examples/monster_battle/include/items.fate @@ -0,0 +1,13 @@ +(fate_version 1) + +(require types/item.fate) +(require player.fate) + +(declare_variable item potion) + +(define_macro get_item +   ( +      (item_ptr item) +   ) +   (add (param item) player.inventory) +) diff --git a/data/examples/monster_battle/include/player.fate b/data/examples/monster_battle/include/player.fate new file mode 100644 index 0000000..18e46dc --- /dev/null +++ b/data/examples/monster_battle/include/player.fate @@ -0,0 +1,5 @@ +(fate_version 1) + +(require types/player.fate) + +(define_variable player player) diff --git a/data/examples/monster_battle/include/progress.fate b/data/examples/monster_battle/include/progress.fate new file mode 100644 index 0000000..ee08320 --- /dev/null +++ b/data/examples/monster_battle/include/progress.fate @@ -0,0 +1,5 @@ +(fate_version 1) + +(require types/tag.fate) + +(define_variable tag_collection progress) diff --git a/data/examples/monster_battle/include/text_effects.fate b/data/examples/monster_battle/include/text_effects.fate new file mode 100644 index 0000000..22ed582 --- /dev/null +++ b/data/examples/monster_battle/include/text_effects.fate @@ -0,0 +1,5 @@ +(fate_version 1) + +(declare_text_effect narrator) +(declare_text_effect note_reading) +(declare_text_effect surprise) diff --git a/data/examples/monster_battle/include/types/attack.fate b/data/examples/monster_battle/include/types/attack.fate new file mode 100644 index 0000000..da273ad --- /dev/null +++ b/data/examples/monster_battle/include/types/attack.fate @@ -0,0 +1,11 @@ +(fate_version 1) + +(require element.fate) + +(declare_dict_type attack +   (string name) +   (element_ptr element) +   (int power) +) + +(declare_ref_type attack attack_ptr) diff --git a/data/examples/monster_battle/include/types/creature.fate b/data/examples/monster_battle/include/types/creature.fate new file mode 100644 index 0000000..ad7c957 --- /dev/null +++ b/data/examples/monster_battle/include/types/creature.fate @@ -0,0 +1,17 @@ +(fate_version 1) + +(require element.fate) +(require attack.fate) + +(declare_dict_type creature +   (string name) +   (int current_health) +   (int max_health) +   (element_ptr element) +   (attack_ptr attack_0) +   (attack_ptr attack_1) +   (attack_ptr attack_2) +   (attack_ptr attack_3) +) + +(declare_ref_type creature creature_ptr) diff --git a/data/examples/monster_battle/include/types/element.fate b/data/examples/monster_battle/include/types/element.fate new file mode 100644 index 0000000..7500b16 --- /dev/null +++ b/data/examples/monster_battle/include/types/element.fate @@ -0,0 +1,13 @@ +(fate_version 1) + +(declare_subtype string element_name) + +(declare_set_type element_name element_name_set) + +(declare_dict_type element +   (element_name name) +   (element_name_set strong_against) +   (element_name_set weak_against) +) + +(declare_ref_type element element_ptr) diff --git a/data/examples/monster_battle/include/types/item.fate b/data/examples/monster_battle/include/types/item.fate new file mode 100644 index 0000000..0b50475 --- /dev/null +++ b/data/examples/monster_battle/include/types/item.fate @@ -0,0 +1,9 @@ +(fate_version 1) + +(declare_dict_type item +   (string name) +   (int price) +) + +(declare_ref_type item item_ptr) +(declare_list_type item_ptr item_ptr_list) diff --git a/data/examples/monster_battle/include/types/player.fate b/data/examples/monster_battle/include/types/player.fate new file mode 100644 index 0000000..2573c38 --- /dev/null +++ b/data/examples/monster_battle/include/types/player.fate @@ -0,0 +1,10 @@ +(fate_version 1) + +(require item.fate) +(require creature.fate) + +(define_dict_type player +   (creature creature) +   (item_ptr_list inventory) +   (int money) +) diff --git a/data/examples/monster_battle/include/types/tag.fate b/data/examples/monster_battle/include/types/tag.fate new file mode 100644 index 0000000..8cca7fe --- /dev/null +++ b/data/examples/monster_battle/include/types/tag.fate @@ -0,0 +1,5 @@ +(fate_version 1) + +(define_subtype string tag) + +(define_set_type tag tag_collection) diff --git a/data/examples/monster_battle/main.fate b/data/examples/monster_battle/main.fate new file mode 100644 index 0000000..e77e734 --- /dev/null +++ b/data/examples/monster_battle/main.fate @@ -0,0 +1,25 @@ +(fate_version 1) + +(require include/events.fate) +(require include/text_effects.fate) + +(require in_your_room.fate) + +(text_effect narrator +   After failing to sleep because of the anticipation, you overslept. +   Today was supposed to be glorious! At long last, you were going on your +   life-defining adventure with a powerful companion. +) +(event pause) +(text_effect narrator +   ... +) +(event pause) +(text_effect narrator +   Maybe you should stop daydreaming and see what can be salvaged at this point. +) +(event pause) +(text_effect narrator +   You stand in your room, having just dressed. +) +(sequence in_your_room) | 


