Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %AREAS
- location(cornfield, 'A burned up cornfield, reeking of smoke and fumes. The rain put out this mighty blaze. \nTo the south is the pumpkin_patch.').
- location(pumpkin_patch, 'You find yourself in a small, tidy field of pumpkins. You take cover under a small tent to get out of the rain. \nPeering North you can see smoke over the trees. To the West you see a creaky old barn. \nTo the East you can barely make out a beaten path going into the woods. To the South there is an empty field.').
- location(old_barn, 'You see a rickety old barn. The shudders are loudly creaking in the wind. \nThere is a creaky old house to the West, and a pumpkin patch to the East.').
- location(house, 'You find yourself at an old house. \nYou see evidence of a powerful thunderstorm overhead. \nTo the East you see an old barn.').
- location(beaten_path, 'A long and winding road, heading further to the east. \nYou hear cars coming from the East. Back to the West you see the pumpkin patch.').
- location(main_road, 'You are at the main road into town. Every so often you see a large truck pass by without even noticing you.').
- location(empty_fields, 'You find yourself in an empty field. The ground looks barren and dark. \nFurther South you can make out what looks to be a long abandoned Church. To the North you see the pumpkin patch.').
- location(church, 'A dark, looming church stands here. A weaker person may have fled from the sight. \nTo the North is the fields, and to the South is a foreboding graveyard.').
- location(cemetary, 'You are in a gloomy cemetary. The ground below you shifts and trembles almost as if it is alive. \nTo the North is the abandoned church.').
- location(haystack, 'You are at the bottom of a ten foot haystack.').
- location(nest, 'You find a giant birds nest. Huh, weird.').
- %PLAYER
- where(house).
- back(thevoid).
- %DOORS
- door(house, old_barn,beside).
- door(old_barn, pumpkin_patch,beside).
- door(pumpkin_patch,cornfield,beside).
- door(empty_fields,pumpkin_patch,above).
- door(church,empty_fields,above).
- door(cemetary,church,above).
- door(pumpkin_patch, beaten_path,beside).
- door(beaten_path,main_road,beside).
- hiddendoor(cornfield,haystack,beside).
- hiddendoor(nest, beaten_path,above).
- hiddendoor(empty_fields,nest,beside).
- %ITEMS
- item(mailboxkey,'An old rusted out key that likely fits a mailbox', hidden, haystack, moveable).
- item('iron altar', 'A solid iron altar', nothidden, church, fixed).
- item('skeleton sword', 'A crumbling sword of polished Ivory.', nothidden, cemetary, moveable).
- item('giant golden egg', 'a brilliant solid gold egg',nothidden,nest,fixed).
- item('giant belt of gender bending', 'a belt with an unknown purpose', hidden, pumpkin_patch,moveable).
- item(mailbox, 'A sweet looking mailbox. It appears to be locked.',nothidden,main_road,fixed).
- item(mail, 'A piece of mail',nothidden,nowhere,moveable).
- %START BASIC COMMANDS
- connected(X,Y) :- door(X,Y,Z); door(Y,X,Z).
- look :- where(X), location(X, Y), nl, write(Y), nl, nl, show_items, nl, adjacent.
- show_items :- where(Y), item(V,W,nothidden,Y,Z), write('You see an '), write(V), fail.
- show_items.
- itemsearch :- where(Y), item(V,W,hidden,Y,Z), retract(item(V,_,_,_,_)), assert(item(V,W,nothidden,Y,Z)), write('You found a '), write(V).
- itemsearch.
- examine(V) :- where(Y), item(V,W,X,Y,fixed), write(W), nl; item(V,W,X,carrying,Z), reader(V); write('Nothing here.').
- reader(V) :- item(mail,W,X,Y,Z), write('Welcome to Zork knockoff!').
- inventory :- item(V,W,X,carrying,Z), write(W), nl, fail.
- take(V) :- where(Y), item(V,W,X,Y,Z), retract(item(V,_,_,_,_)), assert(item(V,W,X,carrying,Z)), write('You got it!').
- drop(V) :- where(Y), item(V,W,X,G,Z), retract(item(V,_,_,_,_)), assert(item(V,W,X,Y,Z)).
- open(X) :- where(Y), item(mailboxkey,_,_,carrying,_), item(X,A,B,Y,C),retract(item(X,_,_,_,_)), assert(item(openmailbox,'A now open mailbox',nothidden,main_road,fixed)), item(mail,W,M,N,Z), retract(item(mail,_,_,_,_)), assert(item(mail,W,M,carrying,Z)), write('You found some mail!').
- h_adjacent :- write('You can move to'), nl.
- adjacent :- h_adjacent, where(X), connected(X,Y), write(Y), nl, fail.
- adjacent.
- move(Y) :- where(X), retract(back(_)), assert(back(X)), connected(X,Y), retract(where(_)), assert(where(Y)), write('You are now in the '), write(Y), nl, look; write('I see no way to get to the '), write(Y), write(' from here.').
- doorsearch :- where(X), hiddendoor(X,Y,Z), write('Alas! You caught a break. There is a hidden '), write(Y), write(' here! '), assert(door(X,Y,Z)), retract(hiddendoor(X,Y,Z)), write('Search again?'), nl, nl, look; where(X), hiddendoor(Y,X,Z), write('Alas! You caught a break. There is a hidden '), write(Y), write(' here! '), assert(door(Y,X,Z)), retract(hiddendoor(Y,X,Z)), write('Search again?'), nl, nl, look.
- doorsearch.
- search :- doorsearch, itemsearch; write('These are not the droids you are looking for.').
- back :- back(X), move(X).
- teleport(X) :- location(X,Y), retract(where(_)), assert(where(X)), look.
- help :- write('Commands: look, move, back, search.').
- gmhelp :- write('GM Commands: teleport.').
- boring :- write('Sorry.').
Add Comment
Please, Sign In to add comment