X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=actions2.c;h=72bd0b01e45abaa48d4ef1b0d6f9c4bf1c9d2622;hb=2abc83350422b98bbb8f4f7bdd19290dd9429949;hp=2788e1a22391ef571099cd688cc751fa4604656f;hpb=7abe1c1784110a3ce3d39ac922fe77b22abd5a8c;p=open-adventure.git diff --git a/actions2.c b/actions2.c index 2788e1a..72bd0b0 100644 --- a/actions2.c +++ b/actions2.c @@ -7,6 +7,15 @@ int carry(long obj) { + if (obj == INTRANSITIVE) { + /* Carry, no object given yet. OK if only one object present. */ + if(game.atloc[game.loc] == 0 || + game.link[game.atloc[game.loc]] != 0 || + ATDWRF(game.loc) > 0) + return(8000); + obj=game.atloc[game.loc]; + } + if (TOTING(obj)) return(2011); SPK=25; if (obj == PLANT && game.prop[PLANT] <= 0)SPK=115; @@ -134,7 +143,7 @@ int discard(long obj, bool just_do_it) { * objects fall into two categories: enemies (snake, dwarf, etc.) and others * (bird, clam, machine). Ambiguous if 2 enemies, or no enemies but 2 others. */ -int attack(FILE *input, long obj, long verb) { +int attack(FILE *input, long verb, long obj) { int i =ATDWRF(game.loc); if (obj == 0) { if (i > 0) @@ -226,7 +235,7 @@ int throw_support(long spk) return(8); } -int throw(FILE *cmdin, long obj, long verb) +int throw(FILE *cmdin, long verb, long obj) /* Throw. Same as discard unless axe. Then same as attack except * ignore bird, and if dwarf is present then one might be killed. * (Only way to do so!) Axe also special for dragon, bear, and @@ -276,7 +285,7 @@ int throw(FILE *cmdin, long obj, long verb) JUGGLE(BEAR); return(2011); } - return(attack(cmdin, 0, verb)); + return(attack(cmdin, verb, 0)); } if (randrange(NDWARVES+1) < game.dflag) {