leisuresuitlarry/RM21.CG

776 lines
12 KiB
Plaintext

[logics for room 21 -- rmInside7_11
[ "Leisure Suit Larry in the Land of the Lounge Lizards"
[ by Al Lowe
%include "rm21.msg"
%include "gamedefs.h"
%define LEFT_WITHOUT_PAYING 0
%define ASKED_FOR_RUBBER 100
%define L_TALKING 0
%define L_SHOOTING 1
%define boughtRubber lf0
%define nearCounter lf2
%define nearMags lf3
%define waitingForResponse lf4
%define nearWine lf5
%define moneyOwed lv0 [ Don't change. See message 40.
%define pervertTimer lv1
%define talkTimer lv2
%object aClerk 1
%object aCustomer0 2
%object aCustomer1 3
%object aCustomer2 4
%object aCustomer3 5
%object aCustomer4 6
%object aCustomer5 7
if (initLog)
{
LoadPic( currentRoom);
DrawPic( currentRoom);
DiscardPic( currentRoom);
LoadView( v7_11Customers);
LoadView( v7_11Iranian);
LoadView( vEgoDead);
LoadView( vEgoCollapsing);
LoadView( vMagazines); [ watch
LoadView( v7_11Interior); [ out
AddToPic( v7_11Interior, 0, 0, 107, 148, 13, 4); [ for
AddToPic( v7_11Interior, 0, 1, 102, 134, 12, 4); [ discard
AddToPic( v7_11Interior, 0, 2, 97, 118, 11, 4); [ views
AddToPic( v7_11Interior, 0, 3, 62, 95, 11, 4); [ below
AddToPic( v7_11Interior, 0, 4, 61, 103, 12, 4); [
AddToPic( v7_11Interior, 1, 0, 16, 108, 4, 4); [
[
AddToPic( vMagazines, 0, 0, 63, 116, 13, 4); [
AddToPic( vMagazines, 0, 1, 71, 116, 13, 4); [
AddToPic( vMagazines, 0, 2, 63, 126, 13, 4); [
AddToPic( vMagazines, 0, 3, 69, 126, 13, 4); [
AddToPic( vMagazines, 0, 4, 79, 126, 13, 4); [
AddToPic( vMagazines, 0, 5, 79, 136, 13, 4); [
AddToPic( vMagazines, 0, 5, 71, 136, 13, 4); [
AddToPic( vMagazines, 0, 5, 64, 136, 13, 4); [
DiscardView( v7_11Interior); [
DiscardView( vMagazines); [
AnimateObj( aClerk);
SetView( aClerk, v7_11Iranian);
SetLoop( aClerk, L_TALKING);
SetCel( aClerk, 0);
Position( aClerk, 25, 113);
Draw( aClerk);
StopUpdate( aClerk);
AnimateObj( aCustomer0);
IgnoreBlocks( aCustomer0);
SetView( aCustomer0, v7_11Customers);
SetCel( aCustomer0, 0);
Position( aCustomer0, 52, 117);
StopCycling( aCustomer0);
AnimateObj( aCustomer1);
IgnoreBlocks( aCustomer1);
SetView( aCustomer1, v7_11Customers);
SetCel( aCustomer1, 1);
Position( aCustomer1, 73, 96);
StopCycling( aCustomer1);
AnimateObj( aCustomer2);
IgnoreBlocks( aCustomer2);
SetView( aCustomer2, v7_11Customers);
SetCel( aCustomer2, 2);
Position( aCustomer2, 136, 130);
StopCycling( aCustomer2);
AnimateObj( aCustomer3);
IgnoreBlocks( aCustomer3);
SetView( aCustomer3, v7_11Customers);
SetCel( aCustomer3, 3);
Position( aCustomer3, 108, 95);
StopCycling( aCustomer3);
AnimateObj( aCustomer4);
IgnoreBlocks( aCustomer4);
SetView( aCustomer4, v7_11Customers);
SetCel( aCustomer4, 4);
Position( aCustomer4, 88, 124);
StopCycling( aCustomer4);
AnimateObj( aCustomer5);
IgnoreObjs( aCustomer5);
SetView( aCustomer5, v7_11Customers);
SetCel( aCustomer5, 5);
Position( aCustomer5, 87, 109);
StopCycling( aCustomer5);
Position( ego, 15, 156);
Draw( ego);
ShowPic( );
Return( );
} [ end initLOG
Reset( nearCounter);
if (onWater)
{
Set( nearCounter);
Set( nearPerson);
}
Reset( nearWine);
if (Posn( ego, 50, 112, 81, 116))
{
Set( nearWine);
}
Reset( nearMags);
if (Posn( ego, 55, 150, 85, 157))
{
Set( nearMags);
}
[*****
:handleInput
[*****
if (!haveInput) {goto noInput;}
if ((Said( look) ||
Said( look, room) ||
Said( look, store)))
{
Print( 1);
}
if ((Said( look, counter) ||
Said( look, behind, counter)))
{
Print( 56);
}
if (Said( look, sign))
{
Print( 44);
}
if (Said( look, man))
{
Print( 45);
Print( 47);
}
if (Said( look, shelf))
{
if (nearMags)
{
Print( 2);
}
else
{
if (nearWine)
{
Print( 49);
}
else
{
if (nearCounter)
{
Print( 44);
}
else
{
Print( 6);
}
}
}
}
if ((Said( take, spray) ||
Said( ask, man, spray)))
{
if (!nearCounter)
{
Print( 51);
}
else
{
if (Has( iBreathSpray))
{
Print( 52);
}
else
{
Print( 53);
Get( iBreathSpray));
moneyOwed += 3;
sprayCount = 0;
}
}
}
if ((Said( take, wine) ||
Said( take, bottle, wine)))
{
if (!nearWine)
{
Print( 48);
}
else
{
if (Has( iWine))
{
Print( 55);
}
else
{
if (ObjInRoom( iWine, currentRoom))
{
currentScore += 1;
}
Get( iWine);
moneyOwed += 1;
Print( 42);
}
}
}
if (Said( take, magazine))
{
if (!nearMags)
{
Print( 36);
}
else
{
if (!ObjInRoom( iMagazine, currentRoom))
{
Print( 38);
}
else
{
Set( OK);
Get( iMagazine);
currentScore += 1;
moneyOwed += 2;
}
}
}
if ((Said( pay, wine) ||
Said( pay, spray) ||
Said( pay, magazine)))
{
if (moneyOwed)
{
Reset( haveMatch);
}
else
{
Print( 4);
}
}
if ((Said( pay, man) ||
Said( give, man, money) ||
Said( give, money, man) ||
Said( pay) ||
Said( pay, wine) ||
Said( pay, spray) ||
Said( pay, magazine)))
{
if (!nearCounter)
{
Print( 3);
}
else
{
if (!moneyOwed)
{
Print( 39);
--dollars;
}
else
{
if (dollars < moneyOwed)
{
Print( 32);
}
else
{
Print( 40);
Print( 41);
dollars -= moneyOwed;
moneyOwed = 0;
}
}
}
}
if ((Said( buy, rubber) ||
Said( ask, man, rubber, rol) ||
Said( ask, man, about, rubber, rol) ||
Said( get, rubber, rol) ||
Said( anyword, rubber, rol) ||
Said( rubber, rol) ||
Said( buy, one, rubber)))
{
if (!nearCounter)
{
Set( notCloseEnough);
}
else
{
if (Has( iRubber))
{
Print( 8);
}
else
{
script = ASKED_FOR_RUBBER;
Set( scriptDone);
}
}
}
[ Errors; clean up, fix up.
if ((Said( open, cooler, rol) ||
Said( open, door, rol)))
{
Print( 50);
}
if ((Said( take, booze) || [ Generic liquor.
Said( take, whiskey) ||
Said( take, beer)))
{
Print( 43);
}
if ((Said( get, card) ||
Said( get, rope) ||
Said( get, pills) ||
Said( get, whiskey) ||
Said( get, apple) ||
Said( get, hammer) ||
Said( buy, card) ||
Said( buy, rope) ||
Said( buy, pills) ||
Said( buy, whiskey) ||
Said( buy, apple) ||
Said( buy, hammer)))
{
Print( 57);
}
if ((Said( take, rol) ||
Said( buy, rol))) [ Clean up for anything else.
{
Print( 7);
}
if (!Has( iMagazine) &&
Said( look, magazine))
{
if (!nearMags)
{
Print( 36);
}
else
{
Print( 54);
}
}
if (Said( look, magazine, rack))
{
if (!nearMags)
{
Set( notCloseEnough);
}
else
{
if (!Has( iMagazine))
{
Print( 54);
}
else
{
Print( 38);
}
}
}
if ((Said( talk, man, rol) ||
Said( talk, about, rol)))
{
StartUpdate( aClerk);
talkTimer = 5;
}
[*****
:noInput
[*****
if (aSecondPassed)
{
--talkTimer;
if (talkTimer == 1)
{
StopUpdate( aClerk);
SetCel( aClerk, 0);
ForceUpdate( aClerk);
Random( 58, 64, message);
PrintV( message);
Print( 9);
}
}
if (hitSpecial && moneyOwed)
{
script = LEFT_WITHOUT_PAYING;
Set( scriptDone);
}
if (nearCounter &&
script == 109)
{
Set( scriptDone);
}
if (!haveMatch &&
script > 100 &&
haveInput)
{
Set( scriptDone);
}
if (scriptDone)
{
Reset( scriptDone);
++script;
if (script == 1) [ try to leave w/o paying
{
Set( ignoreSpecial);
PreventInput();
StopMotion( ego);
Set( programControl);
StartUpdate( aClerk);
SetLoop( aClerk, L_SHOOTING);
SetCel( aClerk, 0);
RepositionTo( aClerk, 23, 113);
CycleTime( aClerk, three);
StartCycling( aClerk);
EndOfLoop( aClerk, scriptDone);
}
if (script == 2)
{
Set( keepCycling);
SetView( ego, vEgoCollapsing);
SetCel( ego, 0);
RepositionTo( ego, 15, 159);
CycleTime( ego, two);
EndOfLoop( ego, scriptDone);
}
if (script == 3)
{
Reset( keepCycling);
SetView( ego, vEgoDead);
SetCel( ego, 0);
RepositionTo( ego, 12, 166);
if (egoX > 2)
{
egoX -= 3;
}
if (egoY < 160)
{
egoY += 7;
}
RepositionToV( ego, egoX, egoY);
Print( 19);
scriptTimer = 4;
}
if (script == 4)
{
CycleTime( ego, two);
Set( keepCycling);
EndOfLoop( ego, scriptDone);
}
if (script == 5)
{
newRoom = rmWorkshop;
}
if (script == 101) [ Buying a rubber.
{
Print( 18);
Print( 10);
Print( 11);
Print( 12); [ Smooth or ribbed?
SetString( 1, 34); [ Blank 'em out.
SetString( 2, 34);
SetString( 3, 34);
SetString( 4, 34);
SetString( 5, 34);
scriptTimer = 9;
}
if (script == 102)
{
if (Said( smooth))
{
SetString( 1, 21);
Print( 13);
}
if (Said( ribbed))
{
SetString( 1, 22);
Print( 13);
}
if (!haveMatch)
{
--script;
Set( haveMatch);
if (!typing)
{
Print( 12);
}
}
scriptTimer = 9;
}
if (script == 103)
{
if (Said( colored))
{
SetString( 2, 23);
Print( 14);
}
if (Said( plain))
{
SetString( 2, 24);
Print( 14);
}
if (!haveMatch)
{
--script;
Set( haveMatch);
if (!typing)
{
Print( 13);
}
}
scriptTimer = 9;
}
if (script == 104)
{
if (Said( lubricated))
{
SetString( 3, 25);
Print( 15);
}
if (Said( rough))
{
SetString( 3, 26);
Print( 15);
}
if (!haveMatch)
{
--script;
Set( haveMatch);
if (!typing)
{
Print( 14);
}
}
scriptTimer = 9;
}
if (script == 105)
{
if (Said( striped))
{
SetString( 4, 27);
Print( 16);
}
if (Said( plaid))
{
SetString( 4, 28);
Print( 16);
}
if (!haveMatch)
{
--script;
Set( haveMatch);
if (!typing)
{
Print( 15);
}
}
scriptTimer = 9;
}
if (script == 106)
{
if (Said( peppermint))
{
SetString( 5, 29);
Print( 20);
}
if (Said( spearmint))
{
SetString( 5, 30);
Print( 20);
}
scriptTimer = 3;
if (!haveMatch)
{
Set( haveMatch);
--script;
Set( haveMatch);
if (!typing)
{
Print( 16);
}
scriptTimer = 9;
}
}
if (script == 107)
{
PreventInput():
Print( 17);
StopUpdate( ego);
Draw( aCustomer0);
Draw( aCustomer1);
Draw( aCustomer2);
Draw( aCustomer3);
Draw( aCustomer4);
Draw( aCustomer5);
scriptTimer = 5;
}
if (script == 108)
{
PrintAt( 5, 5, 10, 25);
[msg #, row, col, width
Erase( aCustomer0);
Erase( aCustomer1);
Erase( aCustomer2);
Erase( aCustomer3);
Erase( aCustomer4);
Erase( aCustomer5);
StartUpdate( ego);
scriptTimer = 5;
}
if (script == 109)
{
if (!nearCounter)
{
Print( 46);
}
else
{
script = 110;
}
}
if (script == 110)
{
if (ObjInRoom( iRubber, currentRoom))[How cute. It's his first time!
{
currentScore += 4;
}
moneyOwed += 5;
Get( iRubber);
Set( boughtRubber);
Print( 31);
AcceptInput();
if (dollars < moneyOwed)
{
Print( 32);
}
else
{
Print( 33);
dollars -= moneyOwed;
moneyOwed = 0;
}
}
}
[*****
:exit [ test for leaving the room
[*****
if (edgeEgoHit == BOTTOM)
{
AcceptInput();
if (boughtRubber)
{
Print( 35);
}
newRoom = rmOutside7_11;
}