Stewart
Active Member
NPC governor "governor" marketplace
with name 'governor' 'vogt' 'Hermann' 'Gessler',
description
"Short, stout but with a thin, mean face, Gessler relishes the
power he holds over the local community.",
initial [;
print "Gessler is watching from a safe distance,
a sneer on his face.^";
if (location hasnt visited)
print "^~It appears that you need to be taught a lesson,
fool. Nobody shall pass through the square without paying
homage to His Imperial Highness Albert; nobody, hear me?
I could have you beheaded for treason, but I'm going to
be lenient. If you should be so foolish again, you can
expect no mercy, but this time, I'll let you go free...
just as soon as you demonstrate your archery skills by
hitting this apple from where you stand. That shouldn't
prove too difficult; here, sergeant, catch. Balance it on
the little bastard's head.~^";
],
life [;
Talk: print_ret "You cannot bring yourself to speak to him.";
],
before [; FireAt:
if (BowOrArrow(second)) {
deadflag = 3;
print_ret "Before the startled soldiers can react, you turn
and fire at Gessler; your arrow pierces his heart,
and he dies messily. A gasp, and then a cheer,
goes up from the crowd.";
}
return true;
],
has male;
!============================================================================
! The player's possessions
Object bow "bow"
with name 'bow',
description "Your trusty yew bow, strung with flax.",
before [;
Drop,Give: print_ret "You're never without your trusty bow.";
]
has clothing;
Object quiver "quiver"
with name 'quiver',
description
"Made of goatskin, it usually hangs over your left shoulder.",
before [;
Drop,Give:
print_ret "But it was a present from Hedwig, your wife.";
],
has container open clothing;
Arrow "arrow" quiver;
Arrow "arrow" quiver;
Arrow "arrow" quiver;
NPC son "your son"
with name 'son' 'your' 'boy' 'lad' 'Walter',
description [;
if (location == marketplace)
print_ret "He stares at you, trying to appear brave and
remain still. His arms are pulled back and tied behind
the trunk, and the apple nestles amid his blond hair.";
else
print_ret "A quiet, blond lad of eight summers, he's fast
learning the ways of mountain folk.";
],
life [;
Give:
score = score + 1;
move noun to self;
print_ret "~Thank you, Papa.~";
Talk:
if (location == marketplace)
print_ret "~Stay calm, my son, and trust in God.~";
else
print_ret "You point out a few interesting sights.";
],
before [;
Examine,Listen,Salute,Talk: return false;
FireAt:
if (location == marketplace) {
if (BowOrArrow(second)) {
deadflag = 3;
print_ret "Oops! Surely you didn't mean to do that?";
}
return true;
}
else
return false;
default:
if (location == marketplace)
print_ret "Your guards won't permit it.";
else
return false;
],
found_in [; return true; ],
has male proper scenery transparent;
Object apple "apple"
with name 'apple',
description [;
if (location == marketplace)
print_ret "At this distance you can barely see it.";
else
print_ret "The apple is blotchy green and brown.";
],
before [;
Drop: print_ret "An apple is worth quite a bit --
better hang on to it.";
Eat: print_ret "Helga intended it for Walter...";
FireAt:
if (location == marketplace) {
if (BowOrArrow(second)) {
score = score + 1;
deadflag = 2;
print_ret "Slowly and steadily, you place an arrow in
the bow, draw back the string, and take aim with
more care than ever in your life. Holding your
breath, unblinking, fearful, you release the
arrow. It flies across the square towards your
son, and drives the apple against the trunk of
the tree. The crowd erupts with joy;
Gessler looks distinctly disappointed.";
}
return true;
}
else
return false;
];
!============================================================================
! Entry point routines
[ Initialise;
location = street;
lookmode = 2; ! like the VERBOSE command
move bow to player;
move quiver to player; give quiver worn;
player.description =
"You wear the traditional clothing of a Swiss mountaineer.";
print_ret "^^
The place: Altdorf, in the Swiss canton of Uri. The year is 1307,
at which time Switzerland is under rule by the Emperor Albert of
Habsburg. His local governor -- the vogt -- is the bullying
Hermann Gessler, who has placed his hat atop a wooden pole in
the centre of the town square; everybody who passes through the
square must bow to this hated symbol of imperial might.
^^
You have come from your cottage high in the mountains,
accompanied by your younger son, to purchase provisions. You are
a proud and independent man, a hunter and guide, renowned both
for your skill as an archer and, perhaps unwisely (for his soldiers
are everywhere), for failing to hide your dislike of the vogt.
^^
It's market-day: the town is packed with people from the
surrounding villages and settlements.^";
];
[ DeathMessage; print "You have screwed up a favourite folk story"; ];
!============================================================================
! Standard and extended grammar
Include "Grammar";
!----------------------------------------------------------------------------
[ TalkSub;
if (noun == player) print_ret "Nothing you hear surprises you.";
if (RunLife(noun,##Talk) ~= false) return; ! consult life[; Talk: ]
print_ret "At the moment, you can't think of anything to say.";
];
Verb 'talk' 't//' 'converse' 'chat' 'gossip'
* 'to'/'with' creature -> Talk
* creature -> Talk;
!----------------------------------------------------------------------------
[ BowOrArrow o;
if (o == bow or nothing || o ofclass Arrow) return true;
print "That's an unlikely weapon, isn't it?^";
return false;
];
[ FireAtSub;
if (noun == nothing)
print_ret "What, just fire off an arrow at random?";
if (BowOrArrow(second))
print_ret "Pretty dangerous, don't you think?";
];
Verb 'fire' 'shoot' 'aim'
* -> FireAt
* noun -> FireAt
* 'at' noun -> FireAt
* 'at' noun 'with' noun -> FireAt
* noun 'with' noun -> FireAt
* noun 'at' noun -> FireAt reverse;
!----------------------------------------------------------------------------
[ SaluteSub;
if (noun has animate) print_ret (The) noun, " acknowledges you.";
print_ret (The) noun, " takes no notice.";
];
Verb 'bow' 'nod' 'kowtow' 'genuflect'
* 'at'/'to'/'towards' noun -> Salute;
Verb 'salute' 'greet' 'acknowledge'
* noun -> Salute;
Extend 'give'
* 'homage' 'to' noun -> Salute;
Extend 'wave'
* 'at' noun -> Salute;
!----------------------------------------------------------------------------
[ UntieSub; print_ret "You really shouldn't try that."; ];
Verb 'untie' 'unfasten' 'unfix' 'free' 'release'
* noun -> Untie;
!============================================================================
Apologies for the unindented code; it would be too much to fix...
I'd post a TADS example but I don't have a copy of Ditch Day Drifter - the TADS example code/game to cite an example of.