Goto removal in actions2.c.

This commit is contained in:
Eric S. Raymond 2017-06-08 02:33:03 -04:00
parent 430b8e7d53
commit 764ed291af

View file

@ -5,7 +5,8 @@
* take one without the other). Liquids also special, since they depend on
* status of bottle. Also various side effects, etc. */
int carry(long obj) {
int carry(long obj)
{
if (TOTING(obj)) return(2011);
SPK=25;
if (obj == PLANT && game.prop[PLANT] <= 0)SPK=115;
@ -16,28 +17,35 @@ int carry(long obj) {
if (obj == BLOOD)SPK=239;
if (obj == RUG && game.prop[RUG] == 2)SPK=222;
if (obj == SIGN)SPK=196;
if(obj != MESSAG) goto L9011;
if (obj == MESSAG) {
SPK=190;
DSTROY(MESSAG);
L9011: if(game.fixed[obj] != 0) return(2011);
}
if (game.fixed[obj] != 0) return(2011);
if (obj != WATER && obj != OIL) goto L9017;
K=obj;
//K = obj;
obj = BOTTLE;
if (HERE(BOTTLE) && LIQ(0) == K) goto L9017;
if(TOTING(BOTTLE) && game.prop[BOTTLE] == 1) return(fill(obj));
if (TOTING(BOTTLE) && game.prop[BOTTLE] == 1) return(fill(BOTTLE));
if (game.prop[BOTTLE] != 1)SPK=105;
if (!TOTING(BOTTLE))SPK=104;
return(2011);
L9017: SPK=92;
L9017:
SPK=92;
if (game.holdng >= 7) return(2011);
if(obj != BIRD || game.prop[BIRD] == 1 || -1-game.prop[BIRD] == 1) goto L9014;
if(game.prop[BIRD] == 2) goto L9015;
if (obj == BIRD && game.prop[BIRD] != 1 && -1-game.prop[BIRD] != 1) {
if (game.prop[BIRD] == 2) {
SPK=238;
DSTROY(BIRD);
return(2011);
}
if (!TOTING(CAGE))SPK=27;
if (TOTING(ROD))SPK=26;
if (SPK/2 == 13) return(2011);
game.prop[BIRD]=1;
L9014: if((obj == BIRD || obj == CAGE) && (game.prop[BIRD] == 1 || -1-game.prop[BIRD] ==
1))CARRY(BIRD+CAGE-obj,game.loc);
}
if ((obj==BIRD || obj==CAGE) && (game.prop[BIRD]==1 || -1-game.prop[BIRD]==1))
CARRY(BIRD+CAGE-obj,game.loc);
CARRY(obj,game.loc);
K=LIQ(0);
if (obj == BOTTLE && K != 0)game.place[K]= -1;
@ -45,10 +53,6 @@ L9014: if((obj == BIRD || obj == CAGE) && (game.prop[BIRD] == 1 || -1-game.prop[
game.prop[obj]=0;
game.prop[CAVITY]=1;
return(2009);
L9015: SPK=238;
DSTROY(BIRD);
return(2011);
}
/* Discard object. "Throw" also comes here for most objects. Special cases for
@ -63,7 +67,7 @@ int discard(long obj, bool just_do_it) {
RSPEAK(30);
if (game.closed) return(19000);
DSTROY(SNAKE);
/* SET game.prop FOR USE BY TRAVEL OPTIONS */
/* Set game.prop for use by travel options */
game.prop[SNAKE]=1;
L9021: K=LIQ(0);
if (K == obj)obj=BOTTLE;
@ -140,10 +144,11 @@ int attack(FILE *input, long obj, long verb) {
if (HERE(BEAR) && game.prop[BEAR] == 0)obj=obj*NOBJECTS+BEAR;
if (obj > NOBJECTS) return(8000);
if (obj != 0) goto L9124;
/* CAN'T ATTACK BIRD OR MACHINE BY THROWING AXE. */
/* Can't attack bird or machine by throwing axe. */
if (HERE(BIRD) && verb != THROW)obj=BIRD;
if (HERE(VEND) && verb != THROW)obj=obj*NOBJECTS+VEND;
/* CLAM AND OYSTER BOTH TREATED AS CLAM FOR INTRANSITIVE CASE; NO HARM DONE. */
/* Clam and oyster both treated as clam for intransitive case;
* no harm done. */
if (HERE(CLAM) || HERE(OYSTER))obj=NOBJECTS*obj+CLAM;
if (obj > NOBJECTS) return(8000);
L9124: if (obj == BIRD) {
@ -169,9 +174,10 @@ L9126: if(obj == 0)SPK=44;
if (obj == OGRE && I > 0) goto L9128;
if (obj == BEAR)SPK=165+(game.prop[BEAR]+1)/2;
if (obj != DRAGON || game.prop[DRAGON] != 0) return(2011);
/* Fun stuff for dragon. If he insists on attacking it, win! Set game.prop to dead,
* move dragon to central loc (still fixed), move rug there (not fixed), and
* move him there, too. Then do a null motion to get new description. */
/* Fun stuff for dragon. If he insists on attacking it, win!
* Set game.prop to dead, move dragon to central loc (still
* fixed), move rug there (not fixed), and move him there,
* too. Then do a null motion to get new description. */
RSPEAK(49);
GETIN(input,WD1,WD1X,WD2,WD2X);
if (WD1 != MAKEWD(25) && WD1 != MAKEWD(250519)) return(2607);