packages feed

antisplice 0.13.2.0 → 0.13.2.2

raw patch · 3 files changed

+13/−7 lines, 3 files

Files

antisplice.cabal view
@@ -10,7 +10,7 @@ -- PVP summary:      +-+------- breaking API changes --                   | | +----- non-breaking API additions --                   | | | +--- code changes with no API change-version:             0.13.2.0+version:             0.13.2.2  -- A short (one-line) description of the package. synopsis:            An engine for text-based dungeons.
src/Game/Antisplice/Prototypes.hs view
@@ -40,6 +40,7 @@ import Game.Antisplice.Events import Game.Antisplice.Errors import Text.Printf+import Data.Char import Data.Text (pack,unpack) import Data.List @@ -51,7 +52,7 @@   onAnnounce $ enomaskLn (Dull Magenta) =<< expand =<< getRoomTitle   onLook $ do     rs <- getRoomState-    enomaskLn (Dull Green) =<< expand =<< getRoomDesc+    mnomaskLn =<< expand =<< liftM (("%{D2;"++).(++"}")) getRoomDesc     sequence_ $ avlInorder $ flip fmap (roomObjectsOf rs) $ \os -> objectTriggerOnAnnounceOf os  -- | Construct a sign from a text and some attributes.@@ -80,10 +81,12 @@ -- | Construct a mob from a title, some names, a description and some attributes. ctorMob :: MonadVocab m => String -> [String] -> String -> [String] -> ObjectT m () ctorMob t ns d as = do-  onLook $ mprintLn d-  onRoomEnter $ mnomaskLn =<< expand (printf "%s has entered the room." t)-  onRoomLeave $ mnomaskLn =<< expand (printf "%s has left the room." t)-  onAnnounce $ mnomaskLn =<< expand (printf "  %%{D6;%s is here.}" t)+  let cap (c:cx) = toUpper c : cx+      cap [] = []+  onLook $ mnomaskLn =<< expand d+  onRoomEnter $ mnomaskLn =<< expand (printf "%s has entered the room." $ cap t)+  onRoomLeave $ mnomaskLn =<< expand (printf "%s has left the room." $ cap t)+  onAnnounce $ mnomaskLn =<< expand (printf "  %%{D6;%s is here.}" $ cap t)   onDie $ do     mnomaskLn =<< expand (printf "%s dies." t)     void $ addRoomObject $ do
src/Game/Antisplice/Rooms.hs view
@@ -233,7 +233,10 @@                   b <- pathPrerequisiteOf c                   unless b $ throwError CantWalkThereError                   case followEdge r d (roomsOf s) of-                    Just n -> enterAndAnnounce n+                    Just n -> do+                      pathTriggerBeforeWalkOf c+                      enterAndAnnounce n+                      pathTriggerAfterWalkOf c                 Nothing -> throwError CantWalkThereError  -- | Add a new object to the current room. It is contructed using the object monad.