sunsword vs gremlin

The original report complained that gremlins seemed impervious to
Sunsword's light yet a flash from a camera caused them to cry out in pain
despite "The long sword named Sunsword begins to shine brilliantly!"

This commit does two things:
1. A dmg bonus is applied against gremlins using a lit Sunsword.
2. Gremlins will generally avoid the light emitted by Sunsword.
There's a few minor flavor bits thrown in also.

It is understood that this effectively makes Sunsword provide
"gremlin-proofing", but the gremlin myth and Sunsword's characteristic
feature pretty much demand it.

bug 42
This commit is contained in:
nhmall
2018-09-22 14:08:28 -04:00
parent 6a86cafa90
commit bbb81700f5
7 changed files with 65 additions and 4 deletions

View File

@@ -658,6 +658,7 @@ int dieroll;
boolean ispoisoned = FALSE, needpoismsg = FALSE, poiskilled = FALSE,
unpoisonmsg = FALSE;
boolean silvermsg = FALSE, silverobj = FALSE;
boolean lightobj = FALSE;
boolean valid_weapon_attack = FALSE;
boolean unarmed = !uwep && !uarm && !uarms;
boolean hand_to_hand = (thrown == HMON_MELEE
@@ -699,7 +700,10 @@ int dieroll;
}
}
} else {
Strcpy(saved_oname, cxname(obj));
if (!(artifact_light(obj) && obj->lamplit))
Strcpy(saved_oname, cxname(obj));
else
Strcpy(saved_oname, bare_artifactname(obj));
if (obj->oclass == WEAPON_CLASS || is_weptool(obj)
|| obj->oclass == GEM_CLASS) {
/* is it not a melee weapon? */
@@ -803,6 +807,8 @@ int dieroll;
silvermsg = TRUE;
silverobj = TRUE;
}
if (artifact_light(obj) && obj->lamplit && mon_hates_light(mon))
lightobj = TRUE;
if (u.usteed && !thrown && tmp > 0
&& weapon_type(obj) == P_LANCE && mon != u.ustuck) {
jousting = joust(mon, obj);
@@ -1251,6 +1257,29 @@ int dieroll;
whom = strcat(s_suffix(whom), " flesh");
pline(fmt, whom);
}
if (lightobj) {
const char *fmt;
char *whom = mon_nam(mon);
char emitlightobjbuf[BUFSZ];
if (canspotmon(mon)) {
if (saved_oname[0]) {
Sprintf(emitlightobjbuf,
"%s radiance penetrates deep into",
s_suffix(saved_oname));
Strcat(emitlightobjbuf, " %s!");
fmt = emitlightobjbuf;
} else
fmt = "The light sears %s!";
} else {
*whom = highc(*whom); /* "it" -> "It" */
fmt = "%s is seared!";
}
/* note: s_suffix returns a modifiable buffer */
if (!noncorporeal(mdat) && !amorphous(mdat))
whom = strcat(s_suffix(whom), " flesh");
pline(fmt, whom);
}
/* if a "no longer poisoned" message is coming, it will be last;
obj->opoisoned was cleared above and any message referring to
"poisoned <obj>" has now been given; we want just "<obj>" for