Section 48 - Entrance To The King's Castle
Excastle is a room.
Printed name of excastle is "Entrance to The Old King's Castle"
Excastle is south of city plaza.
Description of Excastle is "[excastle_description]"
To say excastle_description:
If player is barracked:
Say "There is fierce fighting in front of the Drawbridge, the soldiers of Somewhere are having to fight Nowhere troops from both the city plaza and those you freed from the barracks[paragraph break]. Meanwhile cannon fire whistles overhead between the Nowhere forces in the City Plaza and the airship.";
Otherwise:
If drawbridge is raised:
Say "You are at the entrance to the Old King's Castle. A group of Somewhere troops are amassed here in front of the raised drawbridge.";
Otherwise:
Say "You are at the entrance to the Old King's Castle. A group of Somewhere troops are amassed here in front of the lowered drawbridge."
somewhere soldiers are scenery objects inside excastle.
description of somewhere soldiers is "[sold_description]"
To say sold_description:
If player is barracked:
Say "The soldiers are fighting in front of the Drawbridge, they are pinned between Nowhere troops from both the city plaza and those you freed from the barracks[paragraph break]. Meanwhile cannon fire whistles overhead between the Nowhere forces in the City Plaza and the airship.";
Otherwise:
If drawbridge is raised:
Say "A group of Somewhere troops are amassed here in front of the raised drawbridge.";
Otherwise:
Say "A group of Somewhere troops are amassed here in front of the lowered drawbridge."
scenerymoat2 is a scenery object inside excastle.
understand "moat" as scenerymoat2
description of scenerymoat is "A deep and steep sided ditch that surrounds the castle walls. You an only see the edge of it from the plaza"
printed name of scenerymoat2 is "moat".
understand "moat" as scenerymoat2.
scenerywalls2 is a scenery object inside the city plaza
description of scenerywalls2 is "The castle walls are made of huge blocks of granite stone, they are over 20 meters high, with crenulated battlements and machicolations at the top. The merlons have arrow-loops set into them."
printed name of scenerywalls2 is "walls"
understand "wall" and "walls" as scenerywalls2.
scenerycastle2 is a object inside excastle.
printed name of scenerycastle2 is "The Old King's Castle".
description of scenerycastle2 is "The old King's Castle is a impenetrable stone fortress on top of a mound, surrounded by walls, towers and a moat. It towers above you."
understand "king's castle", "king's castle" and "castle" as scenerycastle2
scenerytowers2 are a scenery object inside excastle.
description of scenerytowers2 is "There are tall round towers at the corners of the walls and on either side of the main gatehouse. They have crenulated battlements at the top, and many arrow-loops built into their walls."
understand "towers" as scenerytowers2.
scenerygatehouse2 is a scenery object inside excastle.
description of scenerygatehouse2 is "A fortified gatehouse is the only way into the old King's castle, it is guarded on either side by two towers."
understand "gatehouse" as scenerygatehouse2.
understand "airship" as airship3.
inside excastle is an airship3
printed name of airship3 is "Airship".
Description of airship3 is "A huge bright yellow airship hovers above the Old King's Castle. The gondola slung underneath is bristling with cannons. There is a rope ladder attached to the gondola the bottom of disappears behind the walls of the Old King's Castle."
The airship3 is fixed in place.
The ropeladderscene3 is part of the airship3.
Instead of taking the ropeladderscene3:
Say "You can't reach it from here, it is hanging down behind the castle wall."
description of ropeladderscene3 is "A rather precarious looking rope ladder hangs from the airship's gondola. You've a horrible feeling that climbing up it lies in your not to distant future."
Printed name of ropeladderscene3 is "rope ladder".
Understand "rope ladder", "rope", and "ladder" as ropeladderscene3.
Instead of climbing ropeladderscene3:
Say "You can't reach the ladder from here, the end of it disappears somewhere behind the castle walls."
The Signaling Platform is an enterable supporter inside excastle.
The Flag Box is a fixed in place container inside excastle.
The Drawbridge is an enterable supporter inside excastle. The description of the drawbridge is "A huge wooden and steel drawbridge. It is [if the drawbridge is lowered]lowered[else]raised. Above the drawbridge on the castle wall you can make out a soldier who appears to have a collection of coloured flags next to him.". The drawbridge can be lowered. The drawbridge is not lowered.
Instead of entering the drawbridge when the drawbridge is not lowered, say "You can't. It's raised.!"
The Green Flag is in the Flag Box. The description of the green flag is "A bright green flag.".
The green flag has a text called Status.
The Green Flag has a text called Signaled. The signaled of the green flag is "null".
After waving the green flag:
if the player is on the signaling platform:
if the drawbridge is lowered:
say "You've already managed to get the drawbridge lowered";
rule succeeds;
say "You wave the Green Flag. You may now begin signaling your binary number.";
now the signaled of the green flag is "null";
now the status of the green flag is "sending";
else:
say "You wave the Green Flag.".
After waving the red flag:
if the drawbridge is lowered:
say "You already managed to get the drawbridge lowered.";
rule succeeds;
now the status of the green flag is "idle";
say "You signaled the binary: [the signaled of the green flag].";
if the signaled of the green flag is "100":
say "You see the soldier on the all above the drawbridge wave a green flag and the drawbridge lowers! It lands with a loud bang.";
now the drawbridge is lowered;
else:
say "You see the soldier on the wall above the drawbridge wave a red flag, indicating the code was not correct.".
The Red Flag is in the flag box. The description of the red flag is "A bright red flag.".
Before getting off the signaling platform:
if the status of the green flag is "sending":
say "You have cancelled the signaling process.";
now the status of the green flag is "idle";
now the signaled of the green flag is "null".
Things have a text called the binaryval. The binaryval of something is normally "null".
The Black Flag is in the flag box. The description of the black flag is "A black flag. It has a large white '0' printed on it.". The binaryval of the black flag is "0".
The White Flag is in the flag box. The description of the white flag is "A white flag. It has a large black '1' printed on it.". The binaryval of the white flag is "1".
Every turn when the status of the green flag is "sending":
say "Current binary message: [the signaled of the green flag].".
After waving something (called the waved) when the status of the green flag is "sending" and the binaryval of the waved is not "null":
if the signaled of the green flag is "null":
now the signaled of the green flag is the binaryval of the waved;
else:
now the signaled of the green flag is "[the signaled of the green flag][the binaryval of the waved]".
After entering the drawbridge:
Move player to inner bailey.
Description of Flag Box is "A tall polished oak cabinet, with separate compartments. You recognise it as part of a form of communication to the castle when the drawbridge is raised; something that hasn't happened since the republic was formed. It's useless without the current signal code though."
Instead of taking green flag when player is not wearing uniform2:
Say "'OI!' One of the Somewhere soldier shouts at you, and grabbing the flag out of your hand says 'Step away from here Nowhere scum! I'll have you arrested!"
Instead of taking red flag when player is not wearing uniform2:
Say "'OI!' One of the Somewhere soldier shouts at you, and grabbing the flag out of your hand says 'Step away from here Nowhere scum! I'll have you arrested!"
Instead of taking black flag when player is not wearing uniform2:
Say "'OI!' One of the Somewhere soldier shouts at you, and grabbing the flag out of your hand says 'Step away from here Nowhere scum! I'll have you arrested!"
Instead of taking white flag when player is not wearing uniform2:
Say "'OI!' One of the Somewhere soldier shouts at you, and grabbing the flag out of your hand says 'Step away from here Nowhere scum! I'll have you arrested!"