| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-07-20 00:51:37 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-07-20 00:51:37 +0200 |
| commit | 39fc3eb50f3984bb128439a2cf190e51267529d9 (patch) | |
| tree | b8a36bad9b60a480c1b6fafcbd73200cd498e354 /data | |
| parent | 99171d9707c58c4f9841a00bf6fd22c4660a81e4 (diff) | |
Simplifies refs, adds remaining missing stuff.
Diffstat (limited to 'data')
| -rw-r--r-- | data/examples/the_thief/include/characters.fate | 31 | ||||
| -rw-r--r-- | data/examples/the_thief/include/locations.fate | 39 | ||||
| -rw-r--r-- | data/examples/the_thief/include/type/character.fate | 4 | ||||
| -rw-r--r-- | data/examples/the_thief/include/type/location.fate | 14 |
4 files changed, 65 insertions, 23 deletions
diff --git a/data/examples/the_thief/include/characters.fate b/data/examples/the_thief/include/characters.fate index 37dea7d..650f253 100644 --- a/data/examples/the_thief/include/characters.fate +++ b/data/examples/the_thief/include/characters.fate @@ -10,57 +10,48 @@ (require include/locations.fate) -(set_fields - (variable oscar) +(set_fields oscar (name Oscar) (agility 50) (perception 50) (money 20) - (location room0) ) +(add (ref oscar) room0.occupants) -(set_fields - (variable carla) +(set_fields carla (name Carla) (agility 75) (perception 35) (money 7) - (location room1) ) +(add (ref carla) room1.occupants) -(set_fields - (variable simon) +(set_fields simon (name Simon) (agility 35) (perception 75) (money 80) - (location room1) ) +(add (ref simon) room2.occupants) -(set_fields - (variable julie) +(set_fields julie (name Julie) (agility 60) (perception 60) (money 90) - (location room2) ) +(add (ref julie) corridor.occupants) -(set_fields - (variable statue) + +(set_fields statue (name ( A oddly human shaped statue, with clothes adorned )) (agility 0) (perception 0) (money 30) - (location corridor) ) - -;; Alright, but we clearly need to be able to point to variables using a type. -;; like (pointer (variable carla)) -> pointer to variable of type character -;; (a string, really) resolves to (variable carla), but allows characters to be -;; put in a set, for example. +(add (ref statue) corridor.occupants) diff --git a/data/examples/the_thief/include/locations.fate b/data/examples/the_thief/include/locations.fate index d7beb18..e46c504 100644 --- a/data/examples/the_thief/include/locations.fate +++ b/data/examples/the_thief/include/locations.fate @@ -1,2 +1,41 @@ (fate_version 1) +(require type/location.fate) + +(declare_variable local location room0) +(declare_variable local location room1) +(declare_variable local location room2) +(declare_variable local location corridor) + +(set_fields room0 + (name ( Room 0 )) + (description + ( An luxurious bedroom, well lit. ) + ) + (luminosity 80) +) + +(set_fields room1 + (name ( Room 1 )) + (description + ( An overly large kitchen, unevenly lit. ) + ) + (luminosity 35) +) + +(set_fields room2 + (name ( Room 2 )) + (description + ( An tiny and messy study, unlit. ) + ) + (luminosity 0) +) + +(set_fields corridor + (name Corridor) + (description + ( A long corridor, with many decorations, and many hiding places. ) + ) + (luminosity 50) +) + diff --git a/data/examples/the_thief/include/type/character.fate b/data/examples/the_thief/include/type/character.fate index 5882fd5..6278ad9 100644 --- a/data/examples/the_thief/include/type/character.fate +++ b/data/examples/the_thief/include/type/character.fate @@ -1,12 +1,12 @@ (fate_version 1) (require stat.fate) -(require location.fate) (declare_dict_type character (string name) (stat agility) (stat perception) (int money) - (location location) ) + +(declare_ref_type character character_ptr) diff --git a/data/examples/the_thief/include/type/location.fate b/data/examples/the_thief/include/type/location.fate index faec74a..9db494f 100644 --- a/data/examples/the_thief/include/type/location.fate +++ b/data/examples/the_thief/include/type/location.fate @@ -1,3 +1,15 @@ (fate_version 1) -(declare_set_type string location) +(require character.fate) + +(declare_set_type character_ptr occupants) +(declare_subtype int luminosity) + +(declare_dict_type location + (string name) + (string description) + (luminosity luminosity) + (occupants occupants) +) + +(declare_ref_type location location_ptr) |


