Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #266: Add more acceptable phrases #267

Merged
merged 5 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion untitledHeistGame.inf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Constant OPTIONAL_PROVIDE_UNDO;
Constant INITIAL_LOCATION_VALUE = Tutorial;
Constant DEBUG;


Constant voxfail = "The tower silently listens to your voice, but then flashes red and buzzes disapprovingly. Red text appears on a screen: ~YOU ARE NOT JOHN TITOR THIS LOGIN ATTEMPT WILL BE REPORTED.~";
Constant handfail = "You place your hand on the handprint recognizer. Light scans your hand before flashing red and buzzing disapprovingly. Red text appears on a screen: ~YOU ARE NOT JOHN TITOR THIS LOGIN ATTEMPT WILL BE REPORTED.~";

Expand Down Expand Up @@ -112,6 +113,7 @@ Verb 'type' * -> TypeErr
}
}
];


Verb 'hint' * -> Hint;

Expand All @@ -132,6 +134,7 @@ Verb 'plunge'
* noun -> Plunge
* multiexcept 'with' held -> Plunge;


Extend 'pick' first
* noun 'with' held -> Unlock
* 'apart'/'open' noun 'with' held -> Unlock
Expand All @@ -143,6 +146,9 @@ Extend 'transfer' first
Extend 'move' replace
* noun -> transfer;

Extend 'show' replace
* noun 'to' noun -> insert;

! 'screw' and 'unscrew' are defined as synonyms for 'turn',
! rather unhelpfully for a game that wishes to distinguish them.
! We keep that behaviour, and extend here.
Expand All @@ -159,6 +165,7 @@ Extend only 'turn' first
Extend only 'remove' first
* noun 'with' held -> Remove;


[Initialise;
! Start out VERBOSE instead of BRIEF
lookmode = 2;
Expand Down Expand Up @@ -233,6 +240,8 @@ with

has light;



Object -> elevatorDoor "Elevator Door"
with
name 'elevator' 'door',
Expand All @@ -244,7 +253,7 @@ has static door ~open locked concealed;

Object securityCard "Security Key Fob"
with
name 'security' 'fob' 'id' 'identification' 'pass' 'key',
name 'security' 'fob' 'id' 'identification' 'pass' 'key' 'card',
description [;
print "This is a small plastic key fob with a fake name you gave them during the hiring process. ";
if(player in Tutorial){
Expand All @@ -253,6 +262,53 @@ with
],
has heavy;


! This routine checks if player is in elevator and if they're trying
! to scan the fob. If true, operates identically to inserting
! fob into scanner in the tutorial.
[ScanSub;

! Return false if player tries to scan anything while outside elevator
if (location ~= Tutorial) {

print "You see nothing to scan...";
return false;
}

! (Almost) Same action as 'Receive' in Tutorial
if (noun == securityCard && securityCard hasnt heavy) {

! If the player tries to "insert fob into scanner" twice (w/o "take fob"), this message
! is printed. For some reason PunyInform doesn't do that here, so doing it manually.
if (securityCard notin player) {
print "(first taking the Security Key Fob)";
new_line;
}
"You insert the fob into the scanner. The green lights happily flash a few times, and the door opens! You have completed the tutorial. To enter the game proper type ~north~ or ~n~. If you ever need help try the commands help or intro!";
give elevatorDoor open;
give elevatorDoor ~locked;
}
if (noun==securityCard && securityCard has heavy) {
print "Oops, you fumble the fob and drop it on the floor of the elevator! Use ~take [object]~ to pick up an object. Try grabbing the fob and try again!";
give securityCard ~heavy;
move securityCard to Tutorial;

! The PunyInform manual states to do this when changing an object's
! location outside its scope, but we don't have OPTIONAL_MANUAL_SCOPE set.

update_moved = True;
}

return true;
];

[ IsSecurityCard;
return (noun == securityCard);
];

Verb 'scan'
* noun=IsSecurityCard -> Scan;

!===================LOBBY=======================
Object Lobby "The Lobby"
with
Expand Down Expand Up @@ -1357,6 +1413,10 @@ with
give ellieComputer open;
return true;
}
else if (second==flathead) {
print "You try to unscrew the screws with your flathead screwdriver, but it does not fit.";
return false;
}
else {
print "You should specify a tool you are turning the screws with.";
return true;
Expand All @@ -1368,6 +1428,10 @@ with
give ellieComputer open;
return true;
}
else if (second==flathead) {
print "You try to unscrew the screws with your flathead screwdriver, but it does not fit.";
return false;
}
else {
print "You should specify a tool you are unscrewing the screws with.";
return true;
Expand Down
87 changes: 87 additions & 0 deletions untitledHeistGame.test
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,92 @@

The Lobby

* scan fob twice consecutively

> scan fob
> scan fob
(first taking the Security Key Fob)
You insert the fob into the scanner.
> undo
> undo
> scan id
> scan id
(first taking the Security Key Fob)
You insert the fob into the scanner.
> undo
> undo
> scan card
> scan card
(first taking the Security Key Fob)
You insert the fob into the scanner.
> undo
> undo
> insert id into scanner
> insert id into scanner
(first taking the Security Key Fob)
You insert the fob into the scanner.
> undo
> undo
> insert card into scanner
> insert card into scanner
(first taking the Security Key Fob)
You insert the fob into the scanner.
> undo
> undo
> insert fob into scanner
> insert fob into scanner
(first taking the Security Key Fob)
You insert the fob into the scanner.
> undo
> undo
> show fob to scanner
> show fob to scanner
(first taking the Security Key Fob)
You insert the fob into the scanner.
> undo
> undo
> show card to scanner
> show card to scanner
(first taking the Security Key Fob)
You insert the fob into the scanner.
> undo
> undo
> show id to scanner
> show id to scanner
(first taking the Security Key Fob)
You insert the fob into the scanner.

* insert card (fob) into scanner in Tutorial
> insert card into scanner
> take card
> insert card into scanner
You insert the fob into the scanner.

* insert id (fob) into scanner in Tutorial
> insert id into scanner
> take card
> insert id into scanner
You insert the fob into the scanner.

* show card (fob) to scanner in Tutorial
> show card to scanner
> take card
> show card to scanner
You insert the fob into the scanner.

* show id (fob) to scanner in Tutorial
> show id to scanner
> take id
> show id to scanner
You insert the fob into the scanner.

* scan fob in tutorial
> scan fob
> take fob
Taken.
> scan fob
You insert the fob into the scanner.

* get/drop key from receptionist area

> insert fob into scanner
Expand Down Expand Up @@ -629,6 +715,7 @@ The computer boots
> s
> s
> jimmy door with card
> coffee card
You unlock the office door and open it!
> e
Ellie's Office
Expand Down