From: Peje Nilsson Date: Fri, 16 Jun 2017 15:43:14 +0000 (+0200) Subject: Merge branch 'master' into actions-arithmetic X-Git-Tag: 1.1~289 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F87%2Fhead;p=open-adventure.git Merge branch 'master' into actions-arithmetic --- adbbd1df2589038da674edbcaf40c0dc585d4079 diff --cc actions.c index 8b4f938,29369de..80e24e0 --- a/actions.c +++ b/actions.c @@@ -78,41 -78,39 +78,41 @@@ static int attack(FILE *input, long ver game.dseen[i]=false; } } - spk=k == 2 ? OGRE_PANIC1 : OGRE_PANIC2; - spk=spk+1+1/dwarves; /* FIXME: Arithmetic on message numbers */ ++ spk=dwarves == 2 ? OGRE_PANIC1 : OGRE_PANIC2; + RSPEAK(spk); + return GO_CLEAROBJ; } - - if (obj == BEAR) + else if (obj == BEAR) /* FIXME: Arithmetic on message numbers */ spk = BEAR_HANDS+(game.prop[BEAR]+1)/2; - if (obj != DRAGON || game.prop[DRAGON] != 0) { - RSPEAK(spk); - return GO_CLEAROBJ; + else if (obj == DRAGON && game.prop[DRAGON] == 0) { + /* 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(BARE_HANDS_QUERY); + GETIN(input,&WD1,&WD1X,&WD2,&WD2X); + if (WD1 != MAKEWD(25) && WD1 != MAKEWD(250519)) + return GO_CHECKFOO; + PSPEAK(DRAGON,3); + game.prop[DRAGON]=1; + game.prop[RUG]=0; + int k=(PLAC[DRAGON]+FIXD[DRAGON])/2; + MOVE(DRAGON+NOBJECTS,-1); + MOVE(RUG+NOBJECTS,0); + MOVE(DRAGON,k); + MOVE(RUG,k); + DROP(BLOOD,k); + for (obj=1; obj<=NOBJECTS; obj++) { + if (game.place[obj] == PLAC[DRAGON] || game.place[obj] == FIXD[DRAGON]) + MOVE(obj,k); + } + game.loc=k; + return GO_MOVE; } - /* 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(BARE_HANDS_QUERY); - GETIN(input,&WD1,&WD1X,&WD2,&WD2X); - if (WD1 != MAKEWD(25) && WD1 != MAKEWD(250519)) - return GO_CHECKFOO; - PSPEAK(DRAGON,3); - game.prop[DRAGON]=1; - game.prop[RUG]=0; - int k=(PLAC[DRAGON]+FIXD[DRAGON])/2; - MOVE(DRAGON+NOBJECTS,-1); - MOVE(RUG+NOBJECTS,0); - MOVE(DRAGON,k); - MOVE(RUG,k); - DROP(BLOOD,k); - for (obj=1; obj<=NOBJECTS; obj++) { - if (game.place[obj] == PLAC[DRAGON] || game.place[obj] == FIXD[DRAGON]) - MOVE(obj,k); - } - game.loc=k; - return GO_MOVE; + + RSPEAK(spk); + return GO_CLEAROBJ; } static int bigwords(long foo)