Sunsword can be invoked to create a blinding ray

This commit is contained in:
Pasi Kallinen
2024-03-31 19:43:33 +03:00
parent 5ee813091a
commit c71e8ec8d4
6 changed files with 26 additions and 14 deletions

View File

@@ -1388,6 +1388,7 @@ if hero shattered an unseen monster's weapon, the [also unseen] weapon was
described in the feedback
don't self-genocide if a monk picks "master-lich" or "masterlich" as target
(was matching "Master" rank)
Sunsword can be invoked to create a blinding ray
Fixes to 3.7.0-x General Problems Exposed Via git Repository

View File

@@ -64,7 +64,8 @@ enum invoke_prop_types {
CREATE_PORTAL,
ENLIGHTENING,
CREATE_AMMO,
BANISH
BANISH,
BLINDING_RAY
};
/* clang-format on */

View File

@@ -179,8 +179,8 @@ static NEARDATA struct artifact artilist[] = {
/* Sunsword emits light when wielded (handled in the core rather than
via artifact fields), but that light has no particular color */
A("Sunsword", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_UNDEAD,
PHYS(5, 0), DFNS(AD_BLND), NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 1500L,
NO_COLOR, SUNSWORD),
PHYS(5, 0), DFNS(AD_BLND), NO_CARY, BLINDING_RAY, A_LAWFUL, NON_PM,
NON_PM, 1500L, NO_COLOR, SUNSWORD),
/*
* The artifacts for the quest dungeon, all self-willed.

View File

@@ -103,6 +103,7 @@ extern long timet_delta(time_t, time_t);
/* ### apply.c ### */
extern void do_blinding_ray(struct obj *) NONNULLPTRS;
extern int doapply(void);
extern int dorub(void);
extern int dojump(void);

View File

@@ -54,11 +54,24 @@ staticfn boolean find_poleable_mon(coord *, int, int);
static const char
no_elbow_room[] = "don't have enough elbow-room to maneuver.";
void
do_blinding_ray(struct obj *obj)
{
struct monst *mtmp = bhit(u.dx, u.dy, COLNO, FLASHED_LIGHT,
(int (*) (MONST_P, OBJ_P)) 0,
(int (*) (OBJ_P, OBJ_P)) 0, &obj);
obj->ox = u.ux, obj->oy = u.uy; /* flash_hits_mon() wants this */
if (mtmp)
(void) flash_hits_mon(mtmp, obj);
/* normally bhit() would do this but for FLASHED_LIGHT we want it
to be deferred until after flash_hits_mon() */
transient_light_cleanup();
}
staticfn int
use_camera(struct obj *obj)
{
struct monst *mtmp;
if (Underwater) {
pline("Using your camera underwater would void the warranty.");
return ECMD_OK;
@@ -83,15 +96,7 @@ use_camera(struct obj *obj)
} else if (!u.dx && !u.dy) {
(void) zapyourself(obj, TRUE);
} else {
mtmp = bhit(u.dx, u.dy, COLNO, FLASHED_LIGHT,
(int (*) (MONST_P, OBJ_P)) 0,
(int (*) (OBJ_P, OBJ_P)) 0, &obj);
obj->ox = u.ux, obj->oy = u.uy; /* flash_hits_mon() wants this */
if (mtmp)
(void) flash_hits_mon(mtmp, obj);
/* normally bhit() would do this but for FLASHED_LIGHT we want it
to be deferred until after flash_hits_mon() */
transient_light_cleanup();
do_blinding_ray(obj);
}
return ECMD_TIME;
}

View File

@@ -1916,6 +1916,10 @@ arti_invoke(struct obj *obj)
}
break;
}
case BLINDING_RAY:
if (getdir((char *) 0))
do_blinding_ray(obj);
break;
}
} else {
long eprop = (u.uprops[oart->inv_prop].extrinsic ^= W_ARTI),