X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=00b9ca0e5afcc4b04516200c4af2011bf6a4e15a;hb=bea58f268233184eef62a69fb716a519abee43ca;hp=52e85c9fa6b2ef9a452f5805cbf70e49d16ffa28;hpb=733312bdc7da28f8316a2b51c20a2279db294a0f;p=open-adventure.git diff --git a/main.c b/main.c index 52e85c9..00b9ca0 100644 --- a/main.c +++ b/main.c @@ -15,7 +15,7 @@ struct game_t game; long LNLENG, LNPOSN, PARMS[MAXPARMS+1]; -char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[129], MAP2[129]; +char rawbuf[LINESIZE], INLINE[LINESIZE+1]; long AMBER, AXE, BACK, BATTER, BEAR, BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, @@ -102,7 +102,6 @@ case 'l': set_seed(seedval); /* Initialize game variables */ - MAP2[1] = 0; if (!game.setup) initialise(); @@ -345,7 +344,25 @@ static bool dwarfmove(void) continue; } if(TOTING(j)) { - goto L6021; + if(game.place[CHEST] == 0) { + /* Install chest only once, to insure it is + * the last treasure in the list. */ + MOVE(CHEST,game.chloc); + MOVE(MESSAG,game.chloc2); + } + RSPEAK(128); + for (int j=MINTRS; j<=MAXTRS; j++) { + if (!(j == PYRAM && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD]))) { + if(AT(j) && game.fixed[j] == 0) + CARRY(j,game.loc); + if(TOTING(j)) + DROP(j,game.chloc); + } + } + game.dloc[PIRATE]=game.chloc; + game.odloc[PIRATE]=game.chloc; + game.dseen[PIRATE]=false; + goto jumpout; } if(HERE(j)) k=1; @@ -363,27 +380,6 @@ static bool dwarfmove(void) if(game.odloc[PIRATE] != game.dloc[PIRATE] && PCT(20)) RSPEAK(127); continue; - - L6021: - if(game.place[CHEST] == 0) { - /* Install chest only once, to insure it is the last treasure in - * the list. */ - MOVE(CHEST,game.chloc); - MOVE(MESSAG,game.chloc2); - } - RSPEAK(128); - for (int j=MINTRS; j<=MAXTRS; j++) { - if (!(j == PYRAM && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD]))) { - if(AT(j) && game.fixed[j] == 0) - CARRY(j,game.loc); - if(TOTING(j)) - DROP(j,game.chloc); - } - } - game.dloc[PIRATE]=game.chloc; - game.odloc[PIRATE]=game.chloc; - game.dseen[PIRATE]=false; - continue; } /* This threatening little dwarf is in the room with him! */ @@ -395,6 +391,7 @@ static bool dwarfmove(void) if(randrange(1000) < 95*(game.dflag-2)) ++stick; } + jumpout:; } /* Now we know what's happening. Let's tell the poor sucker about it.