feat(xanthous): Add configurable natural attacks
Allow configuring the natural attacks (eg, part of their body rather than an item) of a creature. Each attack has a description and a damage associated with it. Change-Id: I69698a8ac4ee2da91e4c88e419593627519522a5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3220 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
This commit is contained in:
parent
88b0d0eecc
commit
fb5bec8d95
7 changed files with 69 additions and 12 deletions
|
|
@ -300,9 +300,21 @@ deriving stock instance Ord Attr
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
instance (SemiSequence a, Arbitrary (Element a), Arbitrary a)
|
||||
=> Arbitrary (NonNull a) where
|
||||
arbitrary = ncons <$> arbitrary <*> arbitrary
|
||||
|
||||
instance ToJSON a => ToJSON (NonNull a) where
|
||||
toJSON = toJSON . toNullable
|
||||
|
||||
instance (FromJSON a, MonoFoldable a) => FromJSON (NonNull a) where
|
||||
parseJSON = maybe (fail "Found empty list") pure . fromNullable <=< parseJSON
|
||||
|
||||
instance NFData a => NFData (NonNull a) where
|
||||
rnf xs = xs `seq` toNullable xs `deepseq` ()
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
instance forall t name. (NFData t, Monoid t, NFData name)
|
||||
=> NFData (Editor t name) where
|
||||
rnf ed = getName @_ @name ed `deepseq` getEditContents ed `deepseq` ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue