-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
727 | ||
731 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module Yaifl.Test.Chapter3.Replanting where | ||
|
||
import Yaifl.Prelude | ||
|
||
import Yaifl (PlainWorldModel) | ||
|
||
import Yaifl.Game.Create.Object | ||
import Yaifl.Game.EffectHandlers | ||
import Yaifl.Game.ObjectSpecifics | ||
import Yaifl.Model.Kinds.Container | ||
import Yaifl.Model.Kinds.Openable | ||
import Yaifl.Model.Kinds.Supporter | ||
import Yaifl.Model.Metadata | ||
import Yaifl.Test.Common | ||
import Yaifl.Model.Kinds.Object | ||
import Yaifl.Model.Query | ||
import Yaifl.Game.Create | ||
import Yaifl.Model.Rules (Precondition(..), variables, say) | ||
import Yaifl.Model.Kinds.Thing ( thingIsScenery ) | ||
|
||
ex16 :: (Text, [Text], Game PlainWorldModel ()) | ||
ex16 = ("Replanting", replantingTestMeWith, replantingWorld) | ||
|
||
replantingWorld :: Game PlainWorldModel () | ||
replantingWorld = do | ||
setTitle "Replanting" | ||
addRoom "The Orchard" ! #description | ||
"Within this quadrille of pear trees, a single gnarled old oak remains as a memory of centuries past." | ||
|
||
addThing "gnarled oak tree" | ||
! #modify makeItScenery | ||
! done | ||
insteadOf (ActionRule #taking) [Precondition (pure "taking scenery") $ | ||
\t -> return (thingIsScenery (variables t))] (const $ say @Text "You lack the hulk-like strength.") | ||
pass | ||
|
||
replantingTestMeWith :: [Text] | ||
replantingTestMeWith = ["take oak"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
---------------------- | ||
----- Replanting ----- | ||
---------------------- | ||
|
||
The Orchard | ||
Within this quadrille of pear trees, a single gnarled old oak remains as a memory of centuries past. | ||
|
||
>take oak | ||
|
||
You lack the hulk-like strength. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters