/* The player kicks or whips the steed */ void kick_steed(void) { char He[4]; if (!u.usteed) return; /* [ALI] Various effects of kicking sleeping/paralyzed steeds */ if (u.usteed->msleeping || !u.usteed->mcanmove) { /* We assume a message has just been output of the form "You kick <steed>." */ strcpy(He, mhe(u.usteed)); *He = highc(*He); if ((u.usteed->mcanmove || u.usteed->mfrozen) && !rn2(2)) { if (u.usteed->mcanmove) u.usteed->msleeping = 0; else if (u.usteed->mfrozen > 2) u.usteed->mfrozen -= 2; else { u.usteed->mfrozen = 0; u.usteed->mcanmove = 1; } if (u.usteed->msleeping || !u.usteed->mcanmove) pline("%s stirs.", He); else pline("%s rouses %sself!", He, mhim(u.usteed)); } else pline("%s does not respond.", He); return; } /* Make the steed less tame and check if it resists */ if (u.usteed->mtame) u.usteed->mtame--; if (!u.usteed->mtame && u.usteed->mleashed) m_unleash(u.usteed, TRUE); if (!u.usteed->mtame || (u.ulevel + u.usteed->mtame < rnd(MAXULEV / 2 + 5))) { newsym(u.usteed->mx, u.usteed->my); dismount_steed(DISMOUNT_THROWN); return; } pline("%s gallops!", Monnam(u.usteed)); u.ugallop += rn1(20, 30); return; }
int doride(const struct nh_cmd_arg *arg) { boolean forcemount = FALSE; schar dx, dy, dz; if (u.usteed) dismount_steed(DISMOUNT_BYCHOICE); else if (getargdir(arg, NULL, &dx, &dy, &dz) && isok(u.ux + dx, u.uy + dy)) { if (wizard && yn("Force the mount to succeed?") == 'y') forcemount = TRUE; return mount_steed(m_at(level, u.ux + dx, u.uy + dy), forcemount); } else return 0; return 1; }
void mon_break_armor(struct monst *mon, boolean polyspot) { struct obj *otmp; const struct permonst *mdat = mon->data; boolean vis = cansee(mon->mx, mon->my); boolean handless_or_tiny = (nohands(mdat) || verysmall(mdat)); const char *pronoun = mhim(mon), *ppronoun = mhis(mon); if (breakarm(mdat)) { if ((otmp = which_armor(mon, W_ARM)) != 0) { if ((Is_dragon_scales(otmp) && mdat == Dragon_scales_to_pm(otmp)) || (Is_dragon_mail(otmp) && mdat == Dragon_mail_to_pm(otmp))) ; /* no message here; "the dragon merges with his scaly armor" is odd and the monster's previous form is already gone */ else if (vis) pline("%s breaks out of %s armor!", Monnam(mon), ppronoun); else You_hear("a cracking sound."); m_useup(mon, otmp); } if ((otmp = which_armor(mon, W_ARMC)) != 0) { if (otmp->oartifact) { if (vis) pline("%s %s falls off!", s_suffix(Monnam(mon)), cloak_simple_name(otmp)); if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } else { if (vis) pline("%s %s tears apart!", s_suffix(Monnam(mon)), cloak_simple_name(otmp)); else You_hear("a ripping sound."); m_useup(mon, otmp); } } if ((otmp = which_armor(mon, W_ARMU)) != 0) { if (vis) pline("%s shirt rips to shreds!", s_suffix(Monnam(mon))); else You_hear("a ripping sound."); m_useup(mon, otmp); } } else if (sliparm(mdat)) { if ((otmp = which_armor(mon, W_ARM)) != 0) { if (vis) pline("%s armor falls around %s!", s_suffix(Monnam(mon)), pronoun); else You_hear("a thud."); if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } if ((otmp = which_armor(mon, W_ARMC)) != 0) { if (vis) { if (is_whirly(mon->data)) pline("%s %s falls, unsupported!", s_suffix(Monnam(mon)), cloak_simple_name(otmp)); else pline("%s shrinks out of %s %s!", Monnam(mon), ppronoun, cloak_simple_name(otmp)); } if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } if ((otmp = which_armor(mon, W_ARMU)) != 0) { if (vis) { if (sliparm(mon->data)) pline("%s seeps right through %s shirt!", Monnam(mon), ppronoun); else pline("%s becomes much too small for %s shirt!", Monnam(mon), ppronoun); } if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } } if (handless_or_tiny) { /* [caller needs to handle weapon checks] */ if ((otmp = which_armor(mon, W_ARMG)) != 0) { if (vis) pline("%s drops %s gloves%s!", Monnam(mon), ppronoun, MON_WEP(mon) ? " and weapon" : ""); if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } if ((otmp = which_armor(mon, W_ARMS)) != 0) { if (vis) pline("%s can no longer hold %s shield!", Monnam(mon), ppronoun); else You_hear("a clank."); if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } } if (handless_or_tiny || has_horns(mdat)) { if ((otmp = which_armor(mon, W_ARMH)) != 0 && /* flimsy test for horns matches polyself handling */ (handless_or_tiny || !is_flimsy(otmp))) { if (vis) pline("%s helmet falls to the %s!", s_suffix(Monnam(mon)), surface(mon->mx, mon->my)); else You_hear("a clank."); if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } } if (handless_or_tiny || slithy(mdat) || mdat->mlet == S_CENTAUR) { if ((otmp = which_armor(mon, W_ARMF)) != 0) { if (vis) { if (is_whirly(mon->data)) pline("%s boots fall away!", s_suffix(Monnam(mon))); else pline("%s boots %s off %s feet!", s_suffix(Monnam(mon)), verysmall(mdat) ? "slide" : "are pushed", ppronoun); } if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } } if (!can_saddle(mon)) { if ((otmp = which_armor(mon, W_SADDLE)) != 0) { if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); if (vis) pline("%s saddle falls off.", s_suffix(Monnam(mon))); } if (mon == u.usteed) goto noride; } else if (mon == u.usteed && !can_ride(mon)) { noride: pline("You can no longer ride %s.", mon_nam(mon)); if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) { char buf[BUFSZ]; pline("You touch %s.", mon_nam(u.usteed)); sprintf(buf, "falling off %s", an(u.usteed->data->mname)); instapetrify(buf); } dismount_steed(DISMOUNT_FELL); } return; }
/* armor put on or taken off; might be magical variety */ void update_mon_intrinsics(struct monst *mon, struct obj *obj, boolean on, boolean silently) { int unseen; uchar mask; struct obj *otmp; int which = (int) objects[obj->otyp].oc_oprop; unseen = !canseemon(mon); if (!which) goto maybe_blocks; if (on) { switch (which) { case INVIS: mon->minvis = !mon->invis_blkd; break; case FAST: { boolean save_in_mklev = in_mklev; if (silently) in_mklev = TRUE; mon_adjust_speed(mon, 0, obj); in_mklev = save_in_mklev; break; } /* properties handled elsewhere */ case ANTIMAGIC: case REFLECTING: break; /* properties which have no effect for monsters */ case CLAIRVOYANT: case STEALTH: case TELEPAT: break; /* properties which should have an effect but aren't implemented */ case LEVITATION: case WWALKING: break; /* properties which maybe should have an effect but don't */ case DISPLACED: case FUMBLING: case JUMPING: case PROTECTION: break; default: if (which <= 8) { /* 1 thru 8 correspond to MR_xxx mask values */ /* FIRE,COLD,SLEEP,DISINT,SHOCK,POISON,ACID,STONE */ mask = (uchar) (1 << (which - 1)); mon->mintrinsics |= (unsigned short) mask; } break; } } else { /* off */ switch (which) { case INVIS: mon->minvis = mon->perminvis; break; case FAST: { boolean save_in_mklev = in_mklev; if (silently) in_mklev = TRUE; mon_adjust_speed(mon, 0, obj); in_mklev = save_in_mklev; break; } case FIRE_RES: case COLD_RES: case SLEEP_RES: case DISINT_RES: case SHOCK_RES: case POISON_RES: case ACID_RES: case STONE_RES: mask = (uchar) (1 << (which - 1)); /* If the monster doesn't have this resistance intrinsically, check whether any other worn item confers it. Note that we don't currently check for anything conferred via simply carrying an object. */ if (!(mon->data->mresists & mask)) { for (otmp = mon->minvent; otmp; otmp = otmp->nobj) if (otmp->owornmask && (int) objects[otmp->otyp].oc_oprop == which) break; if (!otmp) mon->mintrinsics &= ~((unsigned short) mask); } break; default: break; } } maybe_blocks: /* obj->owornmask has been cleared by this point, so we can't use it. However, since monsters don't wield armor, we don't have to guard against that and can get away with a blanket worn-mask value. */ switch (w_blocks(obj,~0L)) { case INVIS: mon->invis_blkd = on ? 1 : 0; mon->minvis = on ? 0 : mon->perminvis; break; default: break; } if (!on && mon == u.usteed && obj->otyp == SADDLE) dismount_steed(DISMOUNT_FELL); /* if couldn't see it but now can, or vice versa, update display */ if (!silently && (unseen ^ !canseemon(mon))) newsym(mon->mx, mon->my); }
/* returns 1 if polymorph successful */ int polymon(int mntmp) { boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow, was_blind = !!Blind, dochange = FALSE; boolean could_pass_walls = Passes_walls; int mlvl; if (mvitals[mntmp].mvflags & G_GENOD) { /* allow G_EXTINCT */ pline("You feel rather %s-ish.",mons[mntmp].mname); exercise(A_WIS, TRUE); return 0; } /* KMH, conduct */ u.uconduct.polyselfs++; if (!Upolyd) { /* Human to monster; save human stats */ u.macurr = u.acurr; u.mamax = u.amax; u.mfemale = flags.female; } else { /* Monster to monster; restore human stats, to be * immediately changed to provide stats for the new monster */ u.acurr = u.macurr; u.amax = u.mamax; flags.female = u.mfemale; } if (youmonst.m_ap_type) { /* stop mimicking immediately */ if (multi < 0) unmul(""); } else if (mons[mntmp].mlet != S_MIMIC) { /* as in polyman() */ youmonst.m_ap_type = M_AP_NOTHING; } if (is_male(&mons[mntmp])) { if (flags.female) dochange = TRUE; } else if (is_female(&mons[mntmp])) { if (!flags.female) dochange = TRUE; } else if (!is_neuter(&mons[mntmp]) && mntmp != u.ulycn) { if (!rn2(10)) dochange = TRUE; } if (dochange) { flags.female = !flags.female; pline("You %s %s%s!", (u.umonnum != mntmp) ? "turn into a" : "feel like a new", (is_male(&mons[mntmp]) || is_female(&mons[mntmp])) ? "" : flags.female ? "female " : "male ", mons[mntmp].mname); } else { if (u.umonnum != mntmp) pline("You turn into %s!", an(mons[mntmp].mname)); else pline("You feel like a new %s!", mons[mntmp].mname); } if (Stoned && poly_when_stoned(&mons[mntmp])) { /* poly_when_stoned already checked stone golem genocide */ pline("You turn to stone!"); mntmp = PM_STONE_GOLEM; Stoned = 0; delayed_killer = 0; } u.mtimedone = rn1(500, 500); u.umonnum = mntmp; set_uasmon(); /* New stats for monster, to last only as long as polymorphed. * Currently only strength gets changed. */ if (strongmonst(&mons[mntmp])) ABASE(A_STR) = AMAX(A_STR) = STR18(100); if (Stone_resistance && Stoned) { /* [email protected] */ Stoned = 0; delayed_killer = 0; pline("You no longer seem to be petrifying."); } if (Sick_resistance && Sick) { make_sick(0L, NULL, FALSE, SICK_ALL); pline("You no longer feel sick."); } if (Slimed) { if (flaming(youmonst.data)) { pline("The slime burns away!"); Slimed = 0L; iflags.botl = 1; } else if (mntmp == PM_GREEN_SLIME) { /* do it silently */ Slimed = 0L; iflags.botl = 1; } } if (nohands(youmonst.data)) Glib = 0; /* mlvl = adj_lev(&mons[mntmp]); * We can't do the above, since there's no such thing as an * "experience level of you as a monster" for a polymorphed character. */ mlvl = (int)mons[mntmp].mlevel; if (youmonst.data->mlet == S_DRAGON && mntmp >= PM_GRAY_DRAGON) { u.mhmax = In_endgame(&u.uz) ? (8*mlvl) : (4*mlvl + dice(mlvl,4)); } else if (is_golem(youmonst.data)) { u.mhmax = golemhp(mntmp); } else { if (!mlvl) u.mhmax = rnd(4); else u.mhmax = dice(mlvl, 8); if (is_home_elemental(&u.uz, &mons[mntmp])) u.mhmax *= 3; } u.mh = u.mhmax; if (u.ulevel < mlvl) { /* Low level characters can't become high level monsters for long */ u.mtimedone = u.mtimedone * u.ulevel / mlvl; } if (uskin && mntmp != armor_to_dragon(uskin->otyp)) skinback(FALSE); break_armor(); drop_weapon(1); if (hides_under(youmonst.data)) u.uundetected = OBJ_AT(u.ux, u.uy); else if (youmonst.data->mlet == S_EEL) u.uundetected = is_pool(level, u.ux, u.uy); else u.uundetected = 0; if (u.utraptype == TT_PIT) { if (could_pass_walls && !Passes_walls) { u.utrap = rn1(6,2); } else if (!could_pass_walls && Passes_walls) { u.utrap = 0; } } if (was_blind && !Blind) { /* previous form was eyeless */ Blinded = 1L; make_blinded(0L, TRUE); /* remove blindness */ } newsym(u.ux,u.uy); /* Change symbol */ if (!sticky && !u.uswallow && u.ustuck && sticks(youmonst.data)) u.ustuck = 0; else if (sticky && !sticks(youmonst.data)) uunstick(); if (u.usteed) { if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) { char buf[BUFSZ]; pline("No longer petrifying-resistant, you touch %s.", mon_nam(u.usteed)); sprintf(buf, "riding %s", an(u.usteed->data->mname)); instapetrify(buf); } if (!can_ride(u.usteed)) dismount_steed(DISMOUNT_POLY); } if (flags.verbose) { static const char use_thec[] = "Use the command #%s to %s."; static const char monsterc[] = "monster"; if (can_breathe(youmonst.data)) pline(use_thec,monsterc,"use your breath weapon"); if (attacktype(youmonst.data, AT_SPIT)) pline(use_thec,monsterc,"spit venom"); if (youmonst.data->mlet == S_NYMPH) pline(use_thec,monsterc,"remove an iron ball"); if (attacktype(youmonst.data, AT_GAZE)) pline(use_thec,monsterc,"gaze at monsters"); if (is_hider(youmonst.data)) pline(use_thec,monsterc,"hide"); if (is_were(youmonst.data)) pline(use_thec,monsterc,"summon help"); if (webmaker(youmonst.data)) pline(use_thec,monsterc,"spin a web"); if (u.umonnum == PM_GREMLIN) pline(use_thec,monsterc,"multiply in a fountain"); if (is_unicorn(youmonst.data)) pline(use_thec,monsterc,"use your horn"); if (is_mind_flayer(youmonst.data)) pline(use_thec,monsterc,"emit a mental blast"); if (youmonst.data->msound == MS_SHRIEK) /* worthless, actually */ pline(use_thec,monsterc,"shriek"); if (lays_eggs(youmonst.data) && flags.female) pline(use_thec,"sit","lay an egg"); } /* you now know what an egg of your type looks like */ if (lays_eggs(youmonst.data)) { learn_egg_type(u.umonnum); /* make queen bees recognize killer bee eggs */ learn_egg_type(egg_type_from_parent(u.umonnum, TRUE)); } find_ac(); if ((!Levitation && !u.ustuck && !Flying && (is_pool(level, u.ux,u.uy) || is_lava(level, u.ux,u.uy))) || (Underwater && !Swimming)) spoteffects(TRUE); if (Passes_walls && u.utrap && u.utraptype == TT_INFLOOR) { u.utrap = 0; pline("The rock seems to no longer trap you."); } else if (likes_lava(youmonst.data) && u.utrap && u.utraptype == TT_LAVA) { u.utrap = 0; pline("The lava now feels soothing."); } if (amorphous(youmonst.data) || is_whirly(youmonst.data) || unsolid(youmonst.data)) { if (Punished) { pline("You slip out of the iron chain."); unpunish(); } } if (u.utrap && (u.utraptype == TT_WEB || u.utraptype == TT_BEARTRAP) && (amorphous(youmonst.data) || is_whirly(youmonst.data) || unsolid(youmonst.data) || (youmonst.data->msize <= MZ_SMALL && u.utraptype == TT_BEARTRAP))) { pline("You are no longer stuck in the %s.", u.utraptype == TT_WEB ? "web" : "bear trap"); /* probably should burn webs too if PM_FIRE_ELEMENTAL */ u.utrap = 0; } if (webmaker(youmonst.data) && u.utrap && u.utraptype == TT_WEB) { pline("You orient yourself on the web."); u.utrap = 0; } iflags.botl = 1; vision_full_recalc = 1; see_monsters(); exercise(A_CON, FALSE); exercise(A_WIS, TRUE); encumber_msg(); return 1; }
/* deal with a new player command in countryside mode */ void p_country_process(void) { int no_op; drawvision(Player.x,Player.y); do { no_op = FALSE; Cmd = mgetc(); clear_if_necessary(); switch (Cmd) { case ' ': case 13: no_op = TRUE; break; case 7: wizard(); break; /* ^g */ case 12: xredraw(); no_op = TRUE; break; /* ^l */ #if !defined(WIN32) case 16: bufferprint(); no_op = TRUE; break; /* ^p */ #else case 15: bufferprint(); no_op = TRUE; break; /* ^o */ #endif case 18: redraw(); no_op = TRUE; break; /* ^r */ case 23: if (gamestatusp(CHEATED)) drawscreen(); break; /* ^w */ case 24: if (gamestatusp(CHEATED) || Player.rank[ADEPT]) wish(1); break; /* ^x */ case 'd': drop(); break; case 'e': eat(); break; case 'i': do_inventory_control(); break; case 's': countrysearch(); break; case 'x': examine(); break; case 'E': dismount_steed(); break; case 'H': hunt(Country[Player.x][Player.y].current_terrain_type); break; case 'I': if (! optionp(TOPINV)) top_inventory_control(); else { menuclear(); display_possessions(); inventory_control(); } break; case 'O': setoptions(); break; case 'P': show_license(); break; /* actually show_license is in file.c */ case 'Q': quit(); break; case 'R': rename_player(); break; case 'S': save(FALSE); break; case 'V': version(); break; case '>': enter_site(Country[Player.x][Player.y].base_terrain_type); break; case '#': if (gamestatusp(CHEATED)) editstats(); break; /* RAC - char editor */ case '/': charid(); no_op = TRUE; break; case '?': help(); no_op = TRUE; break; case '4': case 'h': movepincountry(-1,0); break; case '2': case 'j': movepincountry(0,1); break; case '8': case 'k': movepincountry(0,-1); break; case '6': case 'l': movepincountry(1,0); break; case '1': case 'b': movepincountry(-1,1); break; case '3': case 'n': movepincountry(1,1); break; case '7': case 'y': movepincountry(-1,-1); break; case '9': case 'u': movepincountry(1,-1); break; default: commanderror(); no_op = TRUE; break; } } while (no_op); screencheck(Player.x,Player.y); }
/* deal with a new player command in dungeon or city mode*/ void p_process(void) { static int searchval=0; if (Player.status[BERSERK]) if (goberserk()) { setgamestatus(SKIP_PLAYER); drawvision(Player.x,Player.y); } if (! gamestatusp(SKIP_PLAYER)) { if (searchval > 0) { searchval--; if (searchval == 0) resetgamestatus(FAST_MOVE); } drawvision(Player.x,Player.y); if (! gamestatusp(FAST_MOVE)) { searchval = 0; Cmd = mgetc(); clear_if_necessary(); } Command_Duration = 0; switch (Cmd) { case ' ': case 13: setgamestatus(SKIP_MONSTERS); break; /*no op on space or return*/ case 6: abortshadowform(); break; /* ^f */ case 7: wizard(); break; /* ^g */ case 4: player_dump(); break; /* ^d */ case 9: display_pack(); morewait(); xredraw(); break; /* ^i */ case 11: if (gamestatusp(CHEATED)) frobgamestatus(); break; case 12: xredraw(); setgamestatus(SKIP_MONSTERS); break; /* ^l */ #if !defined(WIN32) case 16: bufferprint(); setgamestatus(SKIP_MONSTERS); break; /* ^p */ #else case 15: bufferprint(); setgamestatus(SKIP_MONSTERS); break; /* ^o */ #endif case 18: redraw(); setgamestatus(SKIP_MONSTERS); break; /* ^r */ case 23: if (gamestatusp(CHEATED)) drawscreen(); break; /* ^w */ case 24: /* ^x */ if (gamestatusp(CHEATED) || Player.rank[ADEPT]) wish(1); Command_Duration = 5; break; case 'a': zapwand(); Command_Duration = Player.speed*8/5; break; case 'c': closedoor(); Command_Duration = Player.speed*2/5; break; case 'd': drop(); Command_Duration = Player.speed*5/5; break; case 'e': eat(); Command_Duration = 30; break; case 'f': fire(); Command_Duration = Player.speed*5/5; break; case 'g': pickup(); Command_Duration = Player.speed*10/5; break; case 'i': do_inventory_control(); break; case 'm': magic(); Command_Duration = 12; break; case 'o': opendoor(); Command_Duration = Player.speed*5/5; break; case 'p': pickpocket(); Command_Duration = Player.speed*20/5; break; case 'q': quaff(); Command_Duration = 10; break; case 'r': peruse(); Command_Duration = 20; break; case 's': search(&searchval); Command_Duration = 20; break; case 't': talk(); Command_Duration = 10; break; case 'v': vault(); Command_Duration = Player.speed*10/5; break; case 'x': examine(); Command_Duration = 1; break; case 'z': bash_location(); Command_Duration = Player.speed*10/5; break; case 'A': activate(); Command_Duration = 10; break; case 'C': callitem(); break; case 'D': disarm(); Command_Duration = 30; break; case 'E': dismount_steed(); Command_Duration = Player.speed*10/5; break; case 'F': tacoptions(); break; case 'G': give(); Command_Duration = 10; break; case 'I': if (! optionp(TOPINV)) top_inventory_control(); else { display_possessions(); inventory_control(); } break; case 'M': city_move(); Command_Duration = 10; break; case 'O': setoptions(); #if defined(WIN32) show_screen(); xredraw(); #endif break; case 'P': show_license(); break; /* actually show_license is in file.c */ case 'Q': quit(); break; case 'R': rename_player(); break; case 'S': save(FALSE); break; case 'T': tunnel(); Command_Duration = Player.speed*30/5; break; case 'V': version(); break; case 'Z': bash_item(); Command_Duration = Player.speed*10/5; break; case '.': rest(); Command_Duration = 10; break; case ',': Command_Duration = 10; nap(); break; case '>': downstairs(); break; case '<': upstairs(); break; case '@': p_movefunction(Level->site[Player.x][Player.y].p_locf); Command_Duration = 5; break; case '#': if (gamestatusp(CHEATED)) editstats(); break; /* RAC - char editor */ case '/': charid(); setgamestatus(SKIP_MONSTERS); break; case '?': help(); setgamestatus(SKIP_MONSTERS); break; case '4': case 'h': moveplayer(-1,0); Command_Duration = Player.speed*5/5; break; case '2': case 'j': moveplayer(0,1); Command_Duration = Player.speed*5/5; break; case '8': case 'k': moveplayer(0,-1); Command_Duration = Player.speed*5/5; break; case '6': case 'l': moveplayer(1,0); Command_Duration = Player.speed*5/5; break; case '1': case 'b': moveplayer(-1,1); Command_Duration = Player.speed*5/5; break; case '3': case 'n': moveplayer(1,1); Command_Duration = Player.speed*5/5; break; case '7': case 'y': moveplayer(-1,-1); Command_Duration = Player.speed*5/5; break; case '9': case 'u': moveplayer(1,-1); Command_Duration = Player.speed*5/5; break; case '5': setgamestatus(SKIP_MONSTERS); /* don't do anything; a dummy turn */ Cmd = mgetc(); while ((Cmd != ESCAPE) && ((Cmd < '1') || (Cmd > '9') || (Cmd=='5'))) { print3("Run in keypad direction [ESCAPE to abort]: "); Cmd = mgetc(); } if (Cmd != ESCAPE) setgamestatus(FAST_MOVE); else clearmsg3(); break; case 'H': setgamestatus(FAST_MOVE); Cmd = 'h'; moveplayer(-1,0); Command_Duration = Player.speed*4/5; break; case 'J': setgamestatus(FAST_MOVE); Cmd = 'j'; moveplayer(0,1); Command_Duration = Player.speed*4/5; break; case 'K': setgamestatus(FAST_MOVE); Cmd = 'k'; moveplayer(0,-1); Command_Duration = Player.speed*4/5; break; case 'L': setgamestatus(FAST_MOVE); Cmd = 'l'; moveplayer(1,0); Command_Duration = Player.speed*4/5; break; case 'B': setgamestatus(FAST_MOVE); Cmd = 'b'; moveplayer(-1,1); Command_Duration = Player.speed*4/5; break; case 'N': setgamestatus(FAST_MOVE); Cmd = 'n'; moveplayer(1,1); Command_Duration = Player.speed*4/5; break; case 'Y': setgamestatus(FAST_MOVE); Cmd = 'y'; moveplayer(-1,-1); Command_Duration = Player.speed*4/5; break; case 'U': setgamestatus(FAST_MOVE); Cmd = 'u'; moveplayer(1,-1); Command_Duration = Player.speed*4/5; break; default: commanderror(); setgamestatus(SKIP_MONSTERS); break; } } if (Current_Environment != E_COUNTRYSIDE) roomcheck(); screencheck(Player.x,Player.y); }