Buff Grimtooth with poison

Grimtooth is now permanently poisoned, protects the wielder from
poison, and can be invoked to throw poison.

Permapoison code comes from xNetHack by copperwater <aosdict@gmail.com>.
This commit is contained in:
Pasi Kallinen
2025-04-12 19:23:20 +03:00
parent 48d1b8617e
commit 8f7258dc35
10 changed files with 96 additions and 27 deletions

View File

@@ -67,6 +67,7 @@ enum invoke_prop_types {
ENLIGHTENING,
CREATE_AMMO,
BANISH,
FLING_POISON,
BLINDING_RAY
};

View File

@@ -43,6 +43,7 @@ static const char *const artifact_names[] = {
#define FIRE(a,b) {0,AD_FIRE,a,b}
#define ELEC(a,b) {0,AD_ELEC,a,b} /* electrical shock */
#define STUN(a,b) {0,AD_STUN,a,b} /* magical attack */
#define POIS(a,b) {0,AD_DRST,a,b} /* poison */
/* clang-format on */
static NEARDATA struct artifact artilist[] = {
@@ -120,9 +121,9 @@ static NEARDATA struct artifact artilist[] = {
* (handled as special case in spec_dbon()).
*/
A("Grimtooth", ORCISH_DAGGER, (SPFX_RESTR | SPFX_WARN | SPFX_DFLAG2),
0, M2_ELF, PHYS(2, 6), NO_DFNS,
NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ORC,
0, 5, 300L, CLR_RED, GRIMTOOTH),
0, M2_ELF, PHYS(2, 6), POIS(0,0),
NO_CARY, FLING_POISON, A_CHAOTIC, NON_PM, PM_ORC,
0, 5, 1200L, CLR_RED, GRIMTOOTH),
/*
* Orcrist and Sting have same alignment as elves.
*

View File

@@ -183,6 +183,7 @@ extern void mkot_trap_warn(void);
extern boolean is_magic_key(struct monst *, struct obj *);
extern struct obj *has_magic_key(struct monst *);
extern boolean is_art(struct obj *, int);
extern boolean permapoisoned(struct obj *);
/* ### attrib.c ### */

View File

@@ -254,10 +254,11 @@ struct obj {
(otmp->oclass == WEAPON_CLASS \
&& objects[otmp->otyp].oc_skill >= -P_SHURIKEN \
&& objects[otmp->otyp].oc_skill <= -P_BOW)
#define is_poisonable(otmp) \
(otmp->oclass == WEAPON_CLASS \
&& objects[otmp->otyp].oc_skill >= -P_SHURIKEN \
&& objects[otmp->otyp].oc_skill <= -P_BOW)
#define is_poisonable(otmp) \
((otmp->oclass == WEAPON_CLASS \
&& objects[otmp->otyp].oc_skill >= -P_SHURIKEN \
&& objects[otmp->otyp].oc_skill <= -P_BOW) \
|| permapoisoned(otmp))
#define uslinging() (uwep && objects[uwep->otyp].oc_skill == P_SLING)
/* 'is_quest_artifact()' only applies to the current role's artifact */
#define any_quest_artifact(o) ((o)->oartifact >= ART_ORB_OF_DETECTION)