Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

clean-up complete; operations on current level and all levels separated

  • Loading branch information...
commit 50f88bfe0f3598842fce337f1a55a12499027d43 1 parent b880066
@Mikolaj Mikolaj authored
Showing with 5 additions and 4 deletions.
  1. +3 −4 src/Actions.hs
  2. +2 −0  src/State.hs
View
7 src/Actions.hs
@@ -443,9 +443,9 @@ selectHero actor =
then return False -- already selected
else do
state <- get
- case findActorLevel actor state of
+ case findActorAnyLevel actor state of
Nothing -> abortWith $ "No such member of the party."
- Just nln -> do
+ Just (nln, pbody) -> do
-- Make the new actor the player-controlled actor.
modify (\ s -> s { splayer = actor })
-- Record the original level of the new player.
@@ -453,8 +453,7 @@ selectHero actor =
-- Switch to the level.
lvlswitch nln
-- Announce.
- ptype <- gets (mtype . getPlayerBody)
- messageAdd $ subjectMovable ptype ++ " selected."
+ messageAdd $ subjectMovable (mtype pbody) ++ " selected."
return True
-- | Calculate loot's worth. TODO: move to another module, and refine significantly.
View
2  src/State.hs
@@ -19,6 +19,8 @@ import Message
-- | The 'State' contains all the game state that has to be saved.
-- In practice, we maintain extra state, but that state is state
-- accumulated during a turn or relevant only to the current session.
+-- TODO: consider changing slevel to LevelName, removing the lname field
+-- and not removing the current level from the dungeon.
data State = State
{ splayer :: Actor, -- ^ represents the player-controlled movable
scursor :: Cursor, -- ^ cursor location and level to return to
Please sign in to comment.
Something went wrong with that request. Please try again.