diff options
author | Griffin Smith <root@gws.fyi> | 2019-12-01T00·55-0500 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-12-01T00·55-0500 |
commit | 71b628c604556bc2d829f12980db99c9a526ec84 (patch) | |
tree | 2bd0b27810139c2fcf19813c0cf3f31100d5008f /src/Xanthous/Entities/Entities.hs | |
parent | 4431d453f61e88383aba40c8db3c4afb3c828b2e (diff) |
Add messages on the ground
Add support for a "GroundMessage" entity type, support for a Read command to read them, and randomly place an initial, tone-setting tutorial message on the ground near the character at the beginning of the game.
Diffstat (limited to 'src/Xanthous/Entities/Entities.hs')
-rw-r--r-- | src/Xanthous/Entities/Entities.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Xanthous/Entities/Entities.hs b/src/Xanthous/Entities/Entities.hs index 7e41fc8b7b3a..802aecddebdf 100644 --- a/src/Xanthous/Entities/Entities.hs +++ b/src/Xanthous/Entities/Entities.hs @@ -26,6 +26,7 @@ instance Arbitrary SomeEntity where , SomeEntity <$> arbitrary @Creature , SomeEntity <$> arbitrary @Wall , SomeEntity <$> arbitrary @Door + , SomeEntity <$> arbitrary @GroundMessage ] instance FromJSON SomeEntity where @@ -37,6 +38,7 @@ instance FromJSON SomeEntity where "Creature" -> SomeEntity @Creature <$> obj .: "data" "Wall" -> SomeEntity @Wall <$> obj .: "data" "Door" -> SomeEntity @Door <$> obj .: "data" + "GroundMessage" -> SomeEntity @GroundMessage <$> obj .: "data" _ -> fail . unpack $ "Invalid entity type \"" <> entityType <> "\"" deriving via WithOptions '[ FieldLabelModifier '[Drop 1] ] GameState |