Skip to content
Browse files

applyReplacementEffects now takes a single effect as argument

  • Loading branch information...
1 parent d08bb98 commit f35e95b9c834ecd5c1d039327786edb52d359cb4 @MedeaMelana committed Nov 4, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 Engine.hs
View
8 Engine.hs
@@ -180,7 +180,7 @@ executeStep (EndPhase CleanupStep) = do
executeEffect :: OneShotEffect -> Engine ()
executeEffect e = do
-- TODO trigger abilities
- applyReplacementEffects [e] >>= mapM_ compileEffect
+ applyReplacementEffects e >>= mapM_ compileEffect
-- Compilation of effects
@@ -266,7 +266,7 @@ offerPriority = do
checkSBAs :: Engine ()
checkSBAs = do
sbas <- collectSBAs
- sbas' <- applyReplacementEffects sbas
+ sbas' <- concat <$> for sbas applyReplacementEffects
forM_ sbas' executeEffect
collectSBAs :: Engine [OneShotEffect]
@@ -343,8 +343,8 @@ executeAction ability rSource activatorId = do
SpecialAction m -> executeMagic m >>= mapM_ executeEffect
StackingAction _ -> return ()
-applyReplacementEffects :: [OneShotEffect] -> Engine [OneShotEffect]
-applyReplacementEffects = return -- TODO
+applyReplacementEffects :: OneShotEffect -> Engine [OneShotEffect]
+applyReplacementEffects = return . (: []) -- TODO
executeMagic :: Magic a -> Engine a
executeMagic m = State.get >>= lift . lift . runReaderT m

0 comments on commit f35e95b

Please sign in to comment.
Something went wrong with that request. Please try again.