// 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 {dead} } room you { counter { lives 0 5 } } room village { (you,talk) { if (you.lives == 4) { "The wizards congratulates you and gives you the reward"; +game.win; "helloworld"; } else { "The wizard tells you to kill the evil dragon to get a reward"; } } (you,lair) { move you from village to lair; "You arrive in the lair"; } (you,village){ "You are already in the village."; } } room lair { (you,talk) { "You mumble something to yourself."; } (you,attack) { if (lair contains dragon) { +dragon.dead; move dragon from lair to offscreen; "You've killed the evil dragon"; } else { "There is nothing to attack."; } } (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.dead; you.lives = 4; 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"; }