Skip to content

Commit

Permalink
Renamed WillSimpleEffect -> Will, DidSimpleEffect -> Did
Browse files Browse the repository at this point in the history
  • Loading branch information
MedeaMelana committed Nov 4, 2012
1 parent 12488c0 commit d08bb98
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Engine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ executeStep (BeginningPhase UntapStep) = do
-- [502.2] untap permanents
rp <- gets activePlayer
ios <- IdList.filter (isControlledBy rp) <$> gets battlefield
_ <- for ios $ \(i, _) -> executeEffect (WillSimpleEffect (UntapPermanent i))
_ <- for ios $ \(i, _) -> executeEffect (Will (UntapPermanent i))
return ()

executeStep (BeginningPhase UpkeepStep) = do
Expand All @@ -99,7 +99,7 @@ executeStep (BeginningPhase UpkeepStep) = do
executeStep (BeginningPhase DrawStep) = do
-- [504.1]
ap <- gets activePlayer
executeEffect (WillSimpleEffect (DrawCard ap))
executeEffect (Will (DrawCard ap))

-- TODO [504.2] handle triggers

Expand Down Expand Up @@ -186,7 +186,7 @@ executeEffect e = do
-- Compilation of effects

compileEffect :: OneShotEffect -> Engine ()
compileEffect (WillSimpleEffect e) = compileSimpleEffect e
compileEffect (Will e) = compileSimpleEffect e
compileEffect (WillMoveObject rObj rToZone obj) = moveObject rObj rToZone obj

compileSimpleEffect :: SimpleOneShotEffect -> Engine ()
Expand Down Expand Up @@ -287,7 +287,7 @@ collectSBAs = execWriterT $ do
ips <- IdList.toList <$> lift (gets players)
forM_ ips $ \(i,p) -> do
when (get life p <= 0 || get failedCardDraw p) $
tell [WillSimpleEffect (LoseGame i)]
tell [Will (LoseGame i)]

checkBattlefield = do
ios <- IdList.toList <$> lift (gets battlefield)
Expand All @@ -307,7 +307,7 @@ collectSBAs = execWriterT $ do
(Just t, Just d) -> t > 0 && d >= t
_ -> False
when (hasLethalDamage || get deathtouched o) $
tell [WillSimpleEffect (DestroyPermanent (Battlefield, i) True)]
tell [Will (DestroyPermanent (Battlefield, i) True)]

-- [704.5i]
when (o `hasTypes` planeswalkerType && countCountersOfType Loyalty o == 0) $
Expand Down
4 changes: 2 additions & 2 deletions M12.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ shockEffect rSelf rActivator = do
_ -> return False
ts <- askMagicTargets rActivator (singleTarget <?> ok)
let f t = case t of
TargetObject or -> return [WillSimpleEffect (DamageObject rSelf or 2 False True)]
TargetPlayer pr -> return [WillSimpleEffect (DamagePlayer rSelf pr 2 False True)]
TargetObject or -> return [Will (DamageObject rSelf or 2 False True)]
TargetPlayer pr -> return [Will (DamagePlayer rSelf pr 2 False True)]
return (f <$> ts)
4 changes: 2 additions & 2 deletions Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ data PriorityAction = PlayCard ObjectRef

-- | Events triggered abilities watch for.
data Event
= DidSimpleEffect SimpleOneShotEffect
= Did SimpleOneShotEffect
| DidMoveObject ZoneRef ObjectRef -- old zone, new zone/id

-- Keyword actions [701]
Expand All @@ -396,7 +396,7 @@ data Event
| WillEndStep Step

data OneShotEffect
= WillSimpleEffect SimpleOneShotEffect
= Will SimpleOneShotEffect
| WillMoveObject ObjectRef ZoneRef Object -- current zone/id, new zone, suggested form

data SimpleOneShotEffect
Expand Down

0 comments on commit d08bb98

Please sign in to comment.