Update example game some, update engine some
* Add RevealAction/UnrevealAction for revealing/hiding items in a room * Add a lot of checks for items being revealed when it's attempted to be triggered * Implement TeleportAction (mostly) * For all Check* family of actions, the `yes` and `no` values may be just be a single action instead of an array of actions * Change up how room descriptions and stuff work, mostly so that you can specify multiple lines in an array so you can preserve paragraph breaks when displayed. * Example game has some more content Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import dataclasses
|
||||
from typing import Mapping, Optional, Sequence
|
||||
from typing import Mapping, Optional, Sequence, Union
|
||||
from agame.action import Action
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class ItemInst:
|
||||
return self.item.synonyms
|
||||
|
||||
@property
|
||||
def room_desc(self) -> Optional[str]:
|
||||
def room_desc(self) -> Optional[Union[str, Sequence[str]]]:
|
||||
return self.item.room_desc
|
||||
|
||||
@property
|
||||
@@ -87,7 +87,7 @@ class Item:
|
||||
#
|
||||
# Otherwise, the `room_desc` string will be colorized and printed as
|
||||
# written.
|
||||
room_desc: Optional[str] = None
|
||||
room_desc: Optional[Union[str, Sequence[str]]] = None
|
||||
|
||||
# A list of triggers that a game may use. Since this is just a mapping of
|
||||
# strings to action sequences, only one set of actions is allowed per
|
||||
|
||||
Reference in New Issue
Block a user