From: Eric S. Raymond Date: Wed, 7 Jun 2017 12:41:46 +0000 (-0400) Subject: Continuing OBJ localization. X-Git-Tag: 1.1~572 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;ds=sidebyside;h=df83a345a212b8b9326cd0ffa89e2edf09e83811;p=open-adventure.git Continuing OBJ localization. --- diff --git a/actions1.c b/actions1.c index 1e142c1..560d698 100644 --- a/actions1.c +++ b/actions1.c @@ -162,7 +162,7 @@ L8010: if(game.atloc[game.loc] == 0 || game.link[game.atloc[game.loc]] != 0 || A /* Transitive carry/drop are in separate file. */ L9010: return(carry()); -L9020: return(discard(false)); +L9020: return(discard(OBJ, false)); /* SAY. Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).) Magic words override. */ @@ -421,7 +421,7 @@ L8201: /*etc*/ ; /* Feed/fill are in the other module. */ L9210: return(feed(OBJ)); -L9220: return(fill()); +L9220: return(fill(OBJ)); /* Blast. No effect unless you've got dynamite, which is a neat trick! */ diff --git a/actions2.c b/actions2.c index bd1de2c..d2648e5 100644 --- a/actions2.c +++ b/actions2.c @@ -55,35 +55,35 @@ L9015: SPK=238; * bird (might attack snake or dragon) and cage (might contain bird) and vase. * Drop coins at vending machine for extra batteries. */ -int discard(bool just_do_it) { +int discard(long obj, bool just_do_it) { if(just_do_it) goto L9021; - if(TOTING(ROD2) && OBJ == ROD && !TOTING(ROD))OBJ=ROD2; - if(!TOTING(OBJ)) return(2011); - if(OBJ != BIRD || !HERE(SNAKE)) goto L9023; + if(TOTING(ROD2) && obj == ROD && !TOTING(ROD))obj=ROD2; + if(!TOTING(obj)) return(2011); + if(obj != BIRD || !HERE(SNAKE)) goto L9023; RSPEAK(30); if(game.closed) return(19000); DSTROY(SNAKE); /* SET game.prop FOR USE BY TRAVEL OPTIONS */ game.prop[SNAKE]=1; L9021: K=LIQ(0); - if(K == OBJ)OBJ=BOTTLE; - if(OBJ == BOTTLE && K != 0)game.place[K]=0; - if(OBJ == CAGE && game.prop[BIRD] == 1)DROP(BIRD,game.loc); - DROP(OBJ,game.loc); - if(OBJ != BIRD) return(2012); + if(K == obj)obj=BOTTLE; + if(obj == BOTTLE && K != 0)game.place[K]=0; + if(obj == CAGE && game.prop[BIRD] == 1)DROP(BIRD,game.loc); + DROP(obj,game.loc); + if(obj != BIRD) return(2012); game.prop[BIRD]=0; if(FOREST(game.loc))game.prop[BIRD]=2; return(2012); -L9023: if(!(GSTONE(OBJ) && AT(CAVITY) && game.prop[CAVITY] != 0)) goto L9024; +L9023: if(!(GSTONE(obj) && AT(CAVITY) && game.prop[CAVITY] != 0)) goto L9024; RSPEAK(218); - game.prop[OBJ]=1; + game.prop[obj]=1; game.prop[CAVITY]=0; - if(!HERE(RUG) || !((OBJ == EMRALD && game.prop[RUG] != 2) || (OBJ == RUBY && + if(!HERE(RUG) || !((obj == EMRALD && game.prop[RUG] != 2) || (obj == RUBY && game.prop[RUG] == 2))) goto L9021; SPK=219; if(TOTING(RUG))SPK=220; - if(OBJ == RUBY)SPK=221; + if(obj == RUBY)SPK=221; RSPEAK(SPK); if(SPK == 220) goto L9021; K=2-game.prop[RUG]; @@ -92,19 +92,19 @@ L9023: if(!(GSTONE(OBJ) && AT(CAVITY) && game.prop[CAVITY] != 0)) goto L9024; MOVE(RUG+NOBJECTS,K); goto L9021; -L9024: if(OBJ != COINS || !HERE(VEND)) goto L9025; +L9024: if(obj != COINS || !HERE(VEND)) goto L9025; DSTROY(COINS); DROP(BATTER,game.loc); PSPEAK(BATTER,0); return(2012); -L9025: if(OBJ != BIRD || !AT(DRAGON) || game.prop[DRAGON] != 0) goto L9026; +L9025: if(obj != BIRD || !AT(DRAGON) || game.prop[DRAGON] != 0) goto L9026; RSPEAK(154); DSTROY(BIRD); game.prop[BIRD]=0; return(2012); -L9026: if(OBJ != BEAR || !AT(TROLL)) goto L9027; +L9026: if(obj != BEAR || !AT(TROLL)) goto L9027; RSPEAK(163); MOVE(TROLL,0); MOVE(TROLL+NOBJECTS,0); @@ -114,7 +114,7 @@ L9026: if(OBJ != BEAR || !AT(TROLL)) goto L9027; game.prop[TROLL]=2; goto L9021; -L9027: if(OBJ == VASE && game.loc != PLAC[PILLOW]) goto L9028; +L9027: if(obj == VASE && game.loc != PLAC[PILLOW]) goto L9028; RSPEAK(54); goto L9021; @@ -218,7 +218,7 @@ int throw(FILE *cmdin, long obj) { if(!TOTING(obj)) return(2011); if(obj >= 50 && obj <= MAXTRS && AT(TROLL)) goto L9178; if(obj == FOOD && HERE(BEAR)) goto L9177; - if(obj != AXE) return(discard(false)); + if(obj != AXE) return(discard(obj, false)); I=ATDWRF(game.loc); if(I > 0) goto L9172; SPK=152; @@ -333,7 +333,7 @@ L9222: SPK=29; RSPEAK(145); game.prop[VASE]=2; game.fixed[VASE]= -1; - return(discard(true)); + return(discard(obj, true)); L9224: SPK=213; if(game.prop[URN] != 0) return(2011); diff --git a/funcs.h b/funcs.h index ceb1021..dcc60d2 100644 --- a/funcs.h +++ b/funcs.h @@ -38,7 +38,7 @@ #define OUTSID(LOC) ((LOC) <= 8 || FOREST(LOC) || (LOC) == PLAC[SAPPH] || (LOC) == 180 || (LOC) == 182) #define INDEEP(LOC) ((LOC) >= 15 && !OUTSID(LOC) && (LOC) != 179) -extern int carry(void), discard(bool), attack(FILE *, long), throw(FILE *, long obj), feed(long), fill(void); +extern int carry(void), discard(long, bool), attack(FILE *, long), throw(FILE *, long obj), feed(long), fill(long); void score(long);