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

Merge pull request #1928 from NeroOneTrueKing/patch-adefir-zap

Add missing damage handling for E-elemental zaps
This commit is contained in:
Chris-plus-alphanumericgibberish 2022-05-14 12:48:02 -04:00 committed by GitHub
commit 6fc5a4663f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4160,12 +4160,18 @@ struct zapdata * zapdata;
return xdamagey(magr, mdef, &attk, dmg);
case AD_FIRE:
case AD_EFIR:
/* check resist / weakness */
if (Fire_res(mdef)) {
doshieldeff = TRUE;
if (youdef)
addmsg("You don't feel hot!");
dmg = 0;
if (zapdata->adtyp == AD_EFIR) {
dmg *= 0.5;
}
else {
doshieldeff = TRUE;
if (youdef)
addmsg("You don't feel hot!");
dmg = 0;
}
}
else if (Cold_res(mdef)) {
dmg *= 1.5;
@ -4188,12 +4194,18 @@ struct zapdata * zapdata;
return xdamagey(magr, mdef, &attk, dmg);
case AD_COLD:
case AD_ECLD:
/* check resist / weakness */
if (Cold_res(mdef)) {
doshieldeff = TRUE;
if (youdef)
addmsg("You don't feel cold!");
dmg = 0;
if (zapdata->adtyp == AD_ECLD) {
dmg *= 0.5;
}
else {
doshieldeff = TRUE;
if (youdef)
addmsg("You don't feel cold!");
dmg = 0;
}
}
else if (Fire_res(mdef)) {
dmg *= 1.5;
@ -4212,12 +4224,18 @@ struct zapdata * zapdata;
return xdamagey(magr, mdef, &attk, dmg);
case AD_ELEC:
case AD_EELC:
/* check resist */
if (Shock_res(mdef)) {
doshieldeff = TRUE;
if (youdef)
addmsg("You aren't shocked!");
dmg = 0;
if (zapdata->adtyp == AD_EELC) {
dmg *= 0.5;
}
else {
doshieldeff = TRUE;
if (youdef)
addmsg("You aren't shocked!");
dmg = 0;
}
}
domsg();
golemeffects(mdef, AD_ELEC, svddmg);
@ -4229,12 +4247,18 @@ struct zapdata * zapdata;
return xdamagey(magr, mdef, &attk, dmg);
case AD_ACID:
case AD_EACD:
/* check resist */
if (Acid_res(mdef)) {
doshieldeff = TRUE;
if (youdef)
addmsg("You seem unaffected.");
dmg = 0;
if (zapdata->adtyp == AD_EACD) {
dmg *= 0.5;
}
else {
doshieldeff = TRUE;
if (youdef)
addmsg("You seem unaffected.");
dmg = 0;
}
}
/* extra effects vs player */
if (youdef && dmg > 0) {