1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-28 00:12:23 +01:00

Update remaining main functions

This commit is contained in:
NeroOneTrueKing 2022-05-15 10:41:15 -05:00
parent 3c3711842e
commit dbb5ed67a5
34 changed files with 786 additions and 805 deletions

View file

@ -95,10 +95,10 @@ struct flag {
int movetoprint;
int movetoprintcost;
#define MOVE_DEFAULT 0x4000 /* equivalent to Standard unless another move is layered overtop, in which case it is ignored */
#define MOVE_CANCELLED 0x8000 /* overrides all other move types, total action takes no time */
#define MOVE_CANCELLED 0x8000 /* overrides all other move types, total action takes no time. Also used for infomenus and other instant nonactions. */
#define MOVE_FINISHED_OCCUPATION MOVE_CANCELLED
#define MOVE_STANDARD 0x0001 /* player did a general action -- takes 1 standard turn */
#define MOVE_INSTANT 0x0002 /* action should take no time */
#define MOVE_INSTANT 0x0002 /* player did an action that should take no time */
#define MOVE_PARTIAL 0x0004 /* player did a general action -- takes no time for the first instance, 1 standard turn after, resets on non-instant action */
#define MOVE_MOVED 0x0008 /* player moved */
#define MOVE_ATTACKED 0x0010 /* player made a weapon attack */

View file

@ -6071,7 +6071,7 @@ arti_invoke(obj)
int windpets[8] = {0, PM_FOG_CLOUD, PM_DUST_VORTEX, PM_ICE_PARAELEMENTAL, PM_ICE_VORTEX,
PM_ENERGY_VORTEX, PM_AIR_ELEMENTAL, PM_LIGHTNING_PARAELEMENTAL};
coord cc;
int n, damage, time = 1;
int n, damage, time = MOVE_STANDARD;
struct permonst *pm;
struct monst *mtmp = 0;
if (!oart || !oart->inv_prop) {
@ -6090,7 +6090,7 @@ arti_invoke(obj)
pline1(nothing_happens);
break;
}
return 1;
return MOVE_STANDARD;
}
if(oart->inv_prop > LAST_PROP) {
@ -6107,17 +6107,17 @@ arti_invoke(obj)
/* the artifact is tired :-) */
if(obj->oartifact == ART_FIELD_MARSHAL_S_BATON){
You_hear("the sounds of hurried preparation.");
return partial_action();
return MOVE_PARTIAL;
}
if(oart->inv_prop == VOID_CHIME) {
pline("%s makes no sound.", The(xname(obj)));
return partial_action();
return MOVE_PARTIAL;
}
You_feel("that %s %s ignoring you.",
the(xname(obj)), otense(obj, "are"));
/* and just got more so; patience is essential... */
obj->age += Role_if(PM_PRIEST) ? (long) d(1,20) : (long) d(3,10);
return partial_action();
return MOVE_PARTIAL;
}
if(!( /* some properties can be used as often as desired, or track cooldowns in a different way */
oart->inv_prop == FIRE_SHIKAI ||
@ -6179,7 +6179,7 @@ arti_invoke(obj)
case UNTRAP: {
if(!untrap(obj)) {
obj->age = 0; /* don't charge for changing their mind */
return 0;
return MOVE_CANCELLED;
}
break;
}
@ -6189,7 +6189,7 @@ arti_invoke(obj)
if (!otmp) {
obj->age = 0;
return 0;
return MOVE_CANCELLED;
}
b_effect = obj->blessed &&
((Role_switch == oart->role || oart->role == NON_PM) && (Race_switch == oart->race || oart->race == NON_PM));
@ -6693,7 +6693,7 @@ arti_invoke(obj)
the(xname(obj)), otense(obj, "are"));
/* and just got more so; patience is essential... */
artinstance[obj->oartifact].SnSd1 += Role_if(PM_PRIEST)||Role_if(PM_SAMURAI) ? (long) d(1,20) : (long) d(3,10);
return partial_action();
return MOVE_PARTIAL;
}
else if(throweffect()){
int dmg;
@ -6716,7 +6716,7 @@ arti_invoke(obj)
the(xname(obj)), otense(obj, "are"));
/* and just got more so; patience is essential... */
artinstance[obj->oartifact].SnSd2 += Role_if(PM_PRIEST)||Role_if(PM_SAMURAI) ? (long) d(1,20) : (long) d(3,10);
return partial_action();
return MOVE_PARTIAL;
}
else if(getdir((char *)0) && (u.dx || u.dy)) {
struct zapdata zapdata;
@ -6736,7 +6736,7 @@ arti_invoke(obj)
the(xname(obj)), otense(obj, "are"));
/* and just got more so; patience is essential... */
artinstance[obj->oartifact].SnSd3 += Role_if(PM_PRIEST)||Role_if(PM_SAMURAI) ? (long) d(1,20) : (long) d(3,10);
return partial_action();
return MOVE_PARTIAL;
}
else{
pline("San no mai, Shirafune!");
@ -6845,11 +6845,11 @@ arti_invoke(obj)
if (getpos(&cc, TRUE, "the desired position") < 0) {
pline1(Never_mind);
obj->age = 0;
return 0;
return MOVE_CANCELLED;
}
if (!cansee(cc.x, cc.y) || distu(cc.x, cc.y) >= 32) {
You("smell rotten eggs.");
return 0;
return MOVE_INSTANT;
}
}
pline("A cloud of toxic smoke pours out!");
@ -7546,7 +7546,7 @@ arti_invoke(obj)
if (!(uwep && uwep == obj)){
You_feel("that you should be wielding %s.", the(xname(obj)));;
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
}
getdir((char *)0);
@ -7573,7 +7573,7 @@ arti_invoke(obj)
if ((!uwep && uwep == obj)){
You_feel("that you should be wielding %s.", the(xname(obj)));;
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
}
char food_types[] = { FOOD_CLASS, 0 };
struct obj *otmp = (struct obj *) 0;
@ -7602,7 +7602,7 @@ arti_invoke(obj)
if (!corpse) corpse = getobj(food_types, "make a skeletal minion of");
if (!corpse) {
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
}
struct permonst *pm = &mons[corpse->corpsenm];
@ -7612,15 +7612,15 @@ arti_invoke(obj)
) || (is_clockwork(pm) || is_unalive(pm))){
pline("That creature has no bones!");
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
} else if (undiffed_innards(pm) || no_innards(pm)){
pline("That creature has no bones!");
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
} else if (is_untamable(pm) || (pm->geno & G_UNIQ)){
pline("You can't create a minion of that type of monster!");
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
}
if (is_mind_flayer(pm)){
//Ceremorphosis works on a wide variety of hostes, however, it is typically only done to human-sized creatures.
@ -7842,7 +7842,7 @@ arti_invoke(obj)
default:
impossible("Unknown spellbook level %d, book %d;",
objects[booktype].oc_level, booktype);
return 0;
return MOVE_CANCELLED;
}
artiptr = obj;
set_occupation(read_necro, "studying", 0);
@ -8343,7 +8343,7 @@ arti_invoke(obj)
engrHere->ward_id = CERULEAN_SIGN;
engrHere->ward_type = BURN;
engrHere->complete_wards = 1;
return 1;
return MOVE_STANDARD;
} else {
struct monst *mtmp = fmon, *ntmp;
boolean maanze = FALSE;
@ -8892,7 +8892,7 @@ arti_invoke(obj)
/* Don't filter out ' ' here; it has a use */
if ((ch != def_monsyms[S_GHOST]) && (ch != def_monsyms[S_SHADE]) && index(quitchars,ch)) {
if (flags.verbose) pline1(Never_mind);
return 1;
return MOVE_STANDARD;
}
You("peer into %s...", the(xname(obj)));
nomul(-rnd(obj->blessed ? 6 : 10), "peering through the Oracle's eye");
@ -8942,7 +8942,7 @@ arti_invoke(obj)
else pline_The("vision is unclear.");
}
}
return 1;
return MOVE_STANDARD;
}break;
case ALLSIGHT:
You("see the world in utter clarity.");
@ -8965,7 +8965,7 @@ arti_invoke(obj)
if ((!uwep && uwep == obj)){
You_feel("that you should be wielding %s.", the(xname(obj)));;
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
}
/* message */
if (flags.soundok) {
@ -8989,28 +8989,28 @@ arti_invoke(obj)
case STONE_DRAGON:
You("wake the stone dragonhead.");
doliving_dragonhead(&youmonst, obj, TRUE);
time = partial_action();
time = MOVE_PARTIAL;
break;
case MAD_KING:
You("wake the mad king.");
doliving_mad_king(&youmonst, obj, TRUE);
time = partial_action();
time = MOVE_PARTIAL;
break;
case RINGED_SPEAR:
You("wake the ringed spear.");
doliving_ringed_spear(&youmonst, obj, TRUE);
time = partial_action();
time = MOVE_PARTIAL;
break;
case RINGED_ARMOR:
You("wake the ringed armor.");
doliving_ringed_armor(&youmonst, obj, TRUE);
time = partial_action();
time = MOVE_PARTIAL;
break;
case BLOODLETTER:
if (!uwep || uwep != obj){
You_feel("that you should be wielding %s.", the(xname(obj)));
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
}
if (artinstance[obj->oartifact].BLactive < monstermoves){
if (has_blood_mon(&youmonst)){
@ -9029,7 +9029,7 @@ arti_invoke(obj)
if (obj != uarmf) {
You_feel("that you should be wearing %s.", the(xname(obj)));
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
}
You("click your heels together and take a step... ");
jump(15);
@ -9041,7 +9041,7 @@ arti_invoke(obj)
if(obj != ublindf && obj != uskin && obj != uwep) {
You_feel("that you should be holding %s.", the(xname(obj)));
obj->age = monstermoves;
return(0);
return MOVE_CANCELLED;
}
if(Upolyd && obj == uskin) {
/* revert */
@ -9239,7 +9239,7 @@ arti_invoke(obj)
case IBITE_ARM:
You("wake the severed arm.");
doliving_ibite_arm(&youmonst, obj, TRUE);
time = partial_action();
time = MOVE_PARTIAL;
break;
default: pline("Program in dissorder. Artifact invoke property not recognized");
break;
@ -9257,7 +9257,7 @@ arti_invoke(obj)
the(xname(obj)), otense(obj, "are"));
/* can't just keep repeatedly trying */
obj->age += (long) d(3,10);
return partial_action();
return MOVE_PARTIAL;
} else if(!on) {
/* when turning off property, determine downtime */
/* arbitrary for now until we can tune this -dlc */
@ -9274,7 +9274,7 @@ nothing_special:
/* you had the property from some other source too */
if (carried(obj))
You_feel("a surge of power, but nothing seems to happen.");
return 1;
return MOVE_STANDARD;
}
switch(oart->inv_prop) {
case FAST:

138
src/cmd.c
View file

@ -654,7 +654,7 @@ boolean you_abilities;
pline("You are extraordinary mundane.");
}
destroy_nhwindow(tmpwin);
return 0;
return MOVE_CANCELLED;
}
if (mon_abilities && you_abilities)
@ -667,7 +667,7 @@ boolean you_abilities;
n = select_menu(tmpwin, how, &selected);
destroy_nhwindow(tmpwin);
if(n <= 0) return 0;
if(n <= 0) return MOVE_CANCELLED;
switch (selected[0].item.a_int) {
/* Player abilities */
@ -685,7 +685,7 @@ boolean you_abilities;
case MATTK_HBREATH: return dobreathe(&mons[PM_HALF_DRAGON]);
case MATTK_DSCALE:{
int res = dobreathe(Dragon_shield_to_pm(uarms));
if(res){
if(!(res & MOVE_CANCELLED)){
if(!uarm->oartifact) uarm->age = monstermoves + (long)(rnz(100)*(Role_if(PM_CAVEMAN) ? .8 : 1));
uarms->age = monstermoves + (long)(rnz(100)*(Role_if(PM_CAVEMAN) ? .8 : 1));
}
@ -693,7 +693,7 @@ boolean you_abilities;
}
case MATTK_SPIT: return dospit();
case MATTK_MAGIC:
return xcasty(&youmonst, (struct monst *)0, &youracedata->mattk[attackindex(youracedata, AT_MAGC, AD_ANY)], 0, 0);
return xcasty(&youmonst, (struct monst *)0, &youracedata->mattk[attackindex(youracedata, AT_MAGC, AD_ANY)], 0, 0) ? MOVE_CASTSPELL : MOVE_CANCELLED;
// return castum((struct monst *)0,
// &youracedata->mattk[attackindex(youracedata,
@ -713,23 +713,23 @@ boolean you_abilities;
if(IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
if (split_mon(&youmonst, (struct monst *)0))
dryup(u.ux, u.uy, TRUE);
return 1;
return MOVE_STANDARD;
} else {
There("is no fountain here.");
return 0;
return MOVE_CANCELLED;
}
}
break;
case MATTK_UHORN: {
use_unicorn_horn((struct obj *)0);
return 1;
return MOVE_STANDARD;
}
break;
case MATTK_SHRIEK: {
You("shriek.");
if(u.uburied) pline("Unfortunately sound does not carry well through rock.");
else aggravate();
return 1;
return MOVE_STANDARD;
}
break;
case MATTK_SCREAM: {
@ -744,7 +744,7 @@ boolean you_abilities;
}
}
}
return 1;
return MOVE_STANDARD;
}
break;
case MATTK_HOLE: {
@ -792,17 +792,17 @@ boolean you_abilities;
digactualhole(u.ux, u.uy, &youmonst, PIT, FALSE, TRUE);
else
digactualhole(u.ux, u.uy, &youmonst, HOLE, FALSE, TRUE);
return 1;
return MOVE_STANDARD;
} else {
You("gyre and gimble, but the %s is too hard!", surface(u.ux,u.uy));
return 1;
return MOVE_STANDARD;
}
}
break;
case MATTK_REACH: return use_reach_attack();
break;
}
return 0;
return MOVE_CANCELLED;
}
/* #mount command - order mount to attack */
@ -814,17 +814,17 @@ domountattk()
int new_x,new_y;
if(!u.usteed){
You("don't have a mount.");
return 0;
return MOVE_CANCELLED;
}
if(P_SKILL(P_RIDING) < P_EXPERT){
pline("Only an expert is skilled enough to direct a mount's attacks.");
return 0;
return MOVE_CANCELLED;
}
if(!getdir("Attack in what direction?")){
pline("never mind");
return 0;
return MOVE_CANCELLED;
}
for(new_x = u.ux+u.dx, new_y = u.uy+u.dy; isok(new_x,new_y); new_x += u.dx, new_y += u.dy){
@ -832,11 +832,11 @@ domountattk()
if(mtmp && mon_can_see_mon(u.usteed, mtmp) && canspotmon(mtmp)){
You("direct your mount to attack %s", mon_nam(mtmp));
mattackm(u.usteed, mtmp);
return 1;
return MOVE_STANDARD;
}
}
pline("Your mount can't find anything to attack!");
return 0;
return MOVE_CANCELLED;
#else
pline("You can't ride anything!");
#endif
@ -845,7 +845,7 @@ domountattk()
STATIC_OVL int
use_reach_attack()
{
int res = 0, typ, max_range = 4, min_range = 1;
int typ, max_range = 4, min_range = 1;
coord cc;
struct monst *mtmp;
@ -853,14 +853,14 @@ use_reach_attack()
/* Are you allowed to use a reach attack? */
if (u.uswallow) {
pline("There's not enough room here to use that.");
return (0);
return MOVE_CANCELLED;
}
/* Prompt for a location */
pline("Where do you want to hit?");
cc.x = u.ux;
cc.y = u.uy;
if (getpos(&cc, TRUE, "the spot to hit") < 0)
return 0; /* user pressed ESC */
return MOVE_CANCELLED; /* user pressed ESC */
/* Calculate range */
typ = P_BARE_HANDED_COMBAT;
@ -871,18 +871,18 @@ use_reach_attack()
else max_range = 10;
if (distu(cc.x, cc.y) > max_range) {
pline("Too far!");
return (res);
return MOVE_CANCELLED;
} else if (distu(cc.x, cc.y) < min_range) {
pline("Too close!");
return (res);
return MOVE_CANCELLED;
} else if (!cansee(cc.x, cc.y) &&
((mtmp = m_at(cc.x, cc.y)) == (struct monst *)0 ||
!canseemon(mtmp))) {
You("won't hit anything if you can't see that spot.");
return (res);
return MOVE_CANCELLED;
} else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
You("can't reach that spot from here.");
return res;
return MOVE_CANCELLED;
}
/* Attack the monster there */
@ -895,7 +895,7 @@ use_reach_attack()
} else
/* Now you know that nothing is there... */
pline("%s", nothing_happens);
return (1);
return MOVE_STANDARD;
}
int
doMysticForm()
@ -967,10 +967,10 @@ doMysticForm()
destroy_nhwindow(tmpwin);
if(n <= 0){
return 0;
return MOVE_CANCELLED;
} else {
toggle_monk_style(selected[0].item.a_int);
return 0;
return MOVE_INSTANT;
}
}
@ -991,12 +991,12 @@ dofightingform()
if(!(uwep && is_lightsaber(uwep))){
pline("You don't know any special fighting styles for use in this situation.");
return 0;
return MOVE_CANCELLED;
}
if(P_SKILL(weapon_type(uwep)) < P_BASIC){
pline("You must have at least some basic skill in the use of your weapon before you can employ special fighting styles.");
return 0;
return MOVE_CANCELLED;
}
tmpwin = create_nhwindow(NHW_MENU);
@ -1034,10 +1034,10 @@ dofightingform()
destroy_nhwindow(tmpwin);
if(n <= 0 || selectedFightingForm(selected[0].item.a_int)){
return 0;
return MOVE_CANCELLED;
} else {
setFightingForm(selected[0].item.a_int);
return 0;
return MOVE_INSTANT;
}
}
@ -1054,7 +1054,7 @@ dounmaintain()
if(!(u.spells_maintained)){
pline("You aren't maintaining any spells.");
return 0;
return MOVE_CANCELLED;
}
tmpwin = create_nhwindow(NHW_MENU);
@ -1081,12 +1081,12 @@ dounmaintain()
destroy_nhwindow(tmpwin);
if(n <= 0){
return 0;
return MOVE_CANCELLED;
} else {
pline("You cease to maintain %s.",
OBJ_NAME(objects[selected[0].item.a_int]));
spell_unmaintain(selected[0].item.a_int);
return 0;
return MOVE_INSTANT;
}
}
@ -1098,7 +1098,7 @@ enter_explore_mode()
int really_xplor = FALSE;
#endif
pline("Explore mode is for local games, not public servers.");
return 0;
return MOVE_CANCELLED;
if(!discover && !wizard) {
pline("Beware! From explore mode there will be no return to normal game.");
@ -1125,7 +1125,7 @@ enter_explore_mode()
pline("Resuming normal game.");
}
}
return 0;
return MOVE_CANCELLED;
}
STATIC_PTR int
@ -1136,7 +1136,7 @@ dooverview_or_wiz_where()
else
#endif
dooverview();
return 0;
return MOVE_CANCELLED;
}
STATIC_PTR int
@ -1149,7 +1149,7 @@ doclearinvissyms()
unmap_object(x, y);
newsym(x, y);
}
return 0;
return MOVE_CANCELLED;
}
#ifdef WIZARD
@ -1160,7 +1160,7 @@ wiz_mk_mapglyphdump()
#ifdef MAPDUMP_FN
mk_mapdump(MAPDUMP_FN);
#endif
return 0;
return MOVE_CANCELLED;
}
/* ^W command - wish for something */
@ -1176,7 +1176,7 @@ wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */
(void) encumber_msg();
} else
pline("Unavailable command '^W'.");
return 0;
return MOVE_CANCELLED;
}
/* ^I command - identify hero's inventory */
@ -1185,7 +1185,7 @@ wiz_identify()
{
if (wizard) identify_pack(0);
else pline("Unavailable command '^I'.");
return 0;
return MOVE_CANCELLED;
}
@ -1258,7 +1258,7 @@ wiz_makemap(VOID_ARGS)
flush_screen(1);
check_special_room(FALSE); /* room entry */
}
return 0;
return MOVE_CANCELLED;
}
/* ^F command - reveal the level map and any traps on it */
@ -1289,7 +1289,7 @@ wiz_map()
HHallucination = save_Hhallu;
} else
pline("Unavailable command '^F'.");
return 0;
return MOVE_CANCELLED;
}
/* ^G command - generate monster(s); a count prefix will be honored */
@ -1298,7 +1298,7 @@ wiz_genesis()
{
if (wizard) (void) create_particular(-1, -1, TRUE, 0, 0, 0);
else pline("Unavailable command '^G'.");
return 0;
return MOVE_CANCELLED;
}
/* ^O command - display dungeon layout */
@ -1307,7 +1307,7 @@ wiz_where()
{
if (wizard) (void) print_dungeon(FALSE, FALSE, (schar *)0, (int *)0);
else pline("Unavailable command '^O'.");
return 0;
return MOVE_CANCELLED;
}
/* ^E command - detect unseen (secret doors, traps, hidden monsters) */
@ -1316,7 +1316,7 @@ wiz_detect()
{
if(wizard) (void) findit();
else pline("Unavailable command '^E'.");
return 0;
return MOVE_CANCELLED;
}
/* ^V command - level teleport */
@ -1325,7 +1325,7 @@ wiz_level_tele()
{
if (wizard) level_tele();
else pline("Unavailable command '^V'.");
return 0;
return MOVE_CANCELLED;
}
/* #monpolycontrol command - choose new form for shapechangers, polymorphees */
@ -1335,7 +1335,7 @@ wiz_mon_polycontrol()
iflags.mon_polycontrol = !iflags.mon_polycontrol;
pline("Monster polymorph control is %s.",
iflags.mon_polycontrol ? "on" : "off");
return 0;
return MOVE_CANCELLED;
}
/* #levelchange command - adjust hero's experience level */
@ -1353,14 +1353,14 @@ wiz_level_change()
if (ret != 1) {
pline1(Never_mind);
return 0;
return MOVE_CANCELLED;
}
if (newlevel == u.ulevel) {
You("are already that experienced.");
} else if (newlevel < u.ulevel) {
if (u.ulevel == 1) {
You("are already as inexperienced as you can get.");
return 0;
return MOVE_CANCELLED;
}
if (newlevel < 1) newlevel = 1;
while (u.ulevel > newlevel)
@ -1368,14 +1368,14 @@ wiz_level_change()
} else {
if (u.ulevel >= MAXULEV) {
You("are already as experienced as you can get.");
return 0;
return MOVE_CANCELLED;
}
if (newlevel > MAXULEV) newlevel = MAXULEV;
while (u.ulevel < newlevel)
pluslvl(FALSE);
}
u.ulevelmax = u.ulevel;
return 0;
return MOVE_CANCELLED;
}
/* #panic command - test program's panic handling */
@ -1385,20 +1385,20 @@ wiz_panic()
if (iflags.debug_fuzzer) {
u.uhp = u.uhpmax = 1000;
u.uen = u.uenmax = 1000;
return 0;
return MOVE_CANCELLED;
}
if (yn("Do you want to call panic() and end your game?") == 'y')
panic("crash test.");
return 0;
return MOVE_CANCELLED;
}
/* #polyself command - change hero's form */
STATIC_PTR int
wiz_polyself()
{
polyself(TRUE);
return 0;
polyself(TRUE);
return MOVE_CANCELLED;
}
/* #seenv command */
@ -1440,7 +1440,7 @@ wiz_show_seenv()
}
display_nhwindow(win, TRUE);
destroy_nhwindow(win);
return 0;
return MOVE_CANCELLED;
}
/* #vision command */
@ -1477,7 +1477,7 @@ wiz_show_vision()
}
display_nhwindow(win, TRUE);
destroy_nhwindow(win);
return 0;
return MOVE_CANCELLED;
}
/* #wmode command */
@ -1509,14 +1509,14 @@ wiz_show_wmodes()
}
display_nhwindow(win, TRUE);
destroy_nhwindow(win);
return 0;
return MOVE_CANCELLED;
}
/* #showkills command */
STATIC_PTR int wiz_showkills() /* showborn patch */
{
list_vanquished('y', FALSE);
return 0;
return MOVE_CANCELLED;
}
STATIC_PTR int wiz_setinsight()
@ -1529,7 +1529,7 @@ STATIC_PTR int wiz_setinsight()
if (yn("Pierce veil?") == 'y')
u.veil = FALSE;
else
return 0;
return MOVE_CANCELLED;
}
getlin("Set your insight to what?", buf);
@ -1539,10 +1539,10 @@ STATIC_PTR int wiz_setinsight()
if (ret != 1) {
pline1(Never_mind);
return 0;
return MOVE_CANCELLED;
}
change_uinsight(newval - u.uinsight);
return 0;
return MOVE_INSTANT;
}
STATIC_PTR int wiz_setsanity()
{
@ -1558,10 +1558,10 @@ STATIC_PTR int wiz_setsanity()
if (ret != 1) {
pline1(Never_mind);
return 0;
return MOVE_CANCELLED;
}
change_usanity(newval - u.usanity, FALSE);
return 0;
return MOVE_INSTANT;
}
#endif /* WIZARD */
@ -1610,7 +1610,7 @@ int typ;
if (pick_list) {
n = (pick_list[0].item.a_int - 1);
free((genericptr_t) pick_list);
} else return 0;
} else return MOVE_CANCELLED;
} else {
n = (typ - 1);
}
@ -1633,7 +1633,7 @@ int typ;
if (!obj->dknown) {
You("would never recognize another one.");
return 0;
return MOVE_CANCELLED;
}
docall(obj);
}
@ -1641,7 +1641,7 @@ int typ;
case 3: dodiscovered(); break;
case 4: do_floorname(); break;
}
return 0;
return MOVE_INSTANT;
}
int
@ -2440,7 +2440,7 @@ wiz_show_stats()
display_nhwindow(win, FALSE);
destroy_nhwindow(win);
return 0;
return MOVE_CANCELLED;
}
void

View file

@ -1646,7 +1646,7 @@ register int aflag;
}
} else if (!sensemon(mtmp))
You("find %s.", a_monnam(mtmp));
return(1);
return MOVE_STANDARD;
}
if(!canspotmon(mtmp)) {
if (mtmp->mundetected &&
@ -1672,7 +1672,7 @@ register int aflag;
if (trap->ttyp == STATUE_TRAP) {
if (activate_statue_trap(trap, x, y, FALSE))
exercise(A_WIS, TRUE);
return(1);
return MOVE_STANDARD;
} else {
find_trap(trap);
}
@ -1681,7 +1681,7 @@ register int aflag;
}
}
}
return(1);
return MOVE_STANDARD;
}
int

View file

@ -1860,15 +1860,15 @@ struct obj *obj;
char qbuf[QBUFSZ];
register char *dsp = dirsyms;
register int rx, ry;
int res = 0;
int res = MOVE_CANCELLED;
register const char *sdp, *verb;
if(iflags.num_pad) sdp = ndir; else sdp = sdir; /* DICE workaround */
/* Check tool */
if (obj != uwep && obj != uarmg) {
if (!wield_tool(obj, "swing")) return 0;
else res = 1;
if (!wield_tool(obj, "swing")) return MOVE_CANCELLED;
else res = MOVE_STANDARD;
}
ispick = is_pick(obj);
verb = ispick ? "dig" : "chop";
@ -1954,7 +1954,7 @@ struct obj *obj;
OBJ_NAME(objects[obj->otyp]));
losehp(dam, buf, KILLED_BY);
flags.botl=1;
return(1);
return MOVE_STANDARD;
} else if(u.dz == 0) {
if(Stunned || (Confusion && !rn2(5))) confdir();
rx = u.ux + u.dx;
@ -1964,11 +1964,11 @@ struct obj *obj;
aobjnam(obj, (char *)0));
else if (digtyp == HAMMER_TYP) pline("Clunk!");
else pline("Clash!");
return(1);
return MOVE_STANDARD;
}
lev = &levl[rx][ry];
if(MON_AT(rx, ry) && attack2(m_at(rx, ry)))
return(1);
return MOVE_ATTACKED;
dig_target = dig_typ(obj, rx, ry);
if (dig_target == DIGTYP_UNDIGGABLE) {
/* ACCESSIBLE or POOL */
@ -2089,7 +2089,7 @@ struct obj *obj;
did_dig_msg = FALSE;
set_occupation(dig, verbing, 0);
}
return(1);
return MOVE_STANDARD;
}
/*

View file

@ -1352,7 +1352,7 @@ int
doredraw()
{
docrt();
return 0;
return MOVE_CANCELLED;
}
void

View file

@ -2453,7 +2453,7 @@ donull()
}
}
}
return(1); /* Do nothing, but let other things happen */
return MOVE_STANDARD; /* Do nothing, but let other things happen */
}
#endif /* OVL3 */
@ -2490,10 +2490,10 @@ dowipe()
/* Not totally correct; what if they change back after now
* but before they're finished wiping?
*/
return(1);
return MOVE_STANDARD;
}
Your("%s is already clean.", body_part(FACE));
return(1);
return MOVE_STANDARD;
}
void
@ -2549,7 +2549,7 @@ int
dowait()
{
struct monst *mtmp;
if (!getdir("Indicate pet that should wait, or '.' for all.")) return(0);
if (!getdir("Indicate pet that should wait, or '.' for all.")) return MOVE_CANCELLED;
if(!(u.dx || u.dy)){
You("order all your pets to wait for your return.");
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon){
@ -2560,21 +2560,21 @@ dowait()
mtmp = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mtmp){
pline("There is no target there.");
return 0;
return MOVE_INSTANT;
}
if(mtmp->mtame){
mtmp->mwait = monstermoves;
You("order %s to wait for your return.", mon_nam(mtmp));
}
} else pline("There is no target there.");
return 0;
return MOVE_INSTANT;
}
int
docome()
{
struct monst *mtmp;
if (!getdir("Indicate pet that should come with you, or '.' for all.")) return(0);
if (!getdir("Indicate pet that should come with you, or '.' for all.")) return MOVE_CANCELLED;
if(!(u.dx || u.dy)){
You("order all your pets to follow you.");
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon){
@ -2585,14 +2585,14 @@ docome()
mtmp = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mtmp){
pline("There is no target there.");
return 0;
return MOVE_INSTANT;
}
if(mtmp->mtame){
mtmp->mwait = 0;
You("order %s to follow you.", mon_nam(mtmp));
}
} else pline("There is no target there.");
return 0;
return MOVE_INSTANT;
}
#endif /* OVLB */

View file

@ -1359,12 +1359,12 @@ dotakeoff()
/* nohands checks for shields, gloves, etc... */
if (nohands(youracedata)) {
pline("Don't even bother.");
return(0);
return MOVE_CANCELLED;
}
if(!freehand()){
You("have no free %s to undress yourself with!", body_part(HAND));
return(0);
return MOVE_CANCELLED;
}
#define MOREARM(x) if (x) { armorpieces++; otmp = x; }
@ -1397,7 +1397,7 @@ dotakeoff()
pline("Not wearing any armor.%s", (iflags.cmdassist &&
(uleft || uright || uamul || ublindf)) ?
" Use 'R' command to remove accessories." : "");
return 0;
return MOVE_CANCELLED;
}
if (armorpieces > 1
#ifdef PARANOID
@ -1405,10 +1405,10 @@ dotakeoff()
#endif
)
otmp = getobj(clothes, "take off");
if (otmp == 0) return(0);
if (otmp == 0) return MOVE_CANCELLED;
if (!(otmp->owornmask & W_ARMOR)) {
You("are not wearing that.");
return(0);
return MOVE_CANCELLED;
}
/* note: the `uskin' case shouldn't be able to happen here; dragons
can't wear any armor so will end up with `armorpieces == 0' above */
@ -1416,16 +1416,16 @@ dotakeoff()
|| ((otmp == uarmu) && (uarmc || (uarm && arm_blocks_upper_body(uarm->otyp))))
){
You_cant("take that off.");
return 0;
return MOVE_CANCELLED;
}
reset_remarm(); /* clear takeoff_mask and taking_off */
(void) select_off(otmp);
if (!takeoff_mask) return 0;
if (!takeoff_mask) return MOVE_CANCELLED;
reset_remarm(); /* armoroff() doesn't use takeoff_mask */
(void) armoroff(otmp);
return(1);
return MOVE_STANDARD;
}
/* the 'R' command */
@ -1437,7 +1437,7 @@ doremring()
if(!freehand()){
You("have no free %s to remove accessories with!", body_part(HAND));
return(0);
return MOVE_CANCELLED;
}
#define MOREACC(x) if (x) { Accessories++; otmp = x; }
@ -1451,22 +1451,22 @@ doremring()
(uarm || uarmc || uarmu ||
uarms || uarmh || uarmg || uarmf)) ?
" Use 'T' command to take off armor." : "");
return(0);
return MOVE_CANCELLED;
}
if (Accessories != 1
#ifdef PARANOID
|| iflags.paranoid_remove
#endif
) otmp = getobj(accessories, "remove");
if(!otmp) return(0);
if(!otmp) return MOVE_CANCELLED;
if(!(otmp->owornmask & (W_RING | W_AMUL | W_TOOL))) {
You("are not wearing that.");
return(0);
return MOVE_CANCELLED;
}
reset_remarm(); /* clear takeoff_mask and taking_off */
(void) select_off(otmp);
if (!takeoff_mask) return 0;
if (!takeoff_mask) return MOVE_CANCELLED;
reset_remarm(); /* not used by Ring_/Amulet_/Blindf_off() */
if (otmp == uright || otmp == uleft) {
@ -1486,7 +1486,7 @@ doremring()
} else {
impossible("removing strange accessory?");
}
return(1);
return MOVE_STANDARD;
}
/* Check if something worn is cursed _and_ unremovable. */
@ -1511,7 +1511,7 @@ register struct obj *otmp;
{
register int delay = -objects[otmp->otyp].oc_delay;
if(cursed(otmp)) return(0);
if(cursed(otmp)) return MOVE_CANCELLED;
if(delay) {
nomul(delay, "disrobing");
if (otmp == uarms) {
@ -1582,7 +1582,7 @@ register struct obj *otmp;
off_msg(otmp);
}
takeoff_mask = taking_off = 0L;
return(1);
return MOVE_STANDARD;
}
STATIC_OVL void
@ -1804,21 +1804,21 @@ dowear()
/* nohands checks for shields, gloves, etc... */
if (nohands(youracedata)) {
pline("Don't even bother.");
return(0);
return MOVE_CANCELLED;
}
if(!freehand()){
You("have no free %s to dress yourself with!", body_part(HAND));
return(0);
return MOVE_CANCELLED;
}
otmp = getobj(clothes, "wear");
if(!otmp) return(0);
if(!otmp) return MOVE_CANCELLED;
if (!canwearobj(otmp,&mask,TRUE)) return(0);
if (!canwearobj(otmp,&mask,TRUE)) return MOVE_CANCELLED;
if (otmp->oartifact && !touch_artifact(otmp, &youmonst, FALSE))
return 1; /* costs a turn even though it didn't get worn */
return MOVE_STANDARD; /* costs a turn even though it didn't get worn */
if (otmp->otyp == HELM_OF_OPPOSITE_ALIGNMENT &&
qstart_level.dnum == u.uz.dnum) { /* in quest */
@ -1829,7 +1829,7 @@ dowear()
u.ublessed = 0; /* lose your god's protection */
makeknown(otmp->otyp);
flags.botl = 1;
return 1;
return MOVE_STANDARD;
}
if(otmp->ostolen && u.sealsActive&SEAL_ANDROMALIUS) unbind(SEAL_ANDROMALIUS, TRUE);
@ -1863,7 +1863,7 @@ dowear()
on_msg(otmp);
}
takeoff_mask = taking_off = 0L;
return(1);
return MOVE_STANDARD;
}
int
@ -1874,7 +1874,7 @@ doputon()
if(!freehand()){
You("have no free %s to put on accessories with!", body_part(HAND));
return(0);
return MOVE_CANCELLED;
}
if(uleft && (uright || (uarmg && uarmg->oartifact == ART_CLAWS_OF_THE_REVENANCER)) && uamul && ublindf) {
@ -1882,17 +1882,17 @@ doputon()
humanoid(youracedata) ? "ring-" : "",
makeplural(body_part(FINGER)),
(ublindf->otyp==LENSES || ublindf->otyp==SUNGLASSES) ? "some lenses" : (ublindf->otyp==MASK || ublindf->otyp==LIVING_MASK || ublindf->otyp==R_LYEHIAN_FACEPLATE) ? "a mask" : "a blindfold");
return(0);
return MOVE_CANCELLED;
}
otmp = getobj(accessories, "put on");
if(!otmp) return(0);
if(!otmp) return MOVE_CANCELLED;
if(otmp->owornmask & (W_RING | W_AMUL | W_TOOL)) {
already_wearing(c_that_);
return(0);
return MOVE_CANCELLED;
}
if(welded(otmp)) {
weldmsg(otmp);
return(0);
return MOVE_CANCELLED;
}
if(otmp == uwep)
setuwep((struct obj *)0);
@ -1903,13 +1903,13 @@ doputon()
if(otmp->oclass == RING_CLASS || otmp->otyp == MEAT_RING) {
if(nolimbs(youracedata)) {
You("cannot make the ring stick to your body.");
return(0);
return MOVE_CANCELLED;
}
if(uleft && (uright || (uarmg && uarmg->oartifact == ART_CLAWS_OF_THE_REVENANCER))){
There("are no more %s%s to fill.",
humanoid(youracedata) ? "ring-" : "",
makeplural(body_part(FINGER)));
return(0);
return MOVE_CANCELLED;
}
if(uleft) mask = RIGHT_RING;
else if((uright || (uarmg && uarmg->oartifact == ART_CLAWS_OF_THE_REVENANCER))) mask = LEFT_RING;
@ -1921,7 +1921,7 @@ doputon()
humanoid(youracedata) ? "ring-" : "",
body_part(FINGER));
if(!(answer = yn_function(qbuf, "rl", '\0')))
return(0);
return MOVE_CANCELLED;
switch(answer){
case 'l':
case 'L':
@ -1936,34 +1936,34 @@ doputon()
if (uarmg && uarmg->cursed && !Weldproof) {
uarmg->bknown = TRUE;
You("cannot remove your gloves to put on the ring.");
return(0);
return MOVE_CANCELLED;
}
if (welded(uwep) && bimanual(uwep,youracedata)) {
/* welded will set bknown */
You("cannot free your weapon hands to put on the ring.");
return(0);
return MOVE_CANCELLED;
}
if (welded(uwep) && mask==RIGHT_RING) {
/* welded will set bknown */
You("cannot free your weapon hand to put on the ring.");
return(0);
return MOVE_CANCELLED;
}
if (otmp->oartifact && !touch_artifact(otmp, &youmonst, FALSE))
return 1; /* costs a turn even though it didn't get worn */
return MOVE_STANDARD; /* costs a turn even though it didn't get worn */
setworn(otmp, mask);
Ring_on(otmp);
} else if (otmp->oclass == AMULET_CLASS) {
if(uamul) {
already_wearing("an amulet");
return(0);
return MOVE_CANCELLED;
}
if (otmp->oartifact && !touch_artifact(otmp, &youmonst, FALSE))
return 1;
return MOVE_STANDARD;
setworn(otmp, W_AMUL);
if (otmp->otyp == AMULET_OF_CHANGE) {
Amulet_on();
/* Don't do a prinv() since the amulet is now gone */
return(1);
return MOVE_STANDARD;
}
Amulet_on();
} else { /* it's a blindfold, towel, or lenses */
@ -1983,7 +1983,7 @@ doputon()
already_wearing("some lenses");
} else
already_wearing(something);
return(0);
return MOVE_CANCELLED;
}
if (otmp->otyp != MASK && otmp->otyp != R_LYEHIAN_FACEPLATE &&
otmp->otyp != BLINDFOLD && otmp->otyp != ANDROID_VISOR &&
@ -1991,7 +1991,7 @@ doputon()
otmp->otyp != SUNGLASSES && otmp->otyp != LIVING_MASK
) {
You_cant("wear that!");
return(0);
return MOVE_CANCELLED;
}
if (uarmh && FacelessHelm(uarmh) && uarmh->cursed && !Weldproof){
pline("The %s covers your whole face. You need to remove it first.", xname(uarmh));
@ -2010,11 +2010,11 @@ doputon()
return 0;
}
Blindf_on(otmp);
return(1);
return MOVE_STANDARD;
}
if (is_worn(otmp))
prinv((char *)0, otmp, 0L);
return(1);
return MOVE_STANDARD;
}
#endif /* OVLB */
@ -3099,7 +3099,7 @@ register struct obj *otmp;
else impossible("select_off: %s???", doname(otmp));
return(0);
return MOVE_CANCELLED;
}
STATIC_OVL struct obj *

View file

@ -729,11 +729,11 @@ int dx, dy;
if (!dx && !dy && yn_function("Kick your steed?", ynchars, 'y') == 'y') {
You("kick %s.", mon_nam(u.usteed));
kick_steed();
return 1;
return MOVE_STANDARD;
} else {
if(dx || dy)
You("can't kick while riding!");
return 0;
return MOVE_CANCELLED;
}
#endif
} else if (Wounded_legs) {
@ -783,15 +783,15 @@ int dx, dy;
if (no_kick) {
/* ignore direction typed before player notices kick failed */
display_nhwindow(WIN_MESSAGE, TRUE); /* --More-- */
return 0;
return MOVE_CANCELLED;
}
if(!dx && !dy && !getdir((char *)0)) return(0);
if(!dx && !dy && !getdir((char *)0)) return MOVE_CANCELLED;
if(!dx && !dy){
dx = u.dx;
dy = u.dy;
}
if(!dx && !dy) return(0);
if(!dx && !dy) return MOVE_CANCELLED;
x = u.ux + dx;
y = u.uy + dy;
@ -807,7 +807,7 @@ int dx, dy;
flags.forcefight = TRUE; /* attack even if invisible */
kick_monster(x, y);
flags.forcefight = FALSE;
return 1;
return MOVE_STANDARD;
}
else {
switch(rn2(3)) {
@ -819,7 +819,7 @@ int dx, dy;
}
default: Your("feeble kick has no effect."); break;
}
return(1);
return MOVE_STANDARD;
}
}
if (Levitation) {
@ -835,7 +835,7 @@ int dx, dy;
!IS_DOOR(levl[xx][yy].typ) &&
(!Weightless || !OBJ_AT(xx,yy))) {
You("have nothing to brace yourself against.");
return(0);
return MOVE_CANCELLED;
}
}
@ -885,7 +885,7 @@ int dx, dy;
hurtle(-dx, -dy, range, TRUE, TRUE);
}
wake_nearby();
return(1);
return MOVE_STANDARD;
}
if (glyph_is_invisible(levl[x][y].glyph)) {
unmap_object(x, y);
@ -895,7 +895,7 @@ int dx, dy;
/* objects normally can't be removed from water by kicking */
You("splash some water around.");
wake_nearby();
return 1;
return MOVE_STANDARD;
}
kickobj = (struct obj *)0;
@ -907,7 +907,7 @@ int dx, dy;
wake_nearby();
hurtle(-dx, -dy, 1, TRUE, TRUE); /* assume it's light */
}
return(1);
return MOVE_STANDARD;
}
goto ouch;
}
@ -937,7 +937,7 @@ int dx, dy;
maploc->doormask == D_NODOOR)
unblock_point(x,y); /* vision */
wake_nearby();
return(1);
return MOVE_STANDARD;
} else goto ouch;
}
if(maploc->typ == SCORR) {
@ -952,7 +952,7 @@ int dx, dy;
newsym(x,y);
unblock_point(x,y); /* vision */
wake_nearby();
return(1);
return MOVE_STANDARD;
} else goto ouch;
}
if(IS_THRONE(maploc->typ)) {
@ -972,7 +972,7 @@ int dx, dy;
if(u.sealsActive&SEAL_DANTALION) unbind(SEAL_DANTALION,TRUE);
exercise(A_DEX, TRUE);
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if(Luck > 0 && !rn2(3) && !(maploc->looted&T_LOOTED)) {
(void) mkgold((long) rn1(201, 300), x, y);
i = Luck + 1;
@ -988,12 +988,12 @@ int dx, dy;
/* prevent endless milking */
maploc->looted &= T_LOOTED;
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if (!rn2(4)) {
if(dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz)) {
wake_nearby();
fall_through(FALSE);
return(1);
return MOVE_STANDARD;
} else goto ouch;
}
goto ouch;
@ -1005,7 +1005,7 @@ int dx, dy;
altar_wrath(x, y);
exercise(A_DEX, TRUE);
wake_nearby();
return(1);
return MOVE_STANDARD;
}
if(IS_FOUNTAIN(maploc->typ)) {
if(Levitation) goto dumb;
@ -1019,7 +1019,7 @@ int dx, dy;
}
exercise(A_DEX, TRUE);
wake_nearby();
return(1);
return MOVE_STANDARD;
}
if(IS_GRAVE(maploc->typ) || maploc->typ == IRONBARS)
goto ouch;
@ -1047,7 +1047,7 @@ int dx, dy;
pline("Some black feathers drift down.");
maploc->looted |= TREE_SWARM;
wake_nearby();
return(1);
return MOVE_STANDARD;
}
goto ouch;
} else if((In_quest(&u.uz) && Role_if(PM_PIRATE)) || Is_paradise(&u.uz)){
@ -1079,7 +1079,7 @@ int dx, dy;
newsym(x, y);
maploc->looted |= TREE_LOOTED;
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if (rn2(3)) {
if ( !rn2(3) && !(mvitals[PM_PARROT].mvflags & G_GONE && !In_quest(&u.uz)) )
You_hear("flapping wings."); /* a warning */
@ -1101,7 +1101,7 @@ int dx, dy;
pline("Some colorful feathers drift down.");
maploc->looted |= TREE_SWARM;
wake_nearby();
return(1);
return MOVE_STANDARD;
}
goto ouch;
} else if(In_quest(&u.uz) && (Race_if(PM_DROW) || (Race_if(PM_DWARF) && Role_if(PM_NOBLEMAN)))){
@ -1133,7 +1133,7 @@ int dx, dy;
newsym(x, y);
maploc->looted |= TREE_LOOTED;
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if (rn2(3)) {
if ( !rn2(3) && !(mvitals[PM_MIRKWOOD_SPIDER].mvflags & G_GONE && !In_quest(&u.uz)) )
You_hear("skittering legs."); /* a warning */
@ -1155,7 +1155,7 @@ int dx, dy;
pline("Some scraps of webbing drift down.");
maploc->looted |= TREE_SWARM;
wake_nearby();
return(1);
return MOVE_STANDARD;
}
goto ouch;
} else if(u.uz.dnum == chaos_dnum) {
@ -1180,7 +1180,7 @@ int dx, dy;
mtmp->mcanmove = TRUE;
maploc->looted |= TREE_SWARM;
wake_nearby();
return(1);
return MOVE_STANDARD;
}
goto ouch;
} else if(In_neu(&u.uz) || (In_quest(&u.uz) &&
@ -1220,7 +1220,7 @@ int dx, dy;
newsym(x, y);
maploc->looted |= TREE_LOOTED;
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if (!(maploc->looted & TREE_SWARM)) {
int cnt = rnl(4) + 4;
int made = 0;
@ -1240,7 +1240,7 @@ int dx, dy;
pline("You've attracted the tree's guardians!");
maploc->looted |= TREE_SWARM;
wake_nearby();
return(1);
return MOVE_STANDARD;
}
goto ouch;
} else{
@ -1275,7 +1275,7 @@ int dx, dy;
newsym(x, y);
maploc->looted |= TREE_LOOTED;
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if (!(maploc->looted & TREE_SWARM)) {
int cnt = rnl(4) + 2;
int made = 0;
@ -1293,7 +1293,7 @@ int dx, dy;
You("smell stale honey.");
maploc->looted |= TREE_SWARM;
wake_nearby();
return(1);
return MOVE_STANDARD;
}
goto ouch;
}
@ -1338,7 +1338,7 @@ int dx, dy;
}
}
wake_nearby();
return(1);
return MOVE_STANDARD;
}
#ifdef SINKS
if(IS_SINK(maploc->typ)) {
@ -1353,7 +1353,7 @@ int dx, dy;
else pline("Klunk!");
exercise(A_DEX, TRUE);
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if(!(maploc->looted & S_LPUDDING) && !rn2(3) &&
!(mvitals[PM_BLACK_PUDDING].mvflags & G_GONE && !In_quest(&u.uz))) {
if (Blind)
@ -1367,7 +1367,7 @@ int dx, dy;
newsym(x,y);
maploc->looted |= S_LPUDDING;
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if(!(maploc->looted & S_LDWASHER) && !rn2(3) &&
!(mvitals[washerndx].mvflags & G_GONE && !In_quest(&u.uz))) {
/* can't resist... */
@ -1378,7 +1378,7 @@ int dx, dy;
maploc->looted |= S_LDWASHER;
exercise(A_DEX, TRUE);
wake_nearby();
return(1);
return MOVE_STANDARD;
} else if(!rn2(3)) {
pline("Flupp! %s.", (Blind ?
"You hear a sloshing sound" :
@ -1393,7 +1393,7 @@ int dx, dy;
maploc->looted |= S_LRING;
}
wake_nearby();
return(1);
return MOVE_STANDARD;
}
goto ouch;
}
@ -1422,7 +1422,7 @@ ouch:
wake_nearby();
hurtle(-dx, -dy, rn1(2,4), TRUE, TRUE); /* assume it's heavy */
}
return(1);
return MOVE_STANDARD;
}
goto dumb;
}
@ -1443,7 +1443,7 @@ dumb:
if ((Weightless || Levitation) && rn2(2)) {
hurtle(-dx, -dy, 1, TRUE, TRUE);
}
return 1;
return MOVE_STANDARD;
}
/* Ali - artifact doors from slashem*/
@ -1523,7 +1523,7 @@ dumb:
}
}
}
return 1;
return MOVE_STANDARD;
}
STATIC_OVL void

View file

@ -2199,12 +2199,12 @@ donamelevel()
char nbuf[BUFSZ]; /* Buffer for response */
int len;
if (!(mptr = find_mapseen(&u.uz))) return 0;
if (!(mptr = find_mapseen(&u.uz))) return MOVE_CANCELLED;
Sprintf(qbuf,"What do you want to call this dungeon level? ");
getlin(qbuf, nbuf);
if (index(nbuf, '\033')) return 0;
if (index(nbuf, '\033')) return MOVE_CANCELLED;
len = strlen(nbuf) + 1;
if (mptr->custom) {
@ -2219,7 +2219,7 @@ donamelevel()
strcpy(mptr->custom, nbuf);
}
return 0;
return MOVE_CANCELLED;
}
/* find the particular mapseen object in the chain */
@ -2599,7 +2599,7 @@ dooverview()
} else {
You("have found nothing of note.");
}
return 0;
return MOVE_CANCELLED;
}
STATIC_OVL char *

View file

@ -301,7 +301,7 @@ int
done2()
{
if (iflags.debug_fuzzer)
return 0;
return MOVE_CANCELLED;
#ifdef PARANOID
char buf[BUFSZ];
int really_quit = FALSE;
@ -328,7 +328,7 @@ done2()
u.uinvulnerable = FALSE; /* avoid ctrl-C bug -dlc */
u.usleep = 0;
}
return 0;
return MOVE_CANCELLED;
}
#if defined(WIZARD) && (defined(UNIX) || defined(VMS) || defined(LATTICE))
if(wizard) {
@ -352,7 +352,7 @@ done2()
#ifndef LINT
done(QUIT);
#endif
return 0;
return MOVE_CANCELLED;
}
#ifndef NO_SIGNAL

View file

@ -2305,7 +2305,7 @@ dopickup()
} else
You("don't %s anything in here to pick up.",
Blind ? "feel" : "see");
return(1);
return MOVE_STANDARD;
} else {
int tmpcount = -count;
return loot_mon(u.ustuck, &tmpcount, (boolean *)0);
@ -2315,26 +2315,26 @@ dopickup()
if (Wwalking || mon_resistance(&youmonst,LEVITATION) || is_clinger(youracedata)
|| (Flying && !Breathless)) {
You("cannot dive into the water to pick things up.");
return(0);
return MOVE_CANCELLED;
} else if (!Underwater) {
You_cant("even see the bottom, let alone pick up %s.",
something);
return(0);
return MOVE_CANCELLED;
}
}
if (is_lava(u.ux, u.uy)) {
if (Wwalking || mon_resistance(&youmonst,LEVITATION) || is_clinger(youracedata)
|| (Flying && !Breathless)) {
You_cant("reach the bottom to pick things up.");
return(0);
return MOVE_CANCELLED;
} else if (!likes_lava(youracedata)) {
You("would burn to a crisp trying to pick things up.");
return(0);
return MOVE_CANCELLED;
}
}
if(!OBJ_AT(u.ux, u.uy)) {
There("is nothing here to pick up.");
return(0);
return MOVE_CANCELLED;
}
if (!can_reach_floor()) {
#ifdef STEED
@ -2344,7 +2344,7 @@ dopickup()
else
#endif
You("cannot reach the %s.", surface(u.ux,u.uy));
return(0);
return MOVE_CANCELLED;
}
if (traphere && traphere->tseen) {
@ -2356,11 +2356,11 @@ dopickup()
if ((traphere->ttyp == PIT || traphere->ttyp == SPIKED_PIT) &&
(!u.utrap || (u.utrap && u.utraptype != TT_PIT)) && !Flying) {
You("cannot reach the bottom of the pit.");
return(0);
return MOVE_CANCELLED;
}
}
return (pickup(-count));
return (pickup(-count)) ? MOVE_STANDARD : MOVE_CANCELLED;
}
#endif /* OVLB */

View file

@ -4392,7 +4392,7 @@ dotypeinv()
if (!invent && !billx) {
#endif
You("aren't carrying anything.");
return 0;
return MOVE_CANCELLED;
}
unpaid_count = count_unpaid(invent);
if (flags.menu_style != MENU_TRADITIONAL) {
@ -4402,7 +4402,7 @@ dotypeinv()
i = UNPAID_TYPES;
if (billx) i |= BILLED_TYPES;
n = query_category(prompt, invent, i, &pick_list, PICK_ONE);
if (!n) return 0;
if (!n) return MOVE_CANCELLED;
this_type = c = pick_list[0].item.a_int;
free((genericptr_t) pick_list);
}
@ -4443,7 +4443,7 @@ dotypeinv()
#endif
if(c == '\0') {
clear_nhwindow(WIN_MESSAGE);
return 0;
return MOVE_CANCELLED;
}
} else {
/* only one thing to itemize */
@ -4460,14 +4460,14 @@ dotypeinv()
(void) doinvbill(1);
else
pline("No used-up objects on your shopping bill.");
return 0;
return MOVE_CANCELLED;
}
if (c == 'u') {
if (unpaid_count)
dounpaid();
else
You("are not carrying any unpaid objects.");
return 0;
return MOVE_CANCELLED;
}
if (traditional) {
oclass = def_char_to_objclass(c); /* change to object class */
@ -4475,7 +4475,7 @@ dotypeinv()
return doprgold();
} else if (index(types, c) > index(types, '\033')) {
You("have no such objects.");
return 0;
return MOVE_CANCELLED;
}
this_type = oclass;
}
@ -4483,7 +4483,7 @@ dotypeinv()
(flags.invlet_constant ? USE_INVLET : 0)|INVORDER_SORT,
&pick_list, PICK_NONE, this_type_only) > 0)
free((genericptr_t)pick_list);
return 0;
return MOVE_CANCELLED;
}
/* return a string describing the dungeon feature at <x,y> if there
@ -4603,7 +4603,7 @@ boolean picked_some;
} else {
You("%s no objects here.", verb);
}
return(!!Blind);
return (Blind ? MOVE_STANDARD : MOVE_INSTANT);
}
if (!skip_objects && (trap = t_at(u.ux,u.uy)) && trap->tseen)
There("is %s here.",
@ -4628,7 +4628,7 @@ boolean picked_some;
dfeature = 0; /* ice already identifed */
if (!can_reach_floor()) {
pline("But you can't reach it!");
return(0);
return MOVE_INSTANT;
}
}
@ -4640,7 +4640,7 @@ boolean picked_some;
read_engr_at(u.ux, u.uy); /* Eric Backus */
if (!skip_objects && (Blind || !dfeature))
You("%s no objects here.", verb);
return(!!Blind);
return (Blind ? MOVE_STANDARD : MOVE_INSTANT);
}
/* we know there is something here */
@ -4684,7 +4684,7 @@ boolean picked_some;
if (felt_cockatrice) feel_cockatrice(otmp, FALSE);
read_engr_at(u.ux, u.uy); /* Eric Backus */
}
return(!!Blind);
return (Blind ? MOVE_STANDARD : MOVE_INSTANT);
}
/* explicilty look at what is here, including all objects */
@ -4868,7 +4868,7 @@ doprgold()
Your("wallet contains %ld %s.", umoney, currency(umoney));
#endif
shopper_financial_report();
return 0;
return MOVE_CANCELLED;
}
#endif /* OVL1 */
@ -4886,7 +4886,7 @@ doprwep()
if (!uwep) You("are empty %s.", body_part(HANDED));
else prinv((char *)0, uwep, 0L);
}
return 0;
return MOVE_CANCELLED;
}
int
@ -4915,7 +4915,7 @@ doprarm()
(void) display_inventory(lets, FALSE);
}
udr_enlightenment();
return 0;
return MOVE_CANCELLED;
}
int
@ -4932,7 +4932,7 @@ doprring()
lets[ct] = 0;
(void) display_inventory(lets, FALSE);
}
return 0;
return MOVE_CANCELLED;
}
int
@ -4942,7 +4942,7 @@ dopramulet()
You("are not wearing an amulet.");
else
prinv((char *)0, uamul, 0L);
return 0;
return MOVE_CANCELLED;
}
STATIC_OVL boolean
@ -4972,7 +4972,7 @@ doprtool()
lets[ct] = '\0';
if (!ct) You("are not using any tools.");
else (void) display_inventory(lets, FALSE);
return 0;
return MOVE_CANCELLED;
}
/* '*' command; combines the ')' + '[' + '=' + '"' + '(' commands;
@ -4990,7 +4990,7 @@ doprinuse()
lets[ct] = '\0';
if (!ct) You("are not wearing or wielding anything.");
else (void) display_inventory(lets, FALSE);
return 0;
return MOVE_CANCELLED;
}
/*
@ -5157,7 +5157,7 @@ doorganize() /* inventory organizer by Del Lamb */
if (!flags.invlet_constant) reassign();
/* get a pointer to the object the user wants to organize */
allowall[0] = ALL_CLASSES; allowall[1] = '\0';
if (!(obj = getobj(allowall,"adjust"))) return(0);
if (!(obj = getobj(allowall,"adjust"))) return MOVE_CANCELLED;
/* initialize the list with all upper and lower case letters */
for (let = 'a', ix = 0; let <= 'z';) alphabet[ix++] = let++;
@ -5226,7 +5226,7 @@ doorganize() /* inventory organizer by Del Lamb */
prinv(adj_type, obj, 0L);
update_inventory();
return(0);
return MOVE_CANCELLED;
}
/* common to display_minventory and display_cinventory */

View file

@ -407,27 +407,27 @@ pick_lock(pick) /* pick a lock with a given object */
#endif
pline(no_longer, "hold the", what);
reset_pick();
return 0;
return MOVE_CANCELLED;
} else if (xlock.box && !can_reach_floor()) {
pline(no_longer, "reach the", "lock");
reset_pick();
return 0;
return MOVE_CANCELLED;
} else if (!xlock.door || xlock.key == pick->oartifact) {
/* part of slash'em's artifact key code, I think -D_E */
const char *action = lock_action();
You("resume your attempt at %s.", action);
set_occupation(picklock, action, 0);
return(1);
return MOVE_STANDARD;
}
}
if(nohands(youracedata)) {
You_cant("hold %s -- you have no hands!", doname(pick));
return(0);
return MOVE_CANCELLED;
}
if(!freehand()){
You_cant("hold %s -- you have no free hands!", doname(pick));
return(0);
return MOVE_CANCELLED;
}
if((picktyp != LOCK_PICK &&
@ -437,11 +437,11 @@ pick_lock(pick) /* pick a lock with a given object */
picktyp != SKELETON_KEY &&
picktyp != UNIVERSAL_KEY)) {
impossible("picking lock with object %d?", picktyp);
return(0);
return MOVE_CANCELLED;
}
ch = 0; /* lint suppression */
if(!get_adjacent_loc((char *)0, "Invalid location!", u.ux, u.uy, &cc)) return 0;
if(!get_adjacent_loc((char *)0, "Invalid location!", u.ux, u.uy, &cc)) return MOVE_CANCELLED;
if (cc.x == u.ux && cc.y == u.uy) { /* pick lock on a container */
const char *verb;
boolean it;
@ -450,14 +450,14 @@ pick_lock(pick) /* pick a lock with a given object */
if (u.dz < 0) {
There("isn't any sort of lock up %s.",
Levitation ? "here" : "there");
return 0;
return MOVE_CANCELLED;
} else if (is_lava(u.ux, u.uy)) {
pline("Doing that would probably melt your %s.",
xname(pick));
return 0;
return MOVE_CANCELLED;
} else if (is_pool(u.ux, u.uy, FALSE) && !Underwater) {
pline_The("water has no lock.");
return 0;
return MOVE_CANCELLED;
}
count = 0;
@ -467,7 +467,7 @@ pick_lock(pick) /* pick a lock with a given object */
++count;
if (!can_reach_floor()) {
You_cant("reach %s from up here.", the(xname(otmp)));
return 0;
return MOVE_CANCELLED;
}
it = 0;
if (otmp->obroken) verb = "fix";
@ -480,23 +480,23 @@ pick_lock(pick) /* pick a lock with a given object */
verb, it ? "it" : "its lock");
c = ynq(qbuf);
if(c == 'q') return(0);
if(c == 'q') return MOVE_CANCELLED;
if(c == 'n') continue;
if (otmp->obroken) {
You_cant("fix its broken lock with %s.", doname(pick));
return 0;
return MOVE_CANCELLED;
} else if(otmp->otyp == MAGIC_CHEST){
char locknumber = 0;
pline("What lock will you open (0-9)?");
locknumber = readchar();
if (locknumber < '0' || locknumber > '9') {
pline1(Never_mind);
return 0;
return MOVE_CANCELLED;
}
if(otmp->ovar1 == (long)(locknumber-'0') && !otmp->olocked){
pline("That lock is already open.");
return 0;
return MOVE_CANCELLED;
}
xlock.mgclcknm = (long)(locknumber-'0');
}
@ -504,7 +504,7 @@ pick_lock(pick) /* pick a lock with a given object */
else if (picktyp == CREDIT_CARD && !otmp->olocked && otmp->otyp != MAGIC_CHEST) {
/* credit cards are only good for unlocking */
You_cant("do that with %s.", doname(pick));
return 0;
return MOVE_CANCELLED;
}
#endif
switch(picktyp) {
@ -534,14 +534,14 @@ pick_lock(pick) /* pick a lock with a given object */
if (c != 'y') {
if (!count)
There("doesn't seem to be any sort of lock here.");
return(0); /* decided against all boxes */
return MOVE_CANCELLED; /* decided against all boxes */
}
} else { /* pick the lock in a door */
struct monst *mtmp;
if (u.utrap && u.utraptype == TT_PIT) {
You_cant("reach over the edge of the pit.");
return(0);
return MOVE_CANCELLED;
}
door = &levl[cc.x][cc.y];
@ -551,7 +551,7 @@ pick_lock(pick) /* pick a lock with a given object */
if (mtmp->entangled == SHACKLES){
unshackle_mon(mtmp);
return 1; /* that was quick -- we don't have full handling for this yet */
return MOVE_STANDARD; /* that was quick -- we don't have full handling for this yet */
}
#ifdef TOURIST
@ -561,7 +561,7 @@ pick_lock(pick) /* pick a lock with a given object */
else
#endif
pline("I don't think %s would appreciate that.", mon_nam(mtmp));
return(0);
return MOVE_CANCELLED;
}
if(!IS_DOOR(door->typ)) {
if (is_drawbridge_wall(cc.x,cc.y) >= 0)
@ -570,24 +570,24 @@ pick_lock(pick) /* pick a lock with a given object */
else
You("%s no door there.",
Blind ? "feel" : "see");
return(0);
return MOVE_CANCELLED;
}
switch (door->doormask) {
case D_NODOOR:
pline("This doorway has no door.");
return(0);
return MOVE_CANCELLED;
case D_ISOPEN:
You("cannot lock an open door.");
return(0);
return MOVE_CANCELLED;
case D_BROKEN:
pline("This door is broken.");
return(0);
return MOVE_CANCELLED;
default:
#ifdef TOURIST
/* credit cards are only good for unlocking */
if(picktyp == CREDIT_CARD && !(door->doormask & D_LOCKED)) {
You_cant("lock a door with a credit card.");
return(0);
return MOVE_CANCELLED;
}
#endif
/* ALI - Artifact doors from slash'em */
@ -597,7 +597,7 @@ pick_lock(pick) /* pick a lock with a given object */
(door->doormask & D_LOCKED) ? "Unl" : "L" );
c = yn(qbuf);
if(c == 'n') return(0);
if(c == 'n') return MOVE_CANCELLED;
switch(picktyp) {
#ifdef TOURIST
@ -631,17 +631,17 @@ pick_lock(pick) /* pick a lock with a given object */
gates_of_hell[key%4], 0L, BURN); //mod 4 the array index so people can mess up the des file without causing problems
unblock_point(cc.x,cc.y);
newsym(cc.x,cc.y);
return(0);
return MOVE_CANCELLED;
} else if(In_quest(&u.uz) && urole.neminum == PM_BOLG && xlock.key == ART_KEY_OF_EREBOR){
register struct rm *here;
here = &levl[cc.x][cc.y];
here->doormask = D_ISOPEN;
unblock_point(cc.x,cc.y);
newsym(cc.x,cc.y);
return(1);
return MOVE_STANDARD;
} else if (picktyp == SKELETON_KEY || picktyp == UNIVERSAL_KEY) {
Your("key doesn't seem to fit.");
return(0);
return MOVE_CANCELLED;
}
else ch = -1; /* -1 == 0% chance */
}
@ -652,7 +652,7 @@ pick_lock(pick) /* pick a lock with a given object */
xlock.picktyp = picktyp;
xlock.usedtime = 0;
set_occupation(picklock, lock_action(), 0);
return(1);
return MOVE_STANDARD;
}
int
@ -665,18 +665,18 @@ doforce() /* try to force a chest with your weapon */
if (!uwep && !(u.sealsActive&SEAL_OTIAX)) { /* Might want to make this so you use your shoulder */
You_cant("force anything without a weapon.");
return(0);
return MOVE_CANCELLED;
}
if (u.utrap && u.utraptype == TT_WEB) {
You("are entangled in a web!");
return(0);
return MOVE_CANCELLED;
} else if (u.sealsActive&SEAL_OTIAX) {
;
} else if (uwep && is_lightsaber(uwep)) {
if (!litsaber(uwep)) {
Your("lightsaber is deactivated!");
return(0);
return MOVE_CANCELLED;
}
} else if(uwep->otyp == LOCK_PICK ||
uwep->otyp == CREDIT_CARD ||
@ -692,7 +692,7 @@ doforce() /* try to force a chest with your weapon */
) {
You_cant("force anything without a %sweapon.",
(uwep) ? "proper " : "");
return(0);
return MOVE_CANCELLED;
}
if (u.sealsActive&SEAL_OTIAX)
@ -705,19 +705,19 @@ doforce() /* try to force a chest with your weapon */
if (xlock.box) {
You("resume your attempt to force the lock.");
set_occupation(forcelock, "forcing the lock", 0);
return(1);
return MOVE_STANDARD;
}
else if (xlock.door) {
You("resume your attempt to force the door.");
set_occupation(forcedoor, "forcing the door", 0);
return(1);
return MOVE_STANDARD;
}
}
/* A lock is made only for the honest man, the thief will break it. */
xlock.box = (struct obj *)0;
if(!getdir((char *)0)) return(0);
if(!getdir((char *)0)) return MOVE_CANCELLED;
x = u.ux + u.dx;
y = u.uy + u.dy;
@ -735,7 +735,7 @@ doforce() /* try to force a chest with your weapon */
"a box"));
c = ynq(qbuf);
if(c == 'q') return(0);
if(c == 'q') return MOVE_CANCELLED;
if(c == 'n') continue;
if(picktyp == 3) {
@ -760,7 +760,7 @@ doforce() /* try to force a chest with your weapon */
if(xlock.box) {
xlock.door = 0;
set_occupation(forcelock, "forcing the lock", 0);
return(1);
return MOVE_STANDARD;
}
} else { /* break down/open door */
struct monst *mtmp;
@ -774,7 +774,7 @@ doforce() /* try to force a chest with your weapon */
verbalize("What do you think you are, a Jedi?"); /* Phantom Menace */
else
pline("I don't think %s would appreciate that.", mon_nam(mtmp));
return(0);
return MOVE_CANCELLED;
}
/* Lightsabers dig through doors and walls via dig.c */
if (picktyp != 3 && (is_pick(uwep) ||
@ -788,27 +788,27 @@ doforce() /* try to force a chest with your weapon */
else
You("%s no door there.",
Blind ? "feel" : "see");
return(0);
return MOVE_CANCELLED;
}
/* ALI - artifact doors */
if (artifact_door(x, y)) {
pline("This door is too solid to force open.");
return 0;
return MOVE_CANCELLED;
}
switch (door->doormask) {
case D_NODOOR:
pline("This doorway has no door.");
return(0);
return MOVE_CANCELLED;
case D_ISOPEN:
You("cannot force an open door.");
return(0);
return MOVE_CANCELLED;
case D_BROKEN:
pline("This door is broken.");
return(0);
return MOVE_CANCELLED;
default:
if(picktyp == 3) c = yn("Force the door's lock?");
else c = yn("Break down the door?");
if(c == 'n') return(0);
if(c == 'n') return MOVE_CANCELLED;
if(picktyp == 3){
You("insert your mist tendrils into the door's lock.");
@ -828,11 +828,11 @@ doforce() /* try to force a chest with your weapon */
xlock.door = door;
xlock.box = 0;
set_occupation(forcedoor, "forcing the door", 0);
return(1);
return MOVE_STANDARD;
}
}
You("decide not to force the issue.");
return(0);
return MOVE_CANCELLED;
}
int

View file

@ -3564,7 +3564,7 @@ doset()
}
(void) doredraw();
}
return 0;
return MOVE_CANCELLED;
}
STATIC_OVL boolean
@ -4394,7 +4394,7 @@ dotogglepickup()
Strcpy(buf, "OFF");
}
pline("Autopickup: %s.", buf);
return 0;
return MOVE_CANCELLED;
}
#ifdef AUTOPICKUP_EXCEPTIONS

View file

@ -1103,7 +1103,7 @@ do_look(quick)
from_screen = TRUE; /* yes, we want to use the cursor */
} else {
i = ynq("Specify unknown object by cursor?");
if (i == 'q') return 0;
if (i == 'q') return MOVE_CANCELLED;
from_screen = (i == 'y');
}
@ -1114,7 +1114,7 @@ do_look(quick)
} else {
getlin("Specify what? (type the word)", out_str);
if (out_str[0] == '\0' || out_str[0] == '\033')
return 0;
return MOVE_CANCELLED;
if (out_str[1]) { /* user typed in a complete string */
winid datawin = create_nhwindow(NHW_MENU);
@ -1147,7 +1147,7 @@ do_look(quick)
if(checkfile(out_str, pm, (mntmp==NON_PM && otyp==STRANGE_OBJECT), TRUE, &datawin) || mntmp != NON_PM || otyp != STRANGE_OBJECT)
display_nhwindow(datawin, TRUE);
destroy_nhwindow(datawin);
return 0;
return MOVE_CANCELLED;
}
sym = out_str[0];
}
@ -1179,7 +1179,7 @@ do_look(quick)
ans = getpos(&cc, quick, what_is_an_unknown_object);
if (ans < 0 || cc.x < 0) {
flags.verbose = save_verbose;
return 0; /* done */
return MOVE_CANCELLED; /* done */
}
flags.verbose = FALSE; /* only print long question once */
@ -1458,7 +1458,7 @@ do_look(quick)
} while (from_screen && !quick && ans != LOOK_ONCE);
flags.verbose = save_verbose;
return 0;
return MOVE_CANCELLED;
}
@ -2307,7 +2307,7 @@ doidtrap()
register struct trap *trap;
int x, y, tt;
if (!getdir("^")) return 0;
if (!getdir("^")) return MOVE_CANCELLED;
x = u.ux + u.dx;
y = u.uy + u.dy;
for (trap = ftrap; trap; trap = trap->ntrap)
@ -2327,10 +2327,10 @@ doidtrap()
as much "set" as "dug" anyway */
(tt == HOLE || tt == PIT) ? " dug" : " set",
!trap->madeby_u ? "" : " by you");
return 0;
return MOVE_CANCELLED;
}
pline("I can't see a trap there.");
return 0;
return MOVE_CANCELLED;
}
char *
@ -2399,7 +2399,7 @@ dowhatdoes()
pline("%s", reslt);
else
pline("I've never heard of such commands.");
return 0;
return MOVE_CANCELLED;
}
/* data for help_menu() */
@ -2498,14 +2498,14 @@ dohelp()
#endif
}
}
return 0;
return MOVE_CANCELLED;
}
int
dohistory()
{
display_file(HISTORY, TRUE);
return 0;
return MOVE_CANCELLED;
}
/*pager.c*/

View file

@ -1629,7 +1629,7 @@ doloot() /* loot a container on the floor or loot saddle from mon. */
{
register struct obj *cobj, *nobj;
register int c = -1;
int timepassed = 0;
int timepassed = MOVE_CANCELLED;
coord cc;
boolean underfoot = TRUE;
const char *dont_find_anything = "don't find anything";
@ -1642,11 +1642,11 @@ doloot() /* loot a container on the floor or loot saddle from mon. */
if (check_capacity((char *)0)) {
/* "Can't do that while carrying so much stuff." */
return 0;
return MOVE_CANCELLED;
}
if (nolimbs(youracedata)) {
You("have no limbs!"); /* not `body_part(HAND)' */
return 0;
return MOVE_CANCELLED;
}
cc.x = u.ux; cc.y = u.uy;
@ -1654,7 +1654,7 @@ lootcont:
if (container_at(cc.x, cc.y, FALSE)) {
if (!able_to_loot(cc.x, cc.y, TRUE)) return 0;
if (!able_to_loot(cc.x, cc.y, TRUE)) return MOVE_CANCELLED;
for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = cobj->nexthere) {
if (Is_container(cobj) || cobj->otyp == MASS_SHADOW_PISTOL || is_gemable_lightsaber(cobj)) num_cont++;
@ -1668,7 +1668,7 @@ lootcont:
anything any;
menu_item *pick_list;
timepassed = 0;
timepassed = MOVE_CANCELLED;
any.a_void = 0;
win = create_nhwindow(NHW_MENU);
@ -1692,8 +1692,8 @@ lootcont:
for (i = 0; i < n; i++) {
timepassed |= do_loot_cont(pick_list[i].item.a_obj, TRUE);
if (multi < 0) {/* chest trap, stop looting */
free((genericptr_t) pick_list);
return 1;
free((genericptr_t) pick_list);
return MOVE_STANDARD;
}
}
}
@ -1726,27 +1726,27 @@ lootcont:
if(u.uvaul_duration) tmp = (tmp + 1) / 2;
losehp(tmp, "carnivorous bag", KILLED_BY_AN);
makeknown(BAG_OF_TRICKS);
timepassed = 1;
timepassed = MOVE_STANDARD;
continue;
}
You("carefully open %s...", the(xname(cobj)));
timepassed |= use_container(cobj, 0);
if (multi < 0) return 1; /* chest trap */
if (multi < 0) return MOVE_STANDARD; /* chest trap */
} else if(is_gemable_lightsaber(cobj)){
Sprintf(qbuf, "There is %s here, open it?",an(xname(cobj)));
c = ynq(qbuf);
if (c == 'q') return (timepassed);
if (c == 'n') continue;
timepassed |= use_lightsaber(cobj);
if(timepassed) underfoot = TRUE;
if(timepassed & MOVE_STANDARD) underfoot = TRUE;
} else if(cobj->otyp == MASS_SHADOW_PISTOL){
Sprintf(qbuf, "There is %s here, open it?",an(xname(cobj)));
c = ynq(qbuf);
if (c == 'q') return (timepassed);
if (c == 'n') continue;
timepassed |= use_massblaster(cobj);
if(timepassed) underfoot = TRUE;
if(timepassed & MOVE_STANDARD) underfoot = TRUE;
}
}
}
@ -1817,7 +1817,7 @@ gotit:
*/
if (c != 'y' && mon_beside(u.ux, u.uy)) {
if (!get_adjacent_loc("Loot in what direction?", "Invalid loot location",
u.ux, u.uy, &cc)) return 0;
u.ux, u.uy, &cc)) return MOVE_CANCELLED;
if (cc.x == u.ux && cc.y == u.uy) {
underfoot = TRUE;
if (container_at(cc.x, cc.y, FALSE))
@ -1834,7 +1834,7 @@ gotit:
if (mtmp) {
if (costly_spot(mtmp->mx, mtmp->my)) {
verbalize("Not in my store!");
timepassed = 1;
timepassed = MOVE_STANDARD;
}
else {
timepassed = loot_mon(mtmp, &prev_inquiry, &prev_loot);
@ -1891,7 +1891,7 @@ boolean *prev_loot;
long unwornmask;
if (nolimbs(youracedata)) {
You_cant("do that without limbs."); /* not body_part(HAND) */
return (0);
return MOVE_CANCELLED;
}
if (otmp->cursed && otmp->owornmask && !is_weldproof_mon(mtmp)) {
You("can't. It seems to be stuck to %s.",
@ -1899,7 +1899,7 @@ boolean *prev_loot;
SUPPRESS_SADDLE, FALSE));
/* the attempt costs you time */
return (1);
return MOVE_STANDARD;
}
if (otmp->otyp == STATUE && (otmp->corpsenm == PM_PARASITIC_MIND_FLAYER || otmp->corpsenm == PM_PARASITIC_MASTER_MIND_FLAYER)){
You("can't. It's stuck in %s face.",
@ -1907,7 +1907,7 @@ boolean *prev_loot;
SUPPRESS_SADDLE, FALSE)));
/* the attempt costs you time */
return (1);
return MOVE_STANDARD;
}
obj_extract_self(otmp);
if ((unwornmask = otmp->owornmask) != 0L) {
@ -1930,7 +1930,7 @@ boolean *prev_loot;
mtmp->mfrozen = timepassed;
if (prev_loot) *prev_loot = TRUE;
} else {
return (0);
return MOVE_CANCELLED;
}
}
#endif /* STEED */
@ -1939,7 +1939,7 @@ boolean *prev_loot;
int count = passed_info ? *passed_info : 0;
timepassed = pickup(count);
}
return timepassed;
return timepassed ? MOVE_STANDARD : MOVE_CANCELLED;
}
/* dopetequip() returns amount of time passed.
@ -1958,34 +1958,34 @@ dopetequip()
char nambuf[BUFSZ];
if (!get_adjacent_loc("Equip a pet in what direction?", "Invalid location",
u.ux, u.uy, &cc)) return 0;
u.ux, u.uy, &cc)) return MOVE_CANCELLED;
mtmp = m_at(cc.x, cc.y);
if(!mtmp || !canspotmon(mtmp)){
You_cant("find anyone to equip!");
return 0;
return MOVE_CANCELLED;
}
if(!mtmp->mtame
&& !(urole.ldrnum == PM_OLD_FORTUNE_TELLER && mtmp->mpeaceful && (quest_faction(mtmp) || mtmp->data->msound == MS_GUARDIAN))
){
pline("%s doesn't trust you enough for that!", Monnam(mtmp));
return 0;
return MOVE_CANCELLED;
}
#ifdef STEED
if(mtmp == u.usteed){
You_cant("change the equipment of something you're riding!");
return 0;
return MOVE_CANCELLED;
}
#endif /* STEED */
if (nolimbs(youracedata)) {
You_cant("do that without limbs."); /* not body_part(HAND) */
return (0);
return MOVE_CANCELLED;
}
if(!freehand()){
You("have no free %s to dress %s with!", body_part(HAND), mon_nam(mtmp));
return (0);
return MOVE_CANCELLED;
}
unseen = !canseemon(mtmp);
@ -2013,14 +2013,14 @@ dopetequip()
flag = W_TOOL;
} else {
pline("Error: Unknown monster armor type!?");
return 0;
return MOVE_CANCELLED;
}
if(mtmp->mtyp == PM_HARROWER_OF_ZARIEL
&& ((flag == W_ARM && arm_blocks_upper_body(otmp->otyp))
|| flag == W_ARMU
)){
You_cant("fit %s on over the thicket of spears stuck through %s chest.", the(xname(otmp)), mhis(mtmp));
return 0;
return MOVE_CANCELLED;
}
if(otmp->unpaid) addtobill(otmp, FALSE, FALSE, FALSE);
You("equip %s with %s.", mon_nam(mtmp), the(xname(otmp)));
@ -2041,9 +2041,9 @@ dopetequip()
mtmp->mcanmove = FALSE;
mtmp->mfrozen = timepassed;
} else {
return (0);
return MOVE_CANCELLED;
}
return timepassed;
return timepassed ? MOVE_STANDARD : MOVE_CANCELLED;
}
/*
@ -2968,8 +2968,8 @@ register struct obj *obj;
if(otmp->oartifact && !obj->oartifact)
obj->oartifact = otmp->oartifact;
}
return 1;
} else return 0;
return MOVE_STANDARD;
} else return MOVE_CANCELLED;
}
int
@ -2991,8 +2991,8 @@ register struct obj *obj;
out_container(obj->cobj);
if(!obj->cobj)
in_container(otmp);
return 1;
} else return 0;
return MOVE_STANDARD;
} else return MOVE_CANCELLED;
}
int
@ -3015,15 +3015,15 @@ register int held;
emptymsg[0] = '\0';
if (nohands(youracedata)) {
You("have no hands!"); /* not `body_part(HAND)' */
return 0;
return MOVE_CANCELLED;
} else if (!freehand()) {
You("have no free %s.", body_part(HAND));
return 0;
return MOVE_CANCELLED;
}
if (obj->olocked) {
pline("%s to be locked.", Tobjnam(obj, "seem"));
if (held) You("must put it down to unlock.");
return 0;
return MOVE_CANCELLED;
} else if (obj->otrapped && (obj->otyp != MAGIC_CHEST)) {
if (held) You("open %s...", the(xname(obj)));
(void) chest_trap(obj, HAND, FALSE);
@ -3032,7 +3032,7 @@ register int held;
nomul(-1, "opening a container");
nomovemsg = "";
}
return 1;
return MOVE_STANDARD;
}
current_container = obj; /* for use by in/out_container */
@ -3042,22 +3042,18 @@ register int held;
quantum_cat = TRUE; /* for adjusting "it's empty" message */
}else if(obj->spe == 4){
open_coffin(obj, FALSE); //FALSE: the box was not destroyed. Use present tense.
used = 1;
return used;
return MOVE_STANDARD;
}else if(obj->spe == 5){
open_sarcophagus(obj, FALSE); //FALSE: the box was not destroyed. Use present tense.
used = 1;
return used;
return MOVE_STANDARD;
}else if(obj->spe == 6 && u.uinsight >= 10){
open_crazy_box(obj, FALSE); //FALSE: the box was not destroyed. Use present tense.
used = 1;
return used;
return MOVE_STANDARD;
}else if(obj->spe == 7){
// Madman reclaims their stuff. Contents handled by the level loader.
//FALSE: the box was not destroyed. Use present tense.
if(open_madstuff_box(obj, FALSE)){
used = 1;
return used;
return MOVE_STANDARD;
}
}else if(obj->spe == 8){
// Nothing. Fulvous desk spawns monsters.
@ -3104,13 +3100,13 @@ register int held;
if (!outokay && !inokay) {
pline("%s", emptymsg);
You("don't have anything to put in.");
return used;
return used ? MOVE_STANDARD : MOVE_CANCELLED;
}
menuprompt[0] = '\0';
if (!cnt) Sprintf(menuprompt, "%s ", emptymsg);
Strcat(menuprompt, "Do what?");
t = in_or_out_menu(menuprompt, current_container, outokay, inokay);
if (t <= 0) return 0;
if (t <= 0) return MOVE_CANCELLED;
loot_out = (t & 0x01) != 0;
loot_in = (t & 0x02) != 0;
} else { /* MENU_COMBINATION or MENU_PARTIAL */
@ -3158,7 +3154,7 @@ ask_again2:
break;
case 'q':
default:
return used;
return used ? MOVE_STANDARD : MOVE_CANCELLED;
}
}
} else {
@ -3172,7 +3168,7 @@ ask_again2:
#endif
/* nothing to put in, but some feedback is necessary */
You("don't have anything to put in.");
return used;
return used ? MOVE_STANDARD : MOVE_CANCELLED;
}
if (flags.menu_style != MENU_FULL) {
Sprintf(qbuf, "Do you wish to put %s in?", something);
@ -3192,7 +3188,7 @@ ask_again2:
break;
case 'q':
default:
return used;
return used ? MOVE_STANDARD : MOVE_CANCELLED;
}
}
/*
@ -3246,7 +3242,7 @@ ask_again2:
dealloc_obj(u_gold);
}
#endif
return used;
return used ? MOVE_STANDARD : MOVE_CANCELLED;
}
/* Loot a container (take things out, put things in), using a menu. */
@ -3463,10 +3459,10 @@ dotip()
free((genericptr_t) pick_list);
if (otmp && otmp != &dummyobj) {
tipcontainer(otmp);
return 1;
return MOVE_STANDARD;
}
if (n == -1)
return 0;
return MOVE_CANCELLED;
/* else pick-from-invent below */
} else {
for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = nobj) {
@ -3476,12 +3472,12 @@ dotip()
Sprintf(qbuf, "You see here %s, tip it?", safe_qbuf(qbuf, sizeof("You see here , tip it?"), doname(cobj), xname(cobj), "container"));
c = ynq(qbuf);
if (c == 'q')
return 0;
return MOVE_CANCELLED;
if (c == 'n')
continue;
tipcontainer(cobj);
/* can only tip one container at a time */
return 1;
return MOVE_STANDARD;
}
}
}
@ -3495,7 +3491,7 @@ dotip()
/* normal case */
if (Is_container(cobj) || cobj->otyp == HORN_OF_PLENTY) {
tipcontainer(cobj);
return 1;
return MOVE_STANDARD;
}
/* assorted other cases */
if (Is_candle(cobj) && cobj->lamplit) {
@ -3529,7 +3525,7 @@ dotip()
consume_obj_charge(cobj, TRUE);
}
/* something [useless] happened */
return 1;
return MOVE_STANDARD;
}
/* anything not covered yet */
if (cobj->oclass == POTION_CLASS) /* can't pour potions... */
@ -3648,10 +3644,10 @@ tipmonster:
} else {
pline("That's a silly monster to tip.");
}
return 1;
return MOVE_STANDARD;
}
return 0;
return MOVE_CANCELLED;
}
static void
@ -3813,9 +3809,9 @@ tiphat()
int x, y, range, glyph, vismon, unseen, statue, res;
if (!uarmh) /* can't get here from there */
return 0;
return MOVE_CANCELLED;
res = uarmh->bknown ? 0 : 1;
res = uarmh->bknown ? MOVE_INSTANT : MOVE_STANDARD;
if (cursed(uarmh)) /* "You can't. It is cursed." */
return res; /* if learned of curse, use a move */
@ -3823,7 +3819,7 @@ tiphat()
if (!getdir("At whom? (in what direction)")) /* bail on ESC */
return res; /* iffy; now know it's not cursed for sure (since we got
* past prior test) but might have already known that */
res = 1; /* physical action is going to take place */
res = MOVE_STANDARD; /* physical action is going to take place */
/* most helmets have a short wear/take-off delay and we could set
'multi' to account for that, but we'll pretend that no extra time

View file

@ -843,7 +843,7 @@ struct permonst *mdat;
struct attack mattk;
int powermult = 100;
if (!getdir((char *)0)) return(0);
if (!getdir((char *)0)) return MOVE_CANCELLED;
{
struct attack * aptr;
@ -853,7 +853,7 @@ struct permonst *mdat;
if (!aptr) {
impossible("bad breath attack?");
return 0;
return MOVE_CANCELLED;
}
mattk = *aptr;
}
@ -899,7 +899,7 @@ domakewhisperer()
int duration;
if (u.uen < (10+min(u.uinsight, 45))) {
You("concentrate but lack the energy to maintain doing so.");
return(0);
return MOVE_CANCELLED;
}
duration = ACURR(A_CHA) + 1;
@ -914,14 +914,14 @@ domakewhisperer()
// makedog();
mtmp = makemon(&mons[PM_SECRET_WHISPERER], u.ux, u.uy, MM_ADJACENTOK|NO_MINVENT|MM_NOCOUNTBIRTH|MM_EDOG|MM_ESUM);
if(!mtmp) return 0; /* pets were genocided */
if(!mtmp) return MOVE_CANCELLED; /* pets were genocided */
mark_mon_as_summoned(mtmp, &youmonst, duration, 0);
for(int i = min(45, (u.uinsight - mtmp->m_lev)); i > 0; i--){
grow_up(mtmp, (struct monst *) 0);
//Technically might grow into a genocided form.
if(DEADMONSTER(mtmp))
return 0;
return MOVE_CANCELLED;
}
mtmp->mspec_used = 0;
@ -934,7 +934,7 @@ domakewhisperer()
initedog(mtmp);
EDOG(mtmp)->loyal = TRUE;
return 1;
return MOVE_STANDARD;
}
int
@ -945,11 +945,11 @@ doelementalbreath()
if (Strangled) {
You_cant("breathe. Sorry.");
return(0);
return MOVE_CANCELLED;
}
if (u.uen < 45) {
You("don't have enough energy to sing an elemental!");
return(0);
return MOVE_CANCELLED;
}
losepw(45);
flags.botl = 1;
@ -985,7 +985,7 @@ doelementalbreath()
mon->mhpmax = (mon->m_lev * 8) - 4;
mon->mhp = mon->mhpmax;
}
return(1);
return MOVE_STANDARD;
}
int
@ -1020,13 +1020,13 @@ dospinweb()
if (Levitation || Weightless
|| Underwater || Is_waterlevel(&u.uz)) {
You("must be on the ground to spin a web.");
return(0);
return MOVE_CANCELLED;
}
if (u.uswallow) {
You("release web fluid inside %s.", mon_nam(u.ustuck));
if (is_animal(u.ustuck->data)) {
expels(u.ustuck, u.ustuck->data, TRUE);
return(0);
return MOVE_INSTANT;
}
if (is_whirly(u.ustuck->data)) {
int i;
@ -1054,14 +1054,14 @@ dospinweb()
}
pline_The("web %sis swept away!", sweep);
}
return(0);
return MOVE_INSTANT;
} /* default: a nasty jelly-like creature */
pline_The("web dissolves into %s.", mon_nam(u.ustuck));
return(0);
return MOVE_INSTANT;
}
if (u.utrap) {
You("cannot spin webs while stuck in a trap.");
return(0);
return MOVE_CANCELLED;
}
exercise(A_DEX, TRUE);
if (ttmp) switch (ttmp->ttyp) {
@ -1070,35 +1070,35 @@ dospinweb()
deltrap(ttmp);
bury_objs(u.ux, u.uy);
newsym(u.ux, u.uy);
return(1);
return MOVE_STANDARD;
case SQKY_BOARD: pline_The("squeaky board is muffled.");
deltrap(ttmp);
newsym(u.ux, u.uy);
return(1);
return MOVE_STANDARD;
case TELEP_TRAP:
case LEVEL_TELEP:
case MAGIC_PORTAL:
Your("webbing vanishes!");
return(0);
return MOVE_INSTANT;
case WEB: You("make the web thicker.");
return(1);
return MOVE_STANDARD;
case HOLE:
case TRAPDOOR:
You("web over the %s.",
(ttmp->ttyp == TRAPDOOR) ? "trap door" : "hole");
deltrap(ttmp);
newsym(u.ux, u.uy);
return 1;
return MOVE_STANDARD;
case ROLLING_BOULDER_TRAP:
You("spin a web, jamming the trigger.");
deltrap(ttmp);
newsym(u.ux, u.uy);
return(1);
return MOVE_STANDARD;
case VIVI_TRAP:
You("spin a web, ruining the delicate machinery.");
deltrap(ttmp);
newsym(u.ux, u.uy);
return(1);
return MOVE_STANDARD;
case ARROW_TRAP:
case DART_TRAP:
case BEAR_TRAP:
@ -1111,18 +1111,19 @@ dospinweb()
case MAGIC_TRAP:
case ANTI_MAGIC:
case POLY_TRAP:
case MUMMY_TRAP:
You("have triggered a trap!");
dotrap(ttmp, 0);
return(1);
return MOVE_STANDARD;
default:
impossible("Webbing over trap type %d?", ttmp->ttyp);
return(0);
return MOVE_CANCELLED;
}
else if (On_stairs(u.ux, u.uy)) {
/* cop out: don't let them hide the stairs */
Your("web fails to impede access to the %s.",
(levl[u.ux][u.uy].typ == STAIRS) ? "stairs" : "ladder");
return(1);
return MOVE_STANDARD;
}
ttmp = maketrap(u.ux, u.uy, WEB);
@ -1131,7 +1132,7 @@ dospinweb()
ttmp->madeby_u = 1;
}
newsym(u.ux, u.uy);
return(1);
return MOVE_STANDARD;
}
int
@ -1140,7 +1141,7 @@ dosummon()
int placeholder;
if (u.uen < 10) {
You("lack the energy to send forth a call for help!");
return(0);
return MOVE_CANCELLED;
}
losepw(10);
flags.botl = 1;
@ -1149,7 +1150,7 @@ dosummon()
exercise(A_WIS, TRUE);
if (!were_summon(&youmonst, &placeholder, (char *)0))
pline("But none arrive.");
return(1);
return MOVE_STANDARD;
}
int
@ -1161,11 +1162,11 @@ dodemonpet()
if (u.uen < 10) {
You("lack the energy to call for help!");
return(0);
return MOVE_CANCELLED;
}
else if (youmonst.summonpwr >= youmonst.data->mlevel) {
You("don't have the authority to call for any more help!");
return(0);
return MOVE_CANCELLED;
}
losepw(10);
flags.botl = 1;
@ -1188,7 +1189,7 @@ dodemonpet()
else {
pline("No help arrived.");
}
return(1);
return MOVE_STANDARD;
}
static NEARDATA const char food_types[] = { FOOD_CLASS, 0 };
@ -1220,15 +1221,15 @@ dovampminion()
}
}
if (!corpse) corpse = getobj(food_types, "feed blood to");
if (!corpse) return(0);
if (!corpse) return MOVE_CANCELLED;
struct permonst *pm = &mons[corpse->corpsenm];
if (!has_blood(pm)){
pline("You can't put blood in a monster that didn't start with blood!");
return(0);
return MOVE_CANCELLED;
} else if (is_untamable(pm) || (pm->geno & G_UNIQ)){
pline("You can't create a minion of that type of monster!");
return(0);
return MOVE_CANCELLED;
} else {
struct monst * mtmp = revive(corpse, FALSE);
if (mtmp) {
@ -1241,7 +1242,7 @@ dovampminion()
}
}
return(1);
return MOVE_STANDARD;
}
int
@ -1249,7 +1250,7 @@ dotinker()
{
if (u.uen < 10) {
You("lack the energy to tinker.");
return(0);
return MOVE_CANCELLED;
}
losepw(10);
flags.botl = 1;
@ -1272,7 +1273,7 @@ dotinker()
mlocal->mpeaceful = 1;
newsym(mlocal->mx,mlocal->my);
}
return(1);
return MOVE_STANDARD;
}
int
@ -1284,15 +1285,15 @@ dogaze()
if (Blind) {
You_cant("see anything to gaze at.");
return 0;
return MOVE_CANCELLED;
}
if (u.uen < 15) {
You("lack the energy to use your special gaze!");
return(0);
return MOVE_CANCELLED;
}
if (!throwgaze()) {
/* player cancelled targetting or picked a not-allowed location */
return 0;
return MOVE_CANCELLED;
}
else {
losepw(15);
@ -1320,7 +1321,7 @@ dogaze()
-d((int)mtmp->m_lev + 1,
(int)mtmp->data->mattk[0].damd)
: -200, "frozen by a monster's gaze");
return 1;
return MOVE_STANDARD;
}
else
You("stiffen momentarily under %s gaze.",
@ -1347,7 +1348,7 @@ dogaze()
You("gaze at empty space.");
}
}
return(1);
return MOVE_STANDARD;
}
#if 0
{
@ -1589,7 +1590,7 @@ dohide()
if (u.uundetected || (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) {
You("are already hiding.");
return(0);
return MOVE_CANCELLED;
}
if (ismimic) {
/* should bring up a dialog "what would you like to imitate?" */
@ -1598,7 +1599,7 @@ dohide()
} else
u.uundetected = 1;
newsym(u.ux,u.uy);
return(1);
return MOVE_STANDARD;
}
int
@ -1609,7 +1610,7 @@ domindblast()
if (u.uen < 10) {
You("concentrate but lack the energy to maintain doing so.");
return(0);
return MOVE_CANCELLED;
}
losepw(10);
flags.botl = 1;
@ -1655,7 +1656,7 @@ domindblast()
}
}
}
return 1;
return MOVE_STANDARD;
}
void
@ -1696,14 +1697,14 @@ dodarken()
if (u.uen < 10 && u.uen<u.uenmax) {
You("lack the energy to invoke the darkness.");
return(0);
return MOVE_CANCELLED;
}
u.uen = max(u.uen-10,0);
flags.botl = 1;
You("invoke the darkness.");
litroom(FALSE,NULL);
return 1;
return MOVE_STANDARD;
}
int
@ -1743,13 +1744,13 @@ doclockspeed()
break;
}
}
if(u.clockworkUpgrades&FAST_SWITCH) return 0;
else return 1;
if(u.clockworkUpgrades&FAST_SWITCH) return MOVE_INSTANT;
else return MOVE_STANDARD;
} else{
You("leave your clock at its current speed.");
return 0;
return MOVE_CANCELLED;
}
return 0;
return MOVE_CANCELLED;
}
int
@ -1764,15 +1765,15 @@ doandroid()
u.phasengn = 1;
You("activate your phase engine.");
}
return 0;
return MOVE_INSTANT;
} else if(newspeed == HIGH_CLOCKSPEED){
You("activate emergency high speed.");
u.ucspeed = HIGH_CLOCKSPEED;
return 0;
return MOVE_INSTANT;
} else if(newspeed == NORM_CLOCKSPEED){
You("reduce speed to normal.");
u.ucspeed = NORM_CLOCKSPEED;
return 1;
return MOVE_STANDARD;
} else if(newspeed == SLOW_CLOCKSPEED){
int mult = HEALCYCLE/u.ulevel;
int duration = (u.uenmax - u.uen)*mult*2/3+30, i, lim;
@ -1789,23 +1790,23 @@ doandroid()
u.nextsleep = moves+rnz(350)+duration;
u.lastslept = moves;
fall_asleep(-rn1(duration+1, duration+1), TRUE);
return 1;
return MOVE_STANDARD;
} else if(newspeed == RECHARGER){
static const char recharge_type[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
struct obj *otmp = getobj(recharge_type, "charge");
if (!otmp) {
return 0;
return MOVE_CANCELLED;
}
if(!recharge(otmp, 0))
You("recharged %s.", the(xname(otmp)));
losepw(10);
update_inventory();
return 1;
return MOVE_STANDARD;
} else if (newspeed == ANDROID_COMBO) {
return android_combo(); /* in xhity.c */
}
return 0;
return MOVE_CANCELLED;
}
int
@ -1895,7 +1896,7 @@ int splaction;
break;
} while (TRUE);
return 0;
return MOVE_CANCELLED;
}
STATIC_OVL void

View file

@ -2603,7 +2603,7 @@ dodip()
allowall[0] = ALL_CLASSES; allowall[1] = '\0';
if(!(obj = getobj(allowall, "dip")))
return(0);
return MOVE_CANCELLED;
here = levl[u.ux][u.uy].typ;
/* Is there a fountain to dip into here? */
@ -2615,7 +2615,7 @@ dodip()
if(yn("Dip it into the fountain?") == 'y') {
#endif
dipfountain(obj);
return(1);
return MOVE_STANDARD;
}
} else if (is_pool(u.ux,u.uy, TRUE)) {
tmp = waterbody_name(u.ux,u.uy);
@ -2636,7 +2636,7 @@ dodip()
(void) get_wet(obj, level.flags.lethe); //lethe
// if (obj->otyp == POT_ACID) useup(obj); //Potential error here
}
return 1;
return MOVE_STANDARD;
}
}
@ -2646,10 +2646,10 @@ dodip()
#else
if(!(potion = getobj(beverages, "dip into")))
#endif
return(0);
return MOVE_CANCELLED;
if (potion == obj && potion->quan == 1L) {
pline("That is a potion bottle, not a Klein bottle!");
return 0;
return MOVE_CANCELLED;
}
//from Slashem, modified
if(!(potion->otyp == POT_WATER || potion->otyp == POT_ACID || polypotion(potion)) && obj->otyp == POT_WATER) {
@ -2679,7 +2679,7 @@ dodip()
!(objects[potion->otyp].oc_uname))
docall(potion);
useup(potion);
return(1);
return MOVE_STANDARD;
} else if(!obj->blessed) {
if (useeit) {
tmp = hcolor(NH_LIGHT_BLUE);
@ -2777,14 +2777,14 @@ dodip()
makeknown(POT_POLYMORPH);
useup(potion);
prinv((char *)0, obj, 0L);
return 1;
return MOVE_STANDARD;
} else {
pline("Nothing seems to happen.");
goto poof;
}
}
potion->in_use = FALSE; /* didn't go poof */
return(1);
return MOVE_STANDARD;
} else if(obj->oclass == POTION_CLASS && (obj->otyp != potion->otyp || (obj->otyp == POT_BLOOD && obj->corpsenm != potion->corpsenm))) {
/* Mixing potions is dangerous... */
pline_The("potions mix...");
@ -2806,7 +2806,7 @@ dodip()
/* some protection against this: */
losehp(Acid_resistance ? rnd(5) : rnd(10),
"alchemic blast", KILLED_BY_AN);
return(1);
return MOVE_STANDARD;
}
obj->blessed = obj->cursed = obj->bknown = 0;
@ -2846,7 +2846,7 @@ dodip()
pline_The("mixture glows brightly and evaporates.");
useup(obj);
useup(potion);
return(1);
return MOVE_STANDARD;
}
}
@ -2861,7 +2861,7 @@ dodip()
}
set_object_color(obj);
useup(potion);
return(1);
return MOVE_STANDARD;
}
#ifdef INVISIBLE_OBJECTS
@ -3194,7 +3194,7 @@ dodip()
exercise(A_WIS, wisx);
makeknown(potion->otyp);
useup(potion);
return 1;
return MOVE_STANDARD;
}
more_dips:
@ -3208,7 +3208,7 @@ dodip()
useup(potion);
explode(u.ux, u.uy, AD_FIRE, 0, d(6,6), EXPL_FIERY, 1);
exercise(A_WIS, FALSE);
return 1;
return MOVE_STANDARD;
} else if((obj->otyp == SUNROD)
&& (potion->otyp == POT_ACID)
) {
@ -3236,7 +3236,7 @@ dodip()
if (!Blind) Your1(vision_clears);
}
exercise(A_WIS, FALSE);
return 1;
return MOVE_STANDARD;
/* Allow filling of MAGIC_LAMPs to prevent identification by player */
} else if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP) &&
(potion->otyp == POT_OIL)) {
@ -3245,7 +3245,7 @@ dodip()
useup(potion);
explode(u.ux, u.uy, AD_FIRE, 0, d(6,6), EXPL_FIERY, 1);
exercise(A_WIS, FALSE);
return 1;
return MOVE_STANDARD;
}
/* Adding oil to an empty magic lamp renders it into an oil lamp */
if ((obj->otyp == MAGIC_LAMP) && obj->spe == 0) {
@ -3266,7 +3266,7 @@ dodip()
makeknown(POT_OIL);
obj->spe = 1;
update_inventory();
return 1;
return MOVE_STANDARD;
}
potion->in_use = FALSE; /* didn't go poof */
@ -3316,7 +3316,7 @@ dodip()
/* some protection against this: */
losehp(Acid_resistance ? rnd(5) : rnd(10),
"alchemic blast", KILLED_BY_AN);
return(1);
return MOVE_STANDARD;
}
pline("%s dissolves in %s.", The(xname(singlegem)),
@ -3372,11 +3372,11 @@ dodip()
doname(singlepotion), (const char *)0);
update_inventory();
}
return(1);
return MOVE_STANDARD;
}
pline("Interesting...");
return(1);
return MOVE_STANDARD;
}

View file

@ -1134,7 +1134,7 @@ pray_goat()
if (flags.prayconfirm)
if (yn("Are you sure you want to pray to the Black Goat?") == 'n')
return 0;
return MOVE_CANCELLED;
u.uconduct.gnostic++; //?
@ -1198,7 +1198,7 @@ pray_goat()
}
else goat_pleased();
return 1;
return MOVE_STANDARD;
}
@ -1838,8 +1838,8 @@ dosacrifice()
aligntyp altaralign = (a_align(u.ux,u.uy));
int altargod = god_at_altar(u.ux, u.uy);
if (!on_altar() || u.uswallow) {
You("are not standing on an altar.");
return 0;
You("are not standing on an altar.");
return MOVE_CANCELLED;
}
if(Role_if(PM_ANACHRONONAUT) && flags.questprogress != 2 && u.uevent.qcompleted && u.uhave.questart && Is_astralevel(&u.uz)){
@ -1847,9 +1847,9 @@ dosacrifice()
}
if (In_endgame(&u.uz)) {
if (!(otmp = getobj(sacrifice_types, "sacrifice"))) return 0;
} else {
if (!(otmp = floorfood("sacrifice", 1))) return 0;
if (!(otmp = getobj(sacrifice_types, "sacrifice"))) return MOVE_CANCELLED;
} else {
if (!(otmp = floorfood("sacrifice", 1))) return MOVE_CANCELLED;
}
/*
Was based on nutritional value and aging behavior (< 50 moves).
@ -1863,16 +1863,16 @@ dosacrifice()
if(goat_mouth_at(u.ux, u.uy)){
goat_eat(otmp, GOAT_EAT_OFFERED);
return 1;
return MOVE_STANDARD;
}
if(bokrug_idol_at(u.ux, u.uy)){
bokrug_offer(otmp);
return 1;
return MOVE_STANDARD;
}
if(Role_if(PM_ANACHRONONAUT) && otmp->otyp != AMULET_OF_YENDOR && flags.questprogress!=2){
You("do not give offerings to the God of the future.");
return 0;
return MOVE_CANCELLED;
}
if(u.ualign.god == GOD_BOKRUG__THE_WATER_LIZARD
@ -1882,14 +1882,14 @@ dosacrifice()
if (otmp->otyp == CORPSE)
feel_cockatrice(otmp, TRUE);
pline1(nothing_happens);
return 1;
return MOVE_STANDARD;
}
if(Misotheism && !(otmp->otyp == AMULET_OF_YENDOR && Is_astralevel(&u.uz))){
if (otmp->otyp == CORPSE)
feel_cockatrice(otmp, TRUE);
pline1(nothing_happens);
return 1;
return MOVE_STANDARD;
}
#define MAXVALUE 24 /* Highest corpse value (besides Wiz) */
@ -1923,7 +1923,7 @@ dosacrifice()
char buf[BUFSZ];
Sprintf(buf, "You feel a deep sense of kinship to %s! Sacrifice %s anyway?",
the(xname(otmp)), (otmp->quan == 1L) ? "it" : "one");
if (yn_function(buf,ynchars,'n')=='n') return 0;
if (yn_function(buf,ynchars,'n')=='n') return MOVE_CANCELLED;
}
pline("You'll regret this infamous offense!");
exercise(A_WIS, FALSE);
@ -2003,7 +2003,7 @@ dosacrifice()
if (carried(otmp)) useup(otmp);
else useupf(otmp, 1L);
return(1);
return MOVE_STANDARD;
} else if (get_ox(otmp, OX_EMON)
&& ((mtmp = get_mtraits(otmp, FALSE)) != (struct monst *)0)
&& mtmp->mtame) {
@ -2050,7 +2050,7 @@ dosacrifice()
You_feel("homesick.");
else
You_feel("an urge to return to the surface.");
return 1;
return MOVE_STANDARD;
} else {
/* The final Test. Did you win? */
if(uamul == otmp) Amulet_off();
@ -2130,7 +2130,7 @@ dosacrifice()
Hallucination ? "boo-boo" : "mistake");
otmp->known = TRUE;
change_luck(-1);
return 1;
return MOVE_STANDARD;
} else {
/* don't you dare try to fool the gods */
if(u.ualign.type != A_VOID){
@ -2147,7 +2147,7 @@ dosacrifice()
if (value == 0) {
pline1(nothing_happens);
return (1);
return MOVE_STANDARD;
}
if (altaralign != u.ualign.type &&
@ -2180,7 +2180,7 @@ dosacrifice()
if(otmp->otyp == CORPSE && is_rider(&mons[otmp->corpsenm])){
pline("A pulse of darkness radiates from your sacrifice!");
angrygods(altargod);
return 1;
return MOVE_STANDARD;
}
consume_offering(otmp);
pline("%s accepts your allegiance.", a_gname());
@ -2282,12 +2282,12 @@ dosacrifice()
if (!Inhell) angrygods(u.ualign.god);
}
}
return(1);
return MOVE_STANDARD;
} else {
if(otmp->otyp == CORPSE && is_rider(&mons[otmp->corpsenm])){
pline("A pulse of darkness radiates from your sacrifice!");
angrygods(altargod);
return 1;
return MOVE_STANDARD;
}
consume_offering(otmp);
if(Role_if(PM_EXILE) && u.ualign.type != A_VOID && altaralign != A_VOID){
@ -2358,14 +2358,14 @@ dosacrifice()
}
}
}
return(1);
return MOVE_STANDARD;
}
}
if(otmp->otyp == CORPSE && is_rider(&mons[otmp->corpsenm])){
pline("A pulse of darkness radiates from your sacrifice!");
angrygods(altargod);
return 1;
return MOVE_STANDARD;
}
consume_offering(otmp);
/* OK, you get brownie points. */
@ -2472,13 +2472,13 @@ dosacrifice()
if(is_shield(otmp)){
unrestrict_weapon_skill(P_SHIELD);
}
return(1);
return MOVE_STANDARD;
}
} else if (rnl((30 + u.ulevel)*10) < 10) {
/* no artifact, but maybe a helpful pet? */
/* WAC is now some generic benefit (includes pets) */
god_gives_benefit(altaralign);
return(1);
return MOVE_STANDARD;
}
change_luck((value * LUCKMAX) / (MAXVALUE * 2));
if ((int)u.uluck < 0) u.uluck = 0;
@ -2493,7 +2493,7 @@ dosacrifice()
u.reconciled = REC_REC;
}
}
return(1);
return MOVE_STANDARD;
}
@ -2561,23 +2561,23 @@ dopray()
if(Role_if(PM_ANACHRONONAUT) && flags.questprogress!=2){
pline("There is but one God in the future.");
pline("And to It, you do not pray.");
return 0;
return MOVE_CANCELLED;
}
if(flat_mad_turn(MAD_APOSTASY)){
pline("You can't bring yourself to pray.");
return 0;
return MOVE_CANCELLED;
}
if(Doubt){
pline("You're suffering a crisis of faith.");
return 0;
return MOVE_CANCELLED;
}
/* Confirm accidental slips of Alt-P */
if (flags.prayconfirm)
if (yn("Are you sure you want to pray?") == 'n')
return 0;
return MOVE_CANCELLED;
if(u.sealsActive&SEAL_AMON) unbind(SEAL_AMON,TRUE);
u.uconduct.gnostic++;
@ -2588,7 +2588,7 @@ dopray()
flags.soundok = 1;
/* set up p_type and p_alignment */
if (!can_pray(TRUE)) return 0;
if (!can_pray(TRUE)) return MOVE_CANCELLED;
u.lastprayed = moves;
u.lastprayresult = PRAY_INPROG;
@ -2617,7 +2617,7 @@ dopray()
u.uinvulnerable = TRUE;
}
return(1);
return MOVE_STANDARD;
}
STATIC_PTR int
@ -2630,7 +2630,7 @@ prayer_done() /* M. Stephenson (1.0.3b) */
if(u.ualign.god == GOD_BOKRUG__THE_WATER_LIZARD){
u.lastprayresult = PRAY_IGNORED;
Your("prayer goes unanswered.");
return 1; //I think this is meaningless?
return MOVE_STANDARD; //I think this is meaningless?
}
if(p_type == -1) {
godvoice(p_god,
@ -2660,14 +2660,14 @@ prayer_done() /* M. Stephenson (1.0.3b) */
change_luck(-3);
gods_upset(p_god);
}
return(1);
return MOVE_STANDARD;
}
if (Inhell && !hell_safe_prayer(p_god)){
pline("Since you are in Gehennom, %s won't help you.", godname(p_god));
/* haltingly aligned is least likely to anger */
if (u.ualign.record <= 0 || rnl(u.ualign.record))
angrygods(u.ualign.god);
return(0);
return MOVE_CANCELLED;
}
if (p_type == 0) {
@ -2695,7 +2695,7 @@ prayer_done() /* M. Stephenson (1.0.3b) */
(void) water_prayer(TRUE);
pleased(p_god); /* nice */
}
return(1);
return MOVE_STANDARD;
}
int
@ -2719,11 +2719,11 @@ doturn()
}
You("don't know how to turn undead!");
return(0);
return MOVE_CANCELLED;
}
if(Misotheism){
pline("Nothing happens!");
return 0;
return MOVE_CANCELLED;
}
if(!Race_if(PM_VAMPIRE)) u.uconduct.gnostic++;
@ -2739,13 +2739,13 @@ doturn()
pline("For some reason, %s seems to ignore you.", u_gname());
aggravate();
exercise(A_WIS, FALSE);
return(0);
return MOVE_INSTANT;
}
if (Inhell && !hell_safe_prayer(u.ualign.god) && !Race_if(PM_VAMPIRE)) {
pline("Since you are in Gehennom, %s won't help you.", u_gname());
aggravate();
return(0);
return MOVE_INSTANT;
}
if(!Race_if(PM_VAMPIRE)) pline("Calling upon %s, you chant holy scripture.", u_gname());
else You("focus your vampiric aura!");
@ -2813,7 +2813,7 @@ doturn()
}
else
nomul(-5, "trying to turn the undead");
return(1);
return MOVE_STANDARD;
}
const char *

View file

@ -742,16 +742,16 @@ struct obj *scroll;
if(!scroll->dknown){
You("have never seen it!");
return 0;
return MOVE_CANCELLED;
}
if(objects[scroll->otyp].oc_unique){
u.uconduct.literate++;
study_word(scroll);
return 1;
return MOVE_READ;
}
if(!objects[scroll->otyp].oc_name_known && objects[scroll->otyp].oc_magic){
You("don't know how to pronounce the glyph!");
return 0;
return MOVE_CANCELLED;
}
if(scroll->otyp == SYLLABLE_OF_STRENGTH__AESH){
if(scroll->cursed){
@ -844,12 +844,12 @@ struct obj *scroll;
if (!maybe_give_thought(thought))
{
pline("Nothing happens.");
return 0;
return MOVE_INSTANT;
}
} else {
impossible("bad shard");
return 0;
return MOVE_CANCELLED;
}
u.uconduct.literate++;
@ -858,11 +858,11 @@ struct obj *scroll;
if(objects[scroll->otyp].oc_magic){
useup(scroll);
check_illumian_trophy();
return partial_action();
return MOVE_READ|MOVE_PARTIAL;
}
else {
useup(scroll);
return 1;
return MOVE_READ;
}
}
@ -881,7 +881,7 @@ struct obj *slab;
}
curslab = slab;
set_occupation(learn_word, "studying", 0);
return 1;
return MOVE_READ;
}
STATIC_PTR int

View file

@ -62,7 +62,7 @@ int
dosave()
{
if (iflags.debug_fuzzer)
return 0;
return MOVE_CANCELLED;
clear_nhwindow(WIN_MESSAGE);
if(yn("Really save?") == 'n') {
clear_nhwindow(WIN_MESSAGE);
@ -82,7 +82,7 @@ dosave()
terminate(EXIT_SUCCESS);
} else (void)doredraw();
}
return 0;
return MOVE_CANCELLED;
}

View file

@ -1367,12 +1367,12 @@ dopay()
if ((!sk && (!Blind || Blind_telepat)) || (!Blind && !seensk)) {
There("appears to be no shopkeeper here to receive your payment.");
return(0);
return MOVE_CANCELLED;
}
if(!seensk) {
You_cant("see...");
return(0);
return MOVE_CANCELLED;
}
/* the usual case. allow paying at a distance when */
@ -1389,7 +1389,7 @@ dopay()
if (shkp != resident && distu(shkp->mx, shkp->my) > 2) {
pline("%s is not near enough to receive your payment.",
Monnam(shkp));
return(0);
return MOVE_CANCELLED;
}
} else {
struct monst *mtmp;
@ -1400,31 +1400,31 @@ dopay()
cc.x = u.ux;
cc.y = u.uy;
if (getpos(&cc, TRUE, "the creature you want to pay") < 0)
return 0; /* player pressed ESC */
return MOVE_CANCELLED; /* player pressed ESC */
cx = cc.x;
cy = cc.y;
if(cx < 0) {
pline("Try again...");
return(0);
return MOVE_CANCELLED;
}
if(u.ux == cx && u.uy == cy) {
You("are generous to yourself.");
return(0);
return MOVE_CANCELLED;
}
mtmp = m_at(cx, cy);
if(!mtmp) {
There("is no one there to receive your payment.");
return(0);
return MOVE_CANCELLED;
}
if(!mtmp->isshk) {
pline("%s is not interested in your payment.",
Monnam(mtmp));
return(0);
return MOVE_CANCELLED;
}
if (mtmp != resident && distu(mtmp->mx, mtmp->my) > 2) {
pline("%s is too far to receive your payment.",
Monnam(mtmp));
return(0);
return MOVE_CANCELLED;
}
shkp = mtmp;
}
@ -1433,13 +1433,13 @@ dopay()
#ifdef DEBUG
pline("dopay: null shkp.");
#endif
return(0);
return MOVE_CANCELLED;
}
proceed:
eshkp = ESHK(shkp);
ltmp = eshkp->robbed;
if(!shkp->mnotlaugh) return 0;
if(!shkp->mnotlaugh) return MOVE_CANCELLED;
/* wake sleeping shk when someone who owes money offers payment */
if (ltmp || eshkp->billct || eshkp->debit)
@ -1448,7 +1448,7 @@ proceed:
if (!shkp->mcanmove || shkp->msleeping) { /* still asleep/paralyzed */
pline("%s %s.", Monnam(shkp),
rn2(2) ? "seems to be napping" : "doesn't respond");
return 0;
return MOVE_INSTANT;
}
if(shkp != resident && NOTANGRY(shkp)) {
@ -1498,7 +1498,7 @@ proceed:
else
make_happy_shk(shkp, FALSE);
}
return(1);
return MOVE_STANDARD;
}
/* ltmp is still eshkp->robbed here */
@ -1533,7 +1533,7 @@ proceed:
#endif
pline(no_money, stashed_gold ? " seem to" : "");
else pline(not_enough_money, mhim(shkp));
return(1);
return MOVE_STANDARD;
}
pline("But since %s shop has been robbed recently,",
mhis(shkp));
@ -1565,7 +1565,7 @@ proceed:
#endif
pline(no_money, stashed_gold ? " seem to" : "");
else pline(not_enough_money, mhim(shkp));
return(1);
return MOVE_STANDARD;
}
You("try to appease %s by giving %s 1000 gold pieces.",
x_monnam(shkp, ARTICLE_THE, "angry", 0, FALSE),
@ -1576,12 +1576,12 @@ proceed:
else
pline("But %s is as angry as ever.", mon_nam(shkp));
}
return(1);
return MOVE_STANDARD;
}
if(shkp != resident) {
impossible("dopay: not to shopkeeper?");
if(resident) setpaid(resident);
return(0);
return MOVE_CANCELLED;
}
seenSeals = countFarSigns(shkp);
if(seenSeals && strcmp(shkname(shkp), "Izchak") == 0) seenSeals = 0;
@ -1625,11 +1625,11 @@ proceed:
}
if(eshkp->pbanned){
pline("I'll never sell to you!");
return(0);
return MOVE_INSTANT;
}
if(seenSeals){
pline("I don't sell to your kind!");
return(0);
return MOVE_INSTANT;
}
/* pay debt, if any, first */
if(eshkp->debit) {
@ -1656,7 +1656,7 @@ proceed:
pline("But you don't%s have enough gold%s.",
stashed_gold ? " seem to" : "",
eshkp->credit ? " or credit" : "");
return(1);
return MOVE_STANDARD;
} else {
if (eshkp->credit >= dtmp) {
eshkp->credit -= dtmp;
@ -1707,7 +1707,7 @@ proceed:
You("%shave no money or credit%s.",
stashed_gold ? "seem to " : "",
paid ? " left" : "");
return(0);
return MOVE_INSTANT;
}
#ifndef GOLDOBJ
if ((u.ugold + eshkp->credit) < cheapest_item(shkp)) {
@ -1718,7 +1718,7 @@ proceed:
eshkp->billct > 1 ? " any of" : "", plur(eshkp->billct));
if(stashed_gold)
pline("Maybe you have some gold stashed away?");
return(0);
return MOVE_INSTANT;
}
/* this isn't quite right; it itemizes without asking if the
@ -1742,7 +1742,7 @@ proceed:
} else {
impossible("Shopkeeper administration out of order.");
setpaid(shkp); /* be nice to the player */
return 1;
return MOVE_STANDARD;
}
if (pass == bp->useup && otmp->quan == bp->bquan) {
/* pay for used-up items on first pass and others
@ -1754,7 +1754,7 @@ proceed:
if (payme_item == NULL || payme_item == otmp) {
switch (dopayobj(shkp, bp, &otmp, pass, itemize)) {
case PAY_CANT:
return 1; /*break*/
return MOVE_STANDARD; /*break*/
case PAY_BROKE:
paid = TRUE;
goto thanks; /*break*/
@ -1785,7 +1785,7 @@ proceed:
verbalize("Thank you for shopping in %s %s!",
s_suffix(shkname(shkp)),
shtypes[eshkp->shoptype - SHOPBASE].name);
return(1);
return MOVE_STANDARD;
}
#ifdef OTHER_SERVICES

View file

@ -48,7 +48,7 @@ dosit()
#ifdef STEED
if (u.usteed) {
You("are already sitting on %s.", mon_nam(u.usteed));
return (0);
return MOVE_CANCELLED;
}
#endif
@ -57,7 +57,7 @@ dosit()
You("tumble in place.");
else
You("are sitting on air.");
return 0;
return MOVE_CANCELLED;
} else if (is_pool(u.ux, u.uy, TRUE) && !Underwater) { /* water walking */
goto in_water;
}
@ -102,7 +102,7 @@ dosit()
melt_frozen_air();
if (likes_lava(youracedata)) {
pline_The("lava feels warm.");
return 1;
return MOVE_STANDARD;
}
pline_The("lava burns you!");
losehp(d((Fire_resistance ? 2 : 10), 10),
@ -437,7 +437,7 @@ dosit()
u.uevent.utook_castle = 1;
give_castle_trophy();
You_feel("worthy.");
return 1;
return MOVE_STANDARD;
}
else if (is_prince(youracedata) || Role_if(PM_NOBLEMAN))
You_feel("very comfortable here.");
@ -458,12 +458,12 @@ dosit()
if (!flags.female) {
pline("Males can't lay eggs!");
return 0;
return MOVE_CANCELLED;
}
if (YouHunger < (int)objects[EGG].oc_nutrition) {
You("don't have enough energy to lay an egg.");
return 0;
return MOVE_CANCELLED;
}
uegg = mksobj(EGG, MKOBJ_NOINIT);
@ -483,7 +483,7 @@ dosit()
There("are no seats in here!");
else
pline("Having fun sitting on the %s?", surface(u.ux,u.uy));
return(1);
return MOVE_STANDARD;
}
/* returns TRUE if the caller should print a message */

View file

@ -2598,29 +2598,29 @@ int dz;
if (is_silent(youracedata)) {
pline("As %s, you cannot speak.", an(youracedata->mname));
return(0);
return MOVE_CANCELLED;
}
if (Strangled) {
You_cant("speak. You're choking!");
return(0);
return MOVE_CANCELLED;
}
else if (Babble) {
You_cant("communicate. You're babbling unintelligibly!");
return(0);
return MOVE_CANCELLED;
}
else if (Screaming) {
You_cant("communicate. You're too busy screaming!");
return(0);
return MOVE_CANCELLED;
}
if(mad_turn(MAD_TOO_BIG)){
pline("It's too big!");
return 0;
return MOVE_CANCELLED;
}
if (u.uswallow) {
pline("They won't hear you out there.");
return(0);
return MOVE_CANCELLED;
}
if (!Blind && (otmp = shop_object(u.ux, u.uy)) != (struct obj *)0) {
@ -2641,12 +2641,12 @@ int dz;
u.dz = dz;
} else if (!getdir("Talk to whom? (in what direction)")) {
/* decided not to chat */
return(0);
return MOVE_CANCELLED;
}
#ifdef STEED
if (u.usteed && u.dz > 0)
return (domonnoise(u.usteed, TRUE));
return (domonnoise(u.usteed, TRUE)) ? MOVE_STANDARD : MOVE_INSTANT;
#endif
if (u.dz) {
struct engr *ep = get_head_engr();
@ -2655,7 +2655,7 @@ int dz;
break;//else continue
if(!ep || ep->halu_ward || ep->ward_id < FIRST_SEAL) pline("They won't hear you %s there.", u.dz < 0 ? "up" : "down");
else pline("The gate won't open with you standing on the seal!");
return(0);
return MOVE_CANCELLED;
}
if (u.dx == 0 && u.dy == 0) {
@ -2665,15 +2665,15 @@ int dz;
* etc... --KAA
if (u.umonnum == PM_ETTIN) {
You("discover that your other head makes boring conversation.");
return(1);
return MOVE_STANDARD;
}
*/
pline("Talking to yourself is a bad habit for a dungeoneer.");
return(0);
return MOVE_CANCELLED;
}
tx = u.ux+u.dx; ty = u.uy+u.dy;
if (!isok(tx, ty)) return 0;
if (!isok(tx, ty)) return MOVE_CANCELLED;
mtmp = m_at(tx, ty);
if(In_quest(&u.uz) && urole.neminum == PM_DURIN_S_BANE && artifact_door(tx, ty)){
@ -2686,7 +2686,7 @@ int dz;
unblock_point(tx,ty);
newsym(tx,ty);
}
return 1;
return MOVE_STANDARD;
}
bindresult = dobinding(tx,ty);
@ -2736,7 +2736,7 @@ int dz;
u.specialSealsKnown |= SEAL_UNKNOWN_GOD;
}
}
return 1;
return MOVE_STANDARD;
}
}
}
@ -2753,7 +2753,7 @@ int dz;
}
if(yn("Offer it?")=='n'){
You("refuse.");
return 1;
return MOVE_STANDARD;
}
else{
You("let %s take your %s.",mon_nam(mtmp), xname(uwep));
@ -2770,7 +2770,7 @@ int dz;
}
useup(optr);
mongone(mtmp);
return 1;
return MOVE_STANDARD1;
}
}
}
@ -2791,10 +2791,10 @@ int dz;
cost = 7;
if(gold < cost){
pline("Not enough gold!");
return 0;
return MOVE_STANDARD;
}
if(yn("That costs 7 gold. Pay?") != 'y'){
return 0;
return MOVE_STANDARD;
}
#ifndef GOLDOBJ
u.ugold -= cost;
@ -2814,10 +2814,10 @@ int dz;
cost = 70;
if(gold < cost){
pline("Not enough gold!");
return 0;
return MOVE_STANDARD;
}
if(yn("That costs 70 gold. Pay?") != 'y'){
return 0;
return MOVE_STANDARD;
}
#ifndef GOLDOBJ
u.ugold -= cost;
@ -2830,10 +2830,10 @@ int dz;
cost = 700;
if(gold < cost){
pline("Not enough gold!");
return 0;
return MOVE_STANDARD;
}
if(yn("That costs 700 gold. Pay?") != 'y'){
return 0;
return MOVE_STANDARD;
}
if(!uwep){
impossible("Your weapon vanished between the menu and the blessing?");
@ -2851,10 +2851,10 @@ int dz;
cost = 7000;
if(gold < cost){
pline("Not enough gold!");
return 0;
return MOVE_STANDARD;
}
if(yn("That costs 7,000 gold. Pay?") != 'y'){
return 0;
return MOVE_STANDARD;
}
#ifndef GOLDOBJ
u.ugold -= cost;
@ -2867,10 +2867,10 @@ int dz;
cost = 70000;
if(gold < cost){
pline("Not enough gold!");
return 0;
return MOVE_STANDARD;
}
if(yn("That costs 70,000 gold. Pay?") != 'y'){
return 0;
return MOVE_STANDARD;
}
if(!uwep){
impossible("Your weapon vanished between the menu and the blessing?");
@ -2890,9 +2890,9 @@ int dz;
break;
}
update_inventory();
return 1;
return MOVE_STANDARD;
}
return 0;
return MOVE_STANDARD;
}
if ( (!mtmp || mtmp->mundetected ||
@ -2920,7 +2920,7 @@ int dz;
Monnam(mtmp), (is_animal(mtmp->data) || mindless_mon(mtmp) ? "its" : hisherits(mtmp))
);
}
return 0;
return MOVE_INSTANT;
}
if (!mtmp || mtmp->mundetected ||
@ -2929,7 +2929,7 @@ int dz;
if (Underwater) {
Your("speech is unintelligible underwater.");
return(0);
return MOVE_INSTANT;
}
/* paralized monsters won't talk, except priests (who wake up) */
@ -2938,14 +2938,14 @@ int dz;
not noticing him and just not existing, so skip the message. */
if (canspotmon(mtmp))
pline("%s seems not to notice you.", Monnam(mtmp));
return(0);
return MOVE_INSTANT;
}
if (is_deaf(mtmp) && !mtmp->mcansee) {
/* If it is unseen, the player can't tell the difference between
not noticing him and just not existing, so skip the message. */
if (canspotmon(mtmp))
pline("%s seems not to notice you.", Monnam(mtmp));
return(0);
return MOVE_INSTANT;
}
/* sleeping monsters won't talk unless they wake up, except priests (who wake up) */
if (mtmp->msleeping){
@ -2955,7 +2955,7 @@ int dz;
}
else {
pline("%s stirs in %s slumber, but doesn't wake up.", Monnam(mtmp), mhis(mtmp));
return 1;
return MOVE_STANDARD;
}
}
@ -2966,27 +2966,27 @@ int dz;
/* laughing monsters can't talk */
if (!mtmp->mnotlaugh) {
if (!is_silent_mon(mtmp)) pline("%s laughs hysterically", Monnam(mtmp));
return(0);
return MOVE_INSTANT;
}
if (mtmp->mtame && mtmp->mnotlaugh && mtmp->meating) {
if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my);
pline("%s is eating noisily. Looks like it will take %d turns to finish.", Monnam(mtmp), mtmp->meating);
return (0);
return MOVE_INSTANT;
}
if(mtmp->mtyp == PM_NIGHTGAUNT && u.umonnum == PM_GHOUL){
You("bark the secret passwords known to ghouls.");
mtmp->mpeaceful = 1;
mtmp = tamedog(mtmp, (struct obj *)0);
return 1;
return MOVE_STANDARD;
}
if(is_undead(mtmp->data) && u.specialSealsActive&SEAL_ACERERAK && u.ulevel > mtmp->m_lev){
You("order the lesser dead to stand at ease.");
mtmp->mpeaceful = 1;
mtmp->mhp = mtmp->mhpmax;
return 1;
return MOVE_STANDARD;
}
if(mtmp->mtyp == PM_LADY_CONSTANCE && !mtmp->mtame && mtmp->mpeaceful && Role_if(PM_MADMAN) && u.uevent.qcompleted){
verbalize("Let's get out of here!");
@ -2994,7 +2994,7 @@ int dz;
mtmp = tamedog(mtmp, (struct obj *)0);
if(mtmp && mtmp->mtame)
EDOG(mtmp)->loyal = TRUE;
return 1;
return MOVE_STANDARD;
}
/* That is IT. EVERYBODY OUT. You are DEAD SERIOUS. */
if (mtmp->mtyp == PM_URANIUM_IMP) {
@ -3011,15 +3011,15 @@ int dz;
if (rnl(100) >= 90) {
pline("%s unfortunately ignores your overtures.",
Monnam(mtmp));
return 0;
return MOVE_STANDARD;
}
mtmp->mpeaceful = 1;
set_malign(mtmp);
}
return 0;
return MOVE_STANDARD;
}
return domonnoise(mtmp, TRUE);
return domonnoise(mtmp, TRUE) ? MOVE_STANDARD : MOVE_INSTANT;
}
//definition of externs in you.h
@ -3091,11 +3091,11 @@ int tx,ty;
for(;ep;ep=ep->nxt_engr)
if(ep->engr_x==tx && ep->engr_y==ty)
break;//else continue
if(!(ep)) return 0; //no engraving found
if(ep->halu_ward || ep->ward_id < FIRST_SEAL) return 0;
if(!(ep)) return MOVE_CANCELLED; //no engraving found
if(ep->halu_ward || ep->ward_id < FIRST_SEAL) return MOVE_CANCELLED;
else if(ep->complete_wards < 1){
pline("The seal has been damaged.");
return 0;
return MOVE_INSTANT;
// } else if(ep->engr_time+5 < moves){
// pline("The seal is too old.");
// return 0;
@ -3110,7 +3110,7 @@ int tx,ty;
}
}
if(m_at(tx,ty) && (ep->ward_id != ANDROMALIUS || m_at(tx,ty)->mtyp != PM_SEWER_RAT)) return 0;
if(m_at(tx,ty) && (ep->ward_id != ANDROMALIUS || m_at(tx,ty)->mtyp != PM_SEWER_RAT)) return MOVE_CANCELLED;
switch(ep->ward_id){
case AHAZU:{
@ -5115,7 +5115,7 @@ int tx,ty;
} else pline("You hear whispering all around you.");
}break;
}
return 1;
return MOVE_STANDARD;
}
int *

View file

@ -1502,7 +1502,7 @@ dospirit()
if(mad_turn(MAD_TOO_BIG)){
pline("It's too big!");
return 0;
return MOVE_CANCELLED;
}
if(!u.sealsActive && !u.specialSealsActive){
@ -1511,16 +1511,16 @@ dospirit()
if(spiriteffects(PWR_GNOSIS_PREMONITION, FALSE))
u.spiritPColdowns[PWR_GNOSIS_PREMONITION] = moves + 125;
}
return 1;
return MOVE_STANDARD;
} else {
You("don't have any spirits bound.");
return 0;
return MOVE_CANCELLED;
}
}
if (getspirit(&power_no))
return spiriteffects(power_no, FALSE);
return 0;
return MOVE_CANCELLED;
}
STATIC_OVL boolean
@ -2042,7 +2042,7 @@ purifying_blast()
zap(&youmonst, u.ux, u.uy, u.dx, u.dy, 25, &zapdata);
// u.uacinc-=7; //Note: was added when purifying blast began to charge.
return 0;
return MOVE_INSTANT;
}
STATIC_PTR int
@ -2074,7 +2074,7 @@ stargate()
n = select_menu(tmpwin, PICK_ONE, &selected);
if (n <= 0) {
destroy_nhwindow(tmpwin);
return 0;
return MOVE_CANCELLED;
}
i = selected[0].item.a_int - 1;
free((genericptr_t)selected);
@ -2105,7 +2105,7 @@ stargate()
losepw(125);
goto_level(&newlev, FALSE, FALSE, FALSE);
}
return 0;
return MOVE_INSTANT;
}
int
@ -2120,7 +2120,7 @@ spiriteffects(power, atme)
switch(power){
case PWR_ABDUCTION:{
struct monst *mon;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon){
@ -2156,7 +2156,7 @@ spiriteffects(power, atme)
}
}break;
case PWR_FIRE_BREATH:{
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
struct zapdata zapdata = { 0 };
zap(&youmonst, u.ux, u.uy, u.dx, u.dy, rn1(7, 7), basiczap(&zapdata, AD_FIRE, ZAP_BREATH, d(5, dsize)));
}break;
@ -2167,7 +2167,7 @@ spiriteffects(power, atme)
struct monst *mon;
sx = u.ux;
sy = u.uy;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(u.uswallow){
mon = u.ustuck;
if (!resists_magm(mon)) {
@ -2219,7 +2219,7 @@ spiriteffects(power, atme)
break;
case PWR_JESTER_S_MIRTH:{
struct monst *mon;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon){
@ -2252,7 +2252,7 @@ spiriteffects(power, atme)
struct monst *mon;
sx = u.ux;
sy = u.uy;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(u.uswallow){
explode(u.ux, u.uy, AD_ELEC, WAND_CLASS, d(range, dsize) * (Double_spell_size ? 3 : 2) / 2, EXPL_MAGICAL, 1 + !!Double_spell_size);
} else {
@ -2335,9 +2335,9 @@ spiriteffects(power, atme)
sy = u.uy;
if(Blind){
You("need to be able to see in order to glare!");
return 0;
return MOVE_CANCELLED;
}
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(u.uswallow){
You("can't see well enough in here!");
break;
@ -2413,7 +2413,7 @@ spiriteffects(power, atme)
//thick-skinned creatures loose their eyes
struct monst *mon;
int dmg;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon){
@ -2421,7 +2421,7 @@ spiriteffects(power, atme)
break;
} if(!freehand()){
You("need a free hand to make a touch attack!");
return 0;
return MOVE_CANCELLED;
}
struct attack basictouch = { AT_TUCH, AD_PHYS, 0, 0 };
int dieroll = rnd(20);
@ -2470,7 +2470,7 @@ spiriteffects(power, atme)
struct monst *mon;
sx = u.ux;
sy = u.uy;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(u.uswallow){
mon = u.ustuck;
enoughGold = FALSE;
@ -2541,7 +2541,7 @@ spiriteffects(power, atme)
case PWR_GIFT_OF_HEALING:{
struct monst *mon;
int dmg;
if (!getdir((char *)0) || (u.dz)) return(0);
if (!getdir((char *)0) || (u.dz)) return MOVE_CANCELLED;
if(!(u.dx || u.dy)){
You("heal yourself.");
healup(d(5,dsize), 0, FALSE, FALSE);
@ -2561,7 +2561,7 @@ spiriteffects(power, atme)
struct monst *mon;
struct obj *pseudo;
int dmg;
if (!getdir((char *)0) || (u.dz)) return(0);
if (!getdir((char *)0) || (u.dz)) return MOVE_CANCELLED;
if(!(u.dx || u.dy)){
int idx, recover, val_limit, aprobs = 0, fixpoint, curpoint;
@ -2637,7 +2637,7 @@ spiriteffects(power, atme)
otmp->ovar1 = 1 + u.ulevel/10;
projectile(&youmonst, otmp, (void *)0, HMON_PROJECTILE|HMON_FIRED, u.ux, u.uy, u.dx, u.dy, 0, rn1(5,5), TRUE, TRUE, FALSE);
nomul(0, NULL);
} else return 0;
} else return MOVE_CANCELLED;
break;
case PWR_THOUGHT_TRAVEL:{
if(Is_astralevel(&u.uz)){
@ -2656,7 +2656,7 @@ spiriteffects(power, atme)
else if (!tt_findadjacent(&cc, mon)) pline("Something blocks your way!");
cancelled = getpos(&cc, TRUE, "the desired creature");
}
if(cancelled < 0) return 0; /*abort*/
if(cancelled < 0) return MOVE_CANCELLED; /*abort*/
// if (u.usteed){
// }
teleds(cc.x, cc.y, FALSE);
@ -2673,7 +2673,7 @@ spiriteffects(power, atme)
}
}break;
case PWR_EARTH_SWALLOW:{
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
struct obj *otmp;
You("ask the earth to open.");
@ -2685,7 +2685,7 @@ spiriteffects(power, atme)
}break;
case PWR_ECHIDNA_S_VENOM:{
struct obj *otmp;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
otmp = mksobj(ACID_VENOM, NO_MKOBJ_FLAGS);
otmp->spe = 1; /* to indicate it's yours */
otmp->ovar1 = d(5,dsize); /* save the damge this should do */
@ -2695,7 +2695,7 @@ spiriteffects(power, atme)
case PWR_SUCKLE_MONSTER:{
struct monst *mon;
int dmg;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon) break;
@ -2713,7 +2713,7 @@ spiriteffects(power, atme)
} else break;
}break;
case PWR_PURIFYING_BLAST:{
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
// u.uacinc+=7; //Note: purifying_blast subtracts 7 from uacinc to compensate.
u.edenshield = moves+5;
@ -2725,7 +2725,7 @@ spiriteffects(power, atme)
case PWR_RECALL_TO_EDEN:{
struct monst *mon;
int perc;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon || mon->data->geno & G_UNIQ) break;
@ -2756,7 +2756,7 @@ spiriteffects(power, atme)
pline("To which doorway do you wish to travel?");
do cancelled = getpos(&cc, TRUE, "the desired doorway");
while( !(IS_DOOR(levl[cc.x][cc.y].typ) && teleok(cc.x, cc.y, FALSE)) && cancelled >= 0);
if(cancelled < 0) return 0; /*abort*/
if(cancelled < 0) return MOVE_CANCELLED; /*abort*/
// if (u.usteed){
// }
teleds(cc.x, cc.y, FALSE);
@ -2765,7 +2765,7 @@ spiriteffects(power, atme)
int dmg = 0;
struct monst *mon;
struct trap *t;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
t = t_at(u.ux+u.dx, u.uy+u.dy);
@ -2925,7 +2925,7 @@ spiriteffects(power, atme)
barrage = FALSE;
} else {
You("have nothing quivered.");
return 0;
return MOVE_CANCELLED;
}
break;
case PWR_BREATH_POISON:{
@ -2935,7 +2935,7 @@ spiriteffects(power, atme)
cc.y = u.uy;
if (getpos(&cc, TRUE, "the desired position") < 0) {
pline1(Never_mind);
return 0;
return MOVE_CANCELLED;
}
if (!cansee(cc.x, cc.y) || distu(cc.x, cc.y) >= 32) {
You("smell rotten eggs.");
@ -2949,9 +2949,9 @@ spiriteffects(power, atme)
struct trap *ttmp;
if (u.utrap){
You("can't use a ruinous strike while stuck in a trap!");
return 0;
return MOVE_CANCELLED;
}
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
You("deliver a ruinous strike.");
zap_dig(-1,-1,1);
@ -2988,7 +2988,7 @@ spiriteffects(power, atme)
case PWR_RAVEN_S_TALONS:{
int dmg;
struct monst *mon;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon) break;
@ -3017,12 +3017,12 @@ spiriteffects(power, atme)
case PWR_HORRID_WILTING:{
int dmg;
struct monst *mon;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon){
pline("\"There's no one there, buddy!\"");
return 0;
return MOVE_CANCELLED;
} if(nonliving(mon->data) || is_anhydrous(mon->data)){
shieldeff(mon->mx, mon->my);
break;
@ -3044,7 +3044,7 @@ spiriteffects(power, atme)
healup(dmg, 0, FALSE, FALSE);
} else {
pline("\"There's no one there, buddy!\"");
return 0;
return MOVE_CANCELLED;
}
}break;
case PWR_TURN_ANIMALS_AND_HUMANOIDS:{
@ -3078,7 +3078,7 @@ spiriteffects(power, atme)
end_burn(uwep, TRUE);
begin_burn(uwep);
}
} else return 0;
} else return MOVE_CANCELLED;
break;
case PWR_HELLFIRE:
if(uwep && (uwep->otyp == OIL_LAMP || uwep->otyp == POT_OIL || (is_lightsaber(uwep) && uwep->oartifact != ART_INFINITY_S_MIRRORED_ARC && uwep->otyp != KAMEREL_VAJRA)) && !uwep->oartifact && uwep->lamplit){
@ -3088,11 +3088,11 @@ spiriteffects(power, atme)
explode(u.dx, u.dy, AD_FIRE, WAND_CLASS, d(rnd(5), dsize)* (Double_spell_size ? 3 : 2) / 2, EXPL_FIERY, 1 + !!Double_spell_size);
end_burn(uwep, TRUE);
begin_burn(uwep);
} else return 0;
} else return MOVE_CANCELLED;
} else{
if(uwep && uwep->otyp == LANTERN) pline("You need an oil lamp. These modern lamps just aren't the same!");
else You("must wield a burning lamp!");
return 0;
return MOVE_CANCELLED;
}
break;
case PWR_CALL_MURDER:{
@ -3127,7 +3127,7 @@ spiriteffects(power, atme)
struct monst *mon;
sx = u.ux;
sy = u.uy;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
You("scream!");
if(u.uswallow){
zap_dig(-1,-1,1); /*try to blast free of engulfing monster*/
@ -3249,7 +3249,7 @@ spiriteffects(power, atme)
}
spoteffects(FALSE);
}
if(!once) return 0; //Canceled first prompt
if(!once) return MOVE_CANCELLED; //Canceled first prompt
}break;
case PWR_DISGUSTED_GAZE:{
struct monst *mon;
@ -3293,27 +3293,27 @@ spiriteffects(power, atme)
}
} else {
You("don't see a monster there.");
return 0;
return MOVE_CANCELLED;
}
} else return 0;
} else return MOVE_CANCELLED;
} else{
pline("The eyes on your hands are covered!");
return 0;
return MOVE_CANCELLED;
}
}break;
case PWR_BLOODY_TOUNGE:{
struct monst *mon;
if(!getdir((char *)0) || !(u.dx || u.dy)) return 0;
if(!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
Your("forked red tongue speaks of its own accord.");
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(mon){
mon->mflee = 1;//does not make monster hostile
pline("%s turns to flee.", Monnam(mon));
} else return 0;
}
}break;
case PWR_SILVER_TOUNGE:{
struct monst *mon;
if(!getdir((char *)0) || !(u.dx || u.dy)) return 0;
if(!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(mon){
Your("forked tongue speaks with silvery grace.");
@ -3333,7 +3333,7 @@ spiriteffects(power, atme)
}
} else{
pline("There's nothing there!");
return 0;
return MOVE_CANCELLED;
}
}break;
case PWR_EXHALATION_OF_THE_RIFT:{
@ -3343,7 +3343,7 @@ spiriteffects(power, atme)
struct monst *mon;
sx = u.ux;
sy = u.uy;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(u.uswallow){
mon = u.ustuck;
if(is_whirly(mon->data)){
@ -3500,22 +3500,22 @@ spiriteffects(power, atme)
case PWR_MASTER_OF_DOORWAYS:{
//with apologies to Neil Gaiman
struct monst *mon;
if (!getdir((char *)0)) return(0);
if (!getdir((char *)0)) return MOVE_CANCELLED;
if(!(u.dx || u.dy || u.dz)){
if(masterDoorBox(u.ux,u.uy)) break;
//else
pline("Maybe your innards should stay inside your body?");
return 0;
return MOVE_CANCELLED;
} else if(u.dz > 0) {
if(!opentrapdoor(!Can_dig_down(&u.uz))) return 0;
if(!opentrapdoor(!Can_dig_down(&u.uz))) return MOVE_CANCELLED;
else break;
} else if(u.dz < 0) {
if(!openrocktrap()) return 0;
if(!openrocktrap()) return MOVE_CANCELLED;
else break;
} else if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon){
if(!opennewdoor(u.ux+u.dx, u.uy+u.dy) && !masterDoorBox(u.ux+u.dx,u.uy+u.dy)) return 0;
if(!opennewdoor(u.ux+u.dx, u.uy+u.dy) && !masterDoorBox(u.ux+u.dx,u.uy+u.dy)) return MOVE_CANCELLED;
else break;
}
struct attack basicattack = {
@ -3564,7 +3564,7 @@ spiriteffects(power, atme)
setmangry(mon);
}
}
} else return 0;
} else return MOVE_CANCELLED;
}break;
case PWR_READ_SPELL:{
if(uwep && uwep->oclass == SPBOOK_CLASS && !uwep->oartifact &&
@ -3583,14 +3583,14 @@ spiriteffects(power, atme)
// }
} else{
You("need to be holding a spellbook.");
return 0;
return MOVE_CANCELLED;
}
}break;
case PWR_BOOK_TELEPATHY:
book_detect(u.ulevel>13);
break;
case PWR_UNITE_THE_EARTH_AND_SKY:
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)){
struct trap *t = t_at(u.ux+u.dx, u.uy+u.dy);
struct monst *mon = m_at(u.ux+u.dx, u.uy+u.dy);
@ -3671,12 +3671,12 @@ spiriteffects(power, atme)
break;
case PWR_TOUCH_OF_THE_VOID:{
struct monst *mon;
if(!getdir((char *)0) || (!u.dx && !u.dy)) return 0;
if(!getdir((char *)0) || (!u.dx && !u.dy)) return MOVE_CANCELLED;
mon = m_at(u.ux+u.dx,u.uy+u.dy);
if(!mon) return 0;
if(!mon) return MOVE_CANCELLED;
if(!freehand()){
You("need a free hand to make a touch attack!");
return 0;
return MOVE_CANCELLED;
}
struct attack basictouch = { AT_TUCH, AD_PHYS, 0, 0 };
int dieroll = rnd(20);
@ -3710,9 +3710,9 @@ spiriteffects(power, atme)
}break;
case PWR_ECHOS_OF_THE_LAST_WORD:{
struct monst *mon;
if(!getdir((char *)0) || (!u.dx && !u.dy)) return 0;
if(!getdir((char *)0) || (!u.dx && !u.dy)) return MOVE_CANCELLED;
mon = m_at(u.ux+u.dx,u.uy+u.dy);
if(!mon) return 0;
if(!mon) return MOVE_CANCELLED;
You("speak an echo of the Last Word of creation.");
if(mon->mtyp == PM_DREAD_SERAPH || mon->mtyp == PM_BLACK_FLOWER){
pline("Its voice harmonizes with your own!");
@ -3729,13 +3729,13 @@ spiriteffects(power, atme)
if (canspotmon(mon))
pline("%s flickers for a moment.",
Monnam(mon));
return 0;
return MOVE_INSTANT;
}
nlev = random_teleport_level();
if (nlev == depth(&u.uz)) {
if (canspotmon(mon))
pline("%s flickers for a moment.", Monnam(mon));
return 0;
return MOVE_INSTANT;
}
get_level(&tolevel, nlev);
if (canspotmon(mon)) {
@ -3758,7 +3758,7 @@ spiriteffects(power, atme)
pline("At what monster do you wish to gaze?");
do cancelled = getpos(&cc, TRUE, "the monster to gaze at");
while( !((mon=m_at(cc.x,cc.y)) && canspotmon(mon)) && cancelled >= 0);
if(cancelled < 0) return 0; /*abort*/
if(cancelled < 0) return MOVE_CANCELLED; /*abort*/
if(!mon || !canseemon(mon)){
You("don't see a monster there.");
break;
@ -3793,7 +3793,7 @@ spiriteffects(power, atme)
HLevitation |= I_SPECIAL;
} else {
You("are already levitating.");
return 0;
return MOVE_CANCELLED;
}
break;
case PWR_MOAN:{
@ -3816,9 +3816,9 @@ spiriteffects(power, atme)
}break;
case PWR_SWALLOW_SOUL:{
struct monst *mon;
if(!getdir((char *)0) || (!u.dx && !u.dy)) return 0;
if(!getdir((char *)0) || (!u.dx && !u.dy)) return MOVE_CANCELLED;
mon = m_at(u.ux+u.dx,u.uy+u.dy);
if(!mon) return 0;
if(!mon) return MOVE_CANCELLED;
if(resists_drli(mon) || nonliving(mon->data)){
pline("You can't swallow the soul of %s.", mon_nam(mon));
shieldeff(mon->mx, mon->my);
@ -3836,7 +3836,7 @@ spiriteffects(power, atme)
case PWR_EMBASSY_OF_ELEMENTS:{
int spirit_id = pick_council_seal();
if(spirit_id) councilspirit(spirit_id);
else return 0;
else return MOVE_CANCELLED;
You("re-contact %s.", sealNames[spirit_id-FIRST_SEAL]);
}break;
case PWR_SUMMON_MONSTER:{
@ -3846,7 +3846,7 @@ spiriteffects(power, atme)
if(pm && (mon = makemon(pm, u.ux, u.uy, MM_EDOG|MM_ADJACENTOK|MM_NOCOUNTBIRTH|MM_ESUM))){
initedog(mon);
mark_mon_as_summoned(mon, &youmonst, 10+u.ulevel/2, 0);
} else return 0;
} else return MOVE_CANCELLED;
}break;
case PWR_PSEUDONATURAL_SURGE:
pline("The dustlight seethes around you as tentacles erupt from your body!");
@ -3856,7 +3856,7 @@ spiriteffects(power, atme)
case PWR_SILVER_DEW:{
int dmg;
struct monst *mon;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon) break;
@ -3893,7 +3893,7 @@ spiriteffects(power, atme)
case PWR_GOLDEN_DEW:{
int dmg;
struct monst *mon;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(isok(u.ux+u.dx, u.uy+u.dy)) {
mon = m_at(u.ux+u.dx, u.uy+u.dy);
if(!mon) break;
@ -3932,7 +3932,7 @@ spiriteffects(power, atme)
if (u.uswallow){
You("can't do that in here!");
return 0;
return MOVE_CANCELLED;
}
else
{
@ -3945,31 +3945,31 @@ spiriteffects(power, atme)
}
if (!(umirror)) {
You("must have a breakable mirror in inventory to use this power!");
return 0;
return MOVE_CANCELLED;
}
/* get direction of power*/
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
/* arbitrary 50 range; note it is decreased by 3 when passing through monsters */
(void)bhit(u.dx, u.dy, 50, TRIGGER_BEAM, nudzirath_hit_mon, nudzirath_hit_pile, umirror, &foundmirror);
/* bhit will have set foundmirror to TRUE if it had worked */
if (!foundmirror)
return 0;
return MOVE_CANCELLED;
}
break;
case PWR_FLOWING_FORMS:{
struct monst *mon;
if(!getdir((char *)0) || u.dz)
return 0;
return MOVE_CANCELLED;
else if((!u.dx && !u.dy)) {
You_feel("a little %s.", Hallucination ? "normal" : "strange");
if (!Unchanging) polyself(FALSE);
break;
}
mon = m_at(u.ux+u.dx,u.uy+u.dy);
if(!mon) return 0;
if(!mon) return MOVE_CANCELLED;
if (resist(mon, '\0', 0, NOTELL) || resists_poly(mon->data)){
shieldeff(mon->mx, mon->my);
break;
@ -3988,7 +3988,7 @@ spiriteffects(power, atme)
if (is_mplayer(mdat) || (!is_human(mdat) && polyok(mdat)))
break;
}
if (tryct > 100) return 0; /* Should never happen */
if (tryct > 100) return MOVE_CANCELLED; /* Should never happen */
newcham(mon, mndx, FALSE, FALSE);
}
}break;
@ -4009,7 +4009,7 @@ spiriteffects(power, atme)
struct trap *ttmp2;
sx = u.ux;
sy = u.uy;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
// if(u.uswallow); //Phase through the surounding monster.
while(TRUE){ //Exits via break, phase through walls.
sx += u.dx;
@ -4027,7 +4027,7 @@ spiriteffects(power, atme)
if(mon) break;
} else break;
}
if(!mon) return 0;
if(!mon) return MOVE_CANCELLED;
qvr = mksobj(SPIKE, NO_MKOBJ_FLAGS);
qvr->blessed = 0;
qvr->cursed = 0;
@ -4075,7 +4075,7 @@ spiriteffects(power, atme)
case PWR_GNOSIS_PREMONITION:{
int spirit_id = pick_gnosis_seal();
if(spirit_id) gnosisspirit(spirit_id);
else return 0;
else return MOVE_CANCELLED;
You("dream of %s...", sealNames[spirit_id-FIRST_SEAL]);
}break;
default:
@ -4342,7 +4342,7 @@ int spell;
case PART_WATER:{
boolean parted = FALSE;
struct trap *ttmp;
if (!getdir((char *)0) || !(u.dx || u.dy)) return(0);
if (!getdir((char *)0) || !(u.dx || u.dy)) return MOVE_CANCELLED;
if(u.uswallow){
mon = u.ustuck;
pline("%s splits in half!",Monnam(mon));
@ -4463,14 +4463,11 @@ int spell;
break;
default:
pline("Unknown word of power!");
return 0;
return MOVE_CANCELLED;
break;
}
{
int res;
//Speak one word of power per move free.
return partial_action();
}
return MOVE_PARTIAL;
}
int
spelleffects(int spell, boolean atme, int spelltyp)
@ -4862,6 +4859,7 @@ dothrowspell:
}
/* Choose location where spell takes effect. */
/* returns 1 if the action should happen, 0 otherwise */
STATIC_OVL int
throwspell()
{
@ -6323,7 +6321,7 @@ reorder_spirit_powers()
char swaplet;
if(!u.sealsActive && !u.specialSealsActive){
You("don't have any spirits bound.");
return 0;
return MOVE_CANCELLED;
}
if (flags.menu_style == MENU_TRADITIONAL) {
char ilet, lets[BUFSZ], qbuf[QBUFSZ];
@ -6336,7 +6334,7 @@ reorder_spirit_powers()
ilet = yn_function(qbuf, (char *)0, '\0');
if (index(quitchars, ilet))
return 0;
return MOVE_CANCELLED;
if(check_spirit_let(ilet)){
if(ilet >= 'a' && ilet <= 'z'){
@ -6346,7 +6344,7 @@ reorder_spirit_powers()
}
} else {
You("don't know that power.");
return 0;
return MOVE_CANCELLED;
}
} else {
int power_no;
@ -6356,7 +6354,7 @@ reorder_spirit_powers()
break;
}
}
if(power_indx == -1) return 0;
if(power_indx == -1) return MOVE_CANCELLED;
pline("Move power to what letter? (a-z, A-Z)");
swaplet = readchar();
if(swaplet >= 'a' && swaplet <= 'z'){
@ -6364,17 +6362,18 @@ reorder_spirit_powers()
u.spiritPOrder[power_indx] = u.spiritPOrder[(int)swaplet-'a'];
u.spiritPOrder[(int)swaplet-'a'] = power;
pline("Power reordered.");
return 0;
return MOVE_INSTANT;
} else if(swaplet >= 'A' && swaplet <= 'Z'){
int power = u.spiritPOrder[power_indx];
u.spiritPOrder[power_indx] = u.spiritPOrder[swaplet-'A'+26];
u.spiritPOrder[swaplet-'A'+26] = power;
pline("Power reordered.");
return 0;
return MOVE_INSTANT;
} else {
pline("Invalid letter.");
return 0;
return MOVE_CANCELLED;
}
return MOVE_CANCELLED; /* not reached */
}
void

View file

@ -199,10 +199,10 @@ doride()
if (wizard && yn("Force the mount to succeed?") == 'y')
forcemount = TRUE;
#endif
return (mount_steed(m_at(u.ux+u.dx, u.uy+u.dy), forcemount));
return (mount_steed(m_at(u.ux+u.dx, u.uy+u.dy), forcemount)) ? MOVE_STANDARD : MOVE_CANCELLED;
} else
return 0;
return 1;
return MOVE_CANCELLED;
return MOVE_STANDARD;
}

View file

@ -790,7 +790,7 @@ dotele()
if (!Teleportation)
You("don't know that spell.");
else You("are not able to teleport at will.");
return(0);
return MOVE_CANCELLED;
}
#ifdef WIZARD
}
@ -803,7 +803,7 @@ dotele()
#endif
You("lack the strength %s.",
castit ? "for a teleport spell" : "to teleport");
return 1;
return MOVE_STANDARD;
#ifdef WIZARD
}
#endif
@ -819,23 +819,23 @@ dotele()
{
You("lack the energy %s.",
castit ? "for a teleport spell" : "to teleport");
return 1;
return MOVE_STANDARD;
}
}
if (check_capacity(
"Your concentration falters from carrying so much."))
return 1;
return MOVE_STANDARD;
if (castit) {
exercise(A_WIS, TRUE);
if (spelleffects(sp_no, TRUE, 0))
return(1);
return MOVE_STANDARD;
else
#ifdef WIZARD
if (!wizard)
#endif
return(0);
return MOVE_CANCELLED;
} else {
losepw(energy);
flags.botl = 1;
@ -848,10 +848,10 @@ dotele()
(void) next_to_u();
} else {
You1(shudder_for_moment);
return(0);
return MOVE_INSTANT;
}
if (!trap) morehungry(100);
return(1);
return MOVE_STANDARD;
}

View file

@ -3805,35 +3805,35 @@ dodeepswim()
if(u.usubwater){
if(is_3dwater(u.ux, u.uy)){
pline("There is no surface!");
return 0;
return MOVE_CANCELLED;
} else {
You("swim up to the surface.");
u.usubwater = 0;
vision_recalc(2); /* unsee old position */
vision_full_recalc = 1;
doredraw();
return 1;
return MOVE_STANDARD;
}
} else {
if(ACURR(A_CON) > 5){
if(Is_waterlevel(&u.uz)){
You("are already under water!");
return 0;
return MOVE_CANCELLED;
} else {
You("dive below the surface.");
u.usubwater = 1;
under_water(1);
vision_recalc(2); /* unsee old position */
vision_full_recalc = 1;
return 1;
return MOVE_STANDARD;
}
} else You("can't hold your breath for very long.");
return 0;
return MOVE_CANCELLED;
}
} else {
if(!u.uinwater) You("can't dive unless you're swimming!");
else if(!Swimming) You("can't swim!");
return 0;
return MOVE_CANCELLED;
}
}
@ -3864,19 +3864,19 @@ dountrap() /* disarm a trap */
{
if (near_capacity() >= HVY_ENCUMBER) {
pline("You're too strained to do that.");
return 0;
return MOVE_CANCELLED;
}
if (((nohands(youracedata) || !freehand()) && !(webmaker(youracedata) || u.sealsActive&SEAL_CHUPOCLOPS || (uarm && uarm->oartifact==ART_SPIDERSILK))) || !youracedata->mmove) {
pline("And just how do you expect to do that?");
return 0;
return MOVE_CANCELLED;
} else if (u.ustuck && sticks(&youmonst)) {
pline("You'll have to let go of %s first.", mon_nam(u.ustuck));
return 0;
return MOVE_CANCELLED;
}
if (u.ustuck || (welded(uwep) && bimanual(uwep,youracedata))) {
Your("%s seem to be too busy for that.",
makeplural(body_part(HAND)));
return 0;
return MOVE_CANCELLED;
}
return untrap((struct obj *)0);
}
@ -4098,7 +4098,7 @@ struct trap *ttmp;
struct monst *mtmp;
int fails = try_disarm(ttmp, FALSE);
if (fails < 2) return fails;
if (fails < 2) return (fails==0 ? MOVE_CANCELLED : MOVE_STANDARD);
/* ok, disarm it. */
@ -4123,7 +4123,7 @@ struct trap *ttmp;
}
}
newsym(u.ux + u.dx, u.uy + u.dy);
return 1;
return MOVE_STANDARD;
}
void
@ -4171,10 +4171,10 @@ struct trap *ttmp;
{
int fails = try_disarm(ttmp, FALSE);
if (fails < 2) return fails;
if (fails < 2) return (fails==0 ? MOVE_CANCELLED : MOVE_STANDARD);
You("disarm %s land mine.", the_your[ttmp->madeby_u]);
remove_trap_ammo(ttmp);
return 1;
return MOVE_STANDARD;
}
STATIC_OVL int
@ -4184,7 +4184,7 @@ struct trap *ttmp;
xchar trapx = ttmp->tx, trapy = ttmp->ty;
int fails = try_disarm(ttmp, FALSE);
if (fails < 2) return fails;
if (fails < 2) return (fails==0 ? MOVE_CANCELLED : MOVE_STANDARD);
You("disarm the water trap!");
deltrap(ttmp);
levl[trapx][trapy].typ = FOUNTAIN;
@ -4281,7 +4281,7 @@ struct trap *ttmp;
bad_tool = (obj->cursed ||
(obj->otyp != POT_WATER));
fails = try_disarm(ttmp, bad_tool);
if (fails < 2) return fails;
if (fails < 2) return (fails==0 ? MOVE_CANCELLED : MOVE_STANDARD);
useup(obj);
makeknown(POT_WATER);
@ -4309,7 +4309,7 @@ struct trap *ttmp;
(obj->otyp != CAN_OF_GREASE || !obj->spe)));
fails = try_disarm(ttmp, bad_tool);
if (fails < 2) return fails;
if (fails < 2) return (fails==0 ? MOVE_CANCELLED : MOVE_STANDARD);
/* successfully used oil or grease to fix squeaky board */
if (obj->otyp == CAN_OF_GREASE) {
@ -4333,10 +4333,10 @@ struct trap *ttmp;
{
int fails = try_disarm(ttmp, FALSE);
if (fails < 2) return fails;
if (fails < 2) return (fails==0 ? MOVE_CANCELLED : MOVE_STANDARD);
You("disarm %s trap.", the_your[ttmp->madeby_u]);
remove_trap_ammo(ttmp);
return 1;
return MOVE_STANDARD;
}
/* Is the weight too heavy?
@ -4356,13 +4356,14 @@ boolean stuff;
if (!ttmp->madeby_u && !mtmp->mpeaceful && mtmp->mcanmove &&
!mindless_mon(mtmp) &&
mtmp->data->mlet != S_HUMAN && rnl(100) < 30) {
mtmp->mpeaceful = 1;
set_malign(mtmp); /* reset alignment */
pline("%s thinks it was nice of you to try.", Monnam(mtmp));
mtmp->mpeaceful = 1;
set_malign(mtmp); /* reset alignment */
pline("%s thinks it was nice of you to try.", Monnam(mtmp));
return MOVE_INSTANT;
}
return 0;
return MOVE_CANCELLED;
}
return 1;
return MOVE_STANDARD;
}
/* Help trapped monster (out of a (spiked) pit) */
@ -4386,17 +4387,17 @@ struct trap *ttmp;
*/
if (!mtmp->mtrapped) {
pline("%s isn't trapped.", Monnam(mtmp));
return 0;
return MOVE_CANCELLED;
}
/* Do you have the necessary capacity to lift anything? */
if (check_capacity((char *)0)) return 1;
if (check_capacity((char *)0)) return MOVE_STANDARD;
/* Will our hero succeed? */
if ((uprob = untrap_prob(ttmp)) && !mtmp->msleeping && mtmp->mcanmove) {
You("try to reach out your %s, but %s backs away skeptically.",
makeplural(body_part(ARM)),
mon_nam(mtmp));
return 1;
return MOVE_STANDARD;
}
@ -4413,7 +4414,7 @@ struct trap *ttmp;
Sprintf(kbuf, "trying to help %s out of a pit",
an(mtmp->data->mname));
instapetrify(kbuf);
return 1;
return MOVE_STANDARD;
}
}
/* need to do cockatrice check first if sleeping or paralyzed */
@ -4424,7 +4425,7 @@ struct trap *ttmp;
mtmp->msleeping = 0;
pline("%s awakens.", Monnam(mtmp));
}
return 1;
return MOVE_STANDARD;
}
You("reach out your %s and grab %s.",
@ -4442,18 +4443,18 @@ struct trap *ttmp;
/* is the monster too heavy? */
wt = inv_weight() + mtmp->data->cwt;
if (!try_lift(mtmp, ttmp, wt, FALSE)) return 1;
if (!try_lift(mtmp, ttmp, wt, FALSE)) return MOVE_STANDARD;
/* is the monster with inventory too heavy? */
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
wt += otmp->owt;
if (!try_lift(mtmp, ttmp, wt, TRUE)) return 1;
if (!try_lift(mtmp, ttmp, wt, TRUE)) return MOVE_STANDARD;
You("pull %s out of the pit.", mon_nam(mtmp));
mtmp->mtrapped = 0;
fill_pit(mtmp->mx, mtmp->my);
reward_untrap(ttmp, mtmp);
return 1;
return MOVE_STANDARD;
}
int
@ -4473,10 +4474,10 @@ struct obj * tool;
char the_trap[BUFSZ], qbuf[QBUFSZ];
int containercnt = 0;
if(!getdir((char *)0)) return(0);
if(!getdir((char *)0)) return MOVE_CANCELLED;
x = u.ux + u.dx;
y = u.uy + u.dy;
if(!isok(x,y)) return(0);
if(!isok(x,y)) return MOVE_CANCELLED;
for(otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere) {
if(Is_box(otmp) && !u.dx && !u.dy) {
@ -4499,7 +4500,7 @@ struct obj * tool;
You("see %s.", the_trap);
switch (ynq("Try to pull it out?")) {
case 'q': return(1);
case 'q': return MOVE_STANDARD;
case 'n': trap_skipped = TRUE; continue;
}
@ -4510,7 +4511,7 @@ struct obj * tool;
pline("It is stuck fast!");
}
return(1);
return MOVE_STANDARD;
}
}
@ -4531,7 +4532,7 @@ struct obj * tool;
an(defsyms[trap_to_defsym(ttmp->ttyp)].explanation),
ttmp->ttyp == WEB ? "Remove" : "Disarm", the_trap);
switch (ynq(qbuf)) {
case 'q': return(0);
case 'q': return MOVE_CANCELLED;
case 'n': trap_skipped = TRUE;
deal_with_floor_trap = FALSE;
break;
@ -4542,7 +4543,7 @@ struct obj * tool;
if (u.utrap) {
You("cannot deal with %s while trapped%s!", the_trap,
(x == u.ux && y == u.uy) ? " in it" : "");
return 1;
return MOVE_STANDARD;
}
switch(ttmp->ttyp) {
case FLESH_HOOK:
@ -4563,11 +4564,11 @@ struct obj * tool;
case SPIKED_PIT:
if (!u.dx && !u.dy) {
You("are already on the edge of the pit.");
return 0;
return MOVE_CANCELLED;
}
if (!(mtmp = m_at(x,y))) {
pline("Try filling the pit instead.");
return 0;
return MOVE_CANCELLED;
}
return help_monster_out(mtmp, ttmp);
case VIVI_TRAP:
@ -4592,7 +4593,7 @@ struct obj * tool;
}
deltrap(ttmp);
newsym(u.ux + u.dx, u.uy + u.dy);
return 1;
return MOVE_STANDARD;
case TELEP_TRAP:
case LEVEL_TELEP:
case MAGIC_TRAP:
@ -4603,7 +4604,7 @@ struct obj * tool;
// else fall through
default:
You("cannot disable %s trap.", (u.dx || u.dy) ? "that" : "this");
return 0;
return MOVE_CANCELLED;
}
}
} /* end if */
@ -4625,7 +4626,7 @@ struct obj * tool;
}
mtmp->entangled = 0;
}
return 1;
return MOVE_STANDARD;
}
if(!u.dx && !u.dy) {
@ -4635,26 +4636,26 @@ struct obj * tool;
safe_qbuf("", sizeof("There is bolted down here. Unbolt it?"),
doname(otmp), an(simple_typename(otmp->otyp)), "a box"));
switch (ynq(qbuf)) {
case 'q': return(0);
case 'q': return MOVE_CANCELLED;
case 'n': continue;
}
#ifdef STEED
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) {
You("aren't skilled enough to reach from %s.",
mon_nam(u.usteed));
return(0);
return MOVE_CANCELLED;
}
#endif
if (!(tool && tool->oartifact == ART_MASTER_KEY_OF_THIEVERY)) {
pline("The bolts are seemingly magical and impossible to budge.");
return(0);
return MOVE_CANCELLED;
}
else {
pline("The bolts release, and %s locks itself!", the(xname(otmp)));
otmp->olocked = 1;
otmp->obolted = 0;
otmp->owt = weight(otmp);
return(1);
return MOVE_STANDARD;
}
}
if (Is_box(otmp)) {
@ -4662,14 +4663,14 @@ struct obj * tool;
safe_qbuf("", sizeof("There is here. Check it for traps?"),
doname(otmp), an(simple_typename(otmp->otyp)), "a box"));
switch (ynq(qbuf)) {
case 'q': return(0);
case 'q': return MOVE_CANCELLED;
case 'n': continue;
}
#ifdef STEED
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) {
You("aren't skilled enough to reach from %s.",
mon_nam(u.usteed));
return(0);
return MOVE_CANCELLED;
}
#endif
if ((otmp->otrapped && otmp->otyp != MAGIC_CHEST &&
@ -4679,7 +4680,7 @@ struct obj * tool;
if (!confused) exercise(A_WIS, TRUE);
switch (ynq("Disarm it?")) {
case 'q': return(1);
case 'q': return MOVE_STANDARD;
case 'n': trap_skipped = TRUE; continue;
}
@ -4697,18 +4698,18 @@ struct obj * tool;
}
}
else pline("That %s was not trapped.", xname(otmp));
return(1);
return MOVE_STANDARD;
}
else {
You("find no traps on %s.", the(xname(otmp)));
return(1);
return MOVE_STANDARD;
}
}
}
You(trap_skipped ? "find no other traps here."
: "know of no traps here.");
return(0);
return MOVE_CANCELLED;
}
if ((mtmp = m_at(x,y)) &&
@ -4718,7 +4719,7 @@ struct obj * tool;
!Protection_from_shape_changers) {
stumble_onto_mimic(mtmp);
return(1);
return MOVE_STANDARD;
}
if (!IS_DOOR(levl[x][y].typ)) {
@ -4726,19 +4727,19 @@ struct obj * tool;
You("cannot disable that trap.");
else
You("know of no traps there.");
return(0);
return MOVE_CANCELLED;
}
switch (levl[x][y].doormask) {
case D_NODOOR:
You("%s no door there.", Blind ? "feel" : "see");
return(0);
return MOVE_CANCELLED;
case D_ISOPEN:
pline("This door is safely open.");
return(0);
return MOVE_CANCELLED;
case D_BROKEN:
pline("This door is broken.");
return(0);
return MOVE_CANCELLED;
}
if ((levl[x][y].doormask & D_TRAPPED
@ -4747,7 +4748,7 @@ struct obj * tool;
|| (!force && confused && !rn2(3))) {
You("find a trap on the door!");
exercise(A_WIS, TRUE);
if (ynq("Disarm it?") != 'y') return(1);
if (ynq("Disarm it?") != 'y') return MOVE_STANDARD;
if (levl[x][y].doormask & D_TRAPPED) {
ch = 15 + (Role_if(PM_ROGUE) ? u.ulevel*3 : u.ulevel);
exercise(A_DEX, TRUE);
@ -4765,10 +4766,10 @@ struct obj * tool;
levl[x][y].doormask &= ~D_TRAPPED;
}
} else pline("This door was not trapped.");
return(1);
return MOVE_STANDARD;
} else {
You("find no traps on the door.");
return(1);
return MOVE_STANDARD;
}
}
#endif /* OVL2 */

View file

@ -45,14 +45,14 @@ doversion()
char buf[BUFSZ];
pline("%s", getversionstring(buf));
return 0;
return MOVE_CANCELLED;
}
int
doextversion()
{
display_file(OPTIONS_USED, TRUE);
return 0;
return MOVE_CANCELLED;
}
#ifdef MICRO

View file

@ -3051,7 +3051,7 @@ int enhance_skill(boolean want_dump)
}
#endif
} while (speedy && n > 0);
return 0;
return MOVE_CANCELLED;
}
/*

View file

@ -228,7 +228,7 @@ boolean quietly; /* hide the basic message saying what you are now wielding */
}
}
}
return(res);
return (res) ? MOVE_STANDARD : MOVE_CANCELLED;
}
void
@ -267,27 +267,27 @@ dowield()
multi = 0;
if (cantwield(youracedata)) {
pline("Don't be ridiculous!");
return(0);
return MOVE_CANCELLED;
}
if (!freehand()) {
You("have no free %s to wield anything!", body_part(HAND));
return(0);
return MOVE_CANCELLED;
}
/* Prompt for a new weapon */
if (!(wep = getobj(wield_objs, "wield")))
/* Cancelled */
return (0);
return MOVE_CANCELLED;
else if (wep == uwep) {
You("are already wielding that!");
if (is_weptool(wep)) unweapon = FALSE; /* [see setuwep()] */
return (0);
return MOVE_CANCELLED;
} else if (welded(uwep)) {
weldmsg(uwep);
/* previously interrupted armor removal mustn't be resumed */
reset_remarm();
return (0);
return MOVE_INSTANT;
}
/* Handle no object, or object in other slot */
@ -305,7 +305,7 @@ dowield()
#endif
)) {
You("cannot wield that!");
return (0);
return MOVE_CANCELLED;
}
/* Set your new primary weapon */
@ -325,18 +325,18 @@ int
doswapweapon()
{
register struct obj *oldwep, *oldswap;
int result = 0;
int result = MOVE_INSTANT;
/* May we attempt this? */
multi = 0;
if (cantwield(youracedata)) {
pline("Don't be ridiculous!");
return(0);
return MOVE_CANCELLED;
}
if (welded(uwep)) {
weldmsg(uwep);
return (0);
return MOVE_INSTANT;
}
/* Unwield your current secondary weapon */
@ -363,7 +363,7 @@ doswapweapon()
untwoweapon();
// return (result);
return (0);
return MOVE_INSTANT;
}
int
@ -385,7 +385,7 @@ dowieldquiver()
/* Prompt for a new quiver */
if (!(newquiver = getobj(quivee_types, "ready")))
/* Cancelled */
return (0);
return MOVE_CANCELLED;
/* Handle no object, or object in other slot */
/* Any type is okay, since we give no intrinsics anyways */
@ -396,23 +396,23 @@ dowieldquiver()
setuqwep(newquiver = (struct obj *) 0);
} else {
You("already have no ammunition readied!");
return(0);
return MOVE_CANCELLED;
}
} else if (newquiver == uquiver) {
pline("That ammunition is already readied!");
return(0);
return MOVE_CANCELLED;
} else if (newquiver == uwep) {
/* Prevent accidentally readying the main weapon */
pline("%s already being used as a weapon!",
!is_plural(uwep) ? "That is" : "They are");
return(0);
return MOVE_CANCELLED;
} else if (newquiver->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL
#ifdef STEED
| W_SADDLE
#endif
)) {
You("cannot ready that!");
return (0);
return MOVE_CANCELLED;
} else {
long dummy;
@ -434,7 +434,7 @@ dowieldquiver()
/* Finally, place it in the quiver */
setuqwep(newquiver);
/* Take no time since this is a convenience slot */
return (0);
return MOVE_INSTANT;
}
/* use to re-wield a returned thrown weapon */
void
@ -636,7 +636,7 @@ dotwoweapon()
You("switch to your primary weapon.");
u.twoweap = 0;
update_inventory();
return (0);
return MOVE_INSTANT;
}
/* May we use two weapons? */
@ -645,9 +645,9 @@ dotwoweapon()
You("begin two-weapon combat.");
u.twoweap = 1;
update_inventory();
return (rnd(20) > ACURR(A_DEX));
return (rnd(20) > ACURR(A_DEX)) ? MOVE_STANDARD : MOVE_INSTANT;
}
return (0);
return MOVE_INSTANT;
}
/*** Functions to empty a given slot ***/

View file

@ -16592,12 +16592,12 @@ android_combo()
if (!uandroid) {
pline("You aren't an android!");
return FALSE;
return MOVE_CANCELLED;
}
if(Straitjacketed){
You("can't do a combo while your arms are bound!");
return FALSE;
return MOVE_CANCELLED;
}
static struct attack weaponhit = { AT_WEAP, AD_PHYS, 0, 0 };
@ -16609,7 +16609,7 @@ android_combo()
/* unarmed */
if (!uwep || (is_lightsaber(uwep) && !litsaber(uwep))){
if (!getdir((char *)0))
return FALSE;
return MOVE_CANCELLED;
if (u.ustuck && u.uswallow)
mdef = u.ustuck;
else
@ -16630,7 +16630,7 @@ android_combo()
u.uen--;
flags.botl = 1;
}
else return TRUE;
else return MOVE_ATTACKED;
}
if (P_SKILL(P_BARE_HANDED_COMBAT) >= P_EXPERT && u.uen > 0){
int j = jump(1);
@ -16639,12 +16639,12 @@ android_combo()
u.uen--;
flags.botl = 1;
}
else return TRUE;
else return MOVE_ATTACKED;
}
if (P_SKILL(P_BARE_HANDED_COMBAT) >= P_MASTER && u.uen > 0){
int j = jump(1);
int d = getdir((char *)0);
if (!j && !d) return TRUE;
if (!j && !d) return MOVE_ATTACKED;
u.uen--;
flags.botl = 1;
if (d){
@ -16667,7 +16667,7 @@ android_combo()
}
}
if(P_SKILL(P_BARE_HANDED_COMBAT) >= P_GRAND_MASTER && u.uen > 0){
if(!getdir((char *)0)) return 1;
if(!getdir((char *)0)) return MOVE_ATTACKED;
u.uen--;
flags.botl = 1;
if (u.ustuck && u.uswallow)
@ -16681,15 +16681,12 @@ android_combo()
xmeleehity(&youmonst, mdef, &finisher, (struct obj **)0, vis, 0, FALSE);
}
}
return TRUE;
return MOVE_ATTACKED;
}
else if (is_lightsaber(uwep) && litsaber(uwep)){ //!uwep handled above
/* get direction of attack */
if (!getdir((char *)0))
return FALSE;
/* fast weapons give you speed */
if (fast_weapon(uwep))
youmonst.movement += 2;
return MOVE_CANCELLED;
/* get defender */
if (u.ustuck && u.uswallow)
mdef = u.ustuck;
@ -16734,13 +16731,13 @@ android_combo()
if ((a && !u.dz) || k){
u.uen--;
}
else return TRUE;
else return MOVE_ATTACKED;
}
if (uwep && P_SKILL(objects[uwep->otyp].oc_skill) >= P_EXPERT && u.uen > 0){
int j = jump(1);
int d = getdir((char *)0);
if (!j && (!d || u.dz))
return TRUE;
return MOVE_ATTACKED;
u.uen--;
flags.botl = 1;
if (d){
@ -16762,7 +16759,7 @@ android_combo()
}
}
}
return TRUE;
return MOVE_ATTACKED;
}
else if (objects[uwep->otyp].oc_skill == P_SPEAR || objects[uwep->otyp].oc_skill == P_LANCE){ //!uwep handled above
boolean attacked = FALSE;
@ -16776,12 +16773,7 @@ android_combo()
while (n > 0 && u.uen > 0){
/* get direction of attack; if first time, cancelling will take no time */
if (!getdir((char *)0) || u.dz)
return attacked;
/* things that only occur in the first 'attack' of the combo */
if (!attacked) {
if (fast_weapon(uwep))
youmonst.movement += 2;
}
return attacked ? MOVE_ATTACKED : MOVE_CANCELLED;
/* get defender */
if (u.ustuck && u.uswallow)
mdef = u.ustuck;
@ -16806,15 +16798,12 @@ android_combo()
flags.botl = 1;
attacked = TRUE;
}
return TRUE;
return MOVE_ATTACKED;
}
else if (objects[uwep->otyp].oc_skill == P_WHIP){ //!uwep handled above
/* get direction of attack */
if (!getdir((char *)0) || u.dz)
return FALSE;
/* fast weapons give you speed */
if (fast_weapon(uwep))
youmonst.movement += 2;
return MOVE_CANCELLED;
/* get defender */
if (u.ustuck && u.uswallow)
mdef = u.ustuck;
@ -16835,7 +16824,7 @@ android_combo()
if (uwep && P_SKILL(objects[uwep->otyp].oc_skill) >= P_SKILLED && u.uen > 0){
/* get direction AND do whip things */
if (!use_whip(uwep) || !uwep)
return TRUE;
return MOVE_ATTACKED;
/* get defender */
if (u.ustuck && u.uswallow)
mdef = u.ustuck;
@ -16856,7 +16845,7 @@ android_combo()
if (uwep && P_SKILL(objects[uwep->otyp].oc_skill) >= P_EXPERT && u.uen > 0){
/* get direction AND do whip things */
if (!use_whip(uwep) || !uwep)
return TRUE;
return MOVE_ATTACKED;
if (uwep->otyp == FORCE_WHIP){
/* turn it into a sword */
use_force_sword(uwep);
@ -16892,15 +16881,13 @@ android_combo()
u.uen--;
flags.botl = 1;
}
return TRUE;
return MOVE_ATTACKED;
}
else if (!bimanual(uwep, youracedata)){ //!uwep handled above
/* get direction of attack */
if (!getdir((char *)0) || u.dz)
return FALSE;
/* fast weapons give you speed */
if (fast_weapon(uwep))
youmonst.movement += 2;
return MOVE_CANCELLED;
/* get defender */
if (u.ustuck && u.uswallow)
mdef = u.ustuck;
@ -16921,13 +16908,13 @@ android_combo()
if (uwep && P_SKILL(objects[uwep->otyp].oc_skill) >= P_SKILLED && u.uen > 0){
//Two throws. Aborting either one ends the combo.
if(!dofire())
return TRUE;
return MOVE_ATTACKED;
//Charge energy for continuing combo after first throw.
u.uen--;
flags.botl = 1;
//Now do second throw. Aborting either one ends the combo.
if(!dofire())
return TRUE;
return MOVE_ATTACKED;
}
if (uwep && P_SKILL(objects[uwep->otyp].oc_skill) >= P_EXPERT && u.uen > 0){
//One throw, followed by a moving attack. Aborting either one ends the combo.
@ -16938,7 +16925,7 @@ android_combo()
if (uwep){
/* get direction of attack */
if (!getdir((char *)0) || u.dz)
return TRUE;
return MOVE_ATTACKED;
/* Lunge in indicated direction */
if(!u.ustuck && !u.utrap && goodpos(u.ux+u.dx, u.uy+u.dy, &youmonst, 0)){
hurtle(u.dx, u.dy, 1, FALSE, FALSE);
@ -16960,19 +16947,16 @@ android_combo()
projectile(&youmonst, uwep, (void *)0, HMON_PROJECTILE|HMON_FIRED, u.ux, u.uy, u.dx, u.dy, u.dz, 10, FALSE, TRUE, FALSE);
}
}
else return TRUE;
else return MOVE_ATTACKED;
}
return TRUE;
return MOVE_ATTACKED;
}
else if (bimanual(uwep, youracedata)){ //!uwep handled above
int i, j;
/* get direction of attack */
if (!getdir((char *)0) || u.dz)
return FALSE;
/* fast weapons give you speed */
if (fast_weapon(uwep))
youmonst.movement += 2;
return MOVE_CANCELLED;
if (u.dz) {
/* if getdir() was gived u.dz != 0, we will just pick a random direction to start hitting */
i = rn2(8);
@ -17001,7 +16985,7 @@ android_combo()
if (uwep && P_SKILL(objects[uwep->otyp].oc_skill) >= P_SKILLED && u.uen > 0){
/* use a kick to get direction */
if (!dokick())
return TRUE;
return MOVE_ATTACKED;
/* get your targetted direction's index */
for (i = 0; i < 8; i++)
if (xdir[i] == u.dx && ydir[i] == u.dy)
@ -17024,7 +17008,7 @@ android_combo()
}
if (uwep && P_SKILL(objects[uwep->otyp].oc_skill) >= P_EXPERT && u.uen > 0){
if (!getdir((char *)0) || u.dz)
return TRUE;
return MOVE_ATTACKED;
/* attack counterclockwise, hitting first direction once (and then throw) */
for (j = 8; j > 0; j--){
if (u.ustuck && u.uswallow)
@ -17043,10 +17027,10 @@ android_combo()
flags.botl = 1;
youmonst.movement -= 3;
}
return TRUE;
return MOVE_ATTACKED;
}
/* This should never be reached */
return FALSE;
return MOVE_CANCELLED;
}

View file

@ -254,7 +254,7 @@ struct obj * wep; /* uwep for attack(), null for kick_monster() */
/* Prevent accidental donation prompt. */
pline("%s mutters a prayer.", Monnam(mdef));
}
else if (!dochat(FALSE, u.dx, u.dy, 0)) {
else if (dochat(FALSE, u.dx, u.dy, 0) & (MOVE_CANCELLED|MOVE_INSTANT)) {
flags.move |= MOVE_INSTANT;
}
return ATTACKCHECK_NONE;