// This PNFG file represents the short narrative described in the // " Causal Normalization: A Methodology for Coherent Story Logic Design " // paper by Lindley et al. // IDEA have global "entering" actions commands = {talk,attack,village,lair,quit} object dragon { state {alive} counter {hitpoints 0 3} } room you { counter {lives 0 3} } room village { (you,talk) { if (dragon.alive) { "The wizard tells you to kill the evil dragon to get a reward"; } else { "You win"; +game.win; } } (you,attack) { "The wizard thinks your technique is great."; } (you,lair) { move you from village to lair; "You arrive in the lair"; } (you,village){ "You are already in the village."; } (you,help){ "You call for help"; } } room lair { (you,talk) { "You mumble something to yourself."; } (you,attack) { if (lair contains dragon) { -dragon.alive; move dragon from lair to offscreen; "You've killed the evil dragon"; } } (you,village) { move you from lair to village; "You leave the lair and head for the village."; } (you,lair) { "You are already in the lair."; } } (you,quit) { "Good bye"; +game.lose; } (you, help) { "talk,attack,village,lair,quit"; } //you start in the village start { +dragon.alive; you.lives = 2; move you from offscreen to village; move dragon from offscreen to lair; "Type help for list of commands"; "You are in a village"; "A wizard is standing in front of you"; }