- [+] some rings are now rare/very rare
- [+] getting a lot of individual non-stacked blood stains. - [+] penalty to slip checks when sprinting. - [+] protetcion form good/evil - use saving throw for tougher monsters - [-] redo god piety - [+] piety levels confer abilities/bonuses - [-] hecta - [+] pls - resist necro - [+] thr - stench - [ ] ecs - finger of death OR necrobeam every x turns. - [ ] fod: kill low hit die instantly. - [-] amberon - [+] pls - glow - [ ] thrilled = poly immune, - [+] t = also undead dam boost - [+] ecs = prot evil - [-] glorana - [+] p = stam boost - [ ] t = auto bless weapons / arm - [+] e = regenhp - [-] ekrub - [+] p = plantsfriendly - [+] t = chance to autoentangle on hit (plev*10) - [+] t = disease immune - [ ] e = ??? - [+] klikirak - [+] p = res fire - [+] t = immune fire - [+] e = burning body - [-] yumi - [+] p = enhance search 10 - [+] t = detect bless/curse.. - [+] t = detect life - [ ] e = save life - [+] lumara - [+] p = boost mag 1. spell on levelup. - [+] t = boost mag 2. - [+] e = boost mag 3. regen mp. - [+] bjorn - [+] p = resist fear - [+] p = stam boost too - [+] t = dam boost, acc boost - [+] e = knockback - [ ] felix - [ ] p = enhance stealth ? - [ ] t = enhance search 20 - [ ] e = ??? - [ ] move gift effects........ - [+] remove gifts? - [ ] TEST!!
This commit is contained in:
parent
48a3533aef
commit
49893b20e4
64
attack.c
64
attack.c
|
@ -14,6 +14,7 @@
|
|||
#include "move.h"
|
||||
#include "nexus.h"
|
||||
#include "objects.h"
|
||||
#include "spell.h"
|
||||
#include "text.h"
|
||||
|
||||
extern lifeform_t *player;
|
||||
|
@ -919,20 +920,36 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag)
|
|||
for (i = 0; i < nretflags; i++) {
|
||||
f = retflag[i];
|
||||
if (f->val[1] == getalignment(lf)) {
|
||||
if (isplayer(lf)) {
|
||||
msg("^wA %s force prevents you from attacking %s!",
|
||||
(f->val[1] == AL_GOOD) ? "demonic" : "holy",
|
||||
victimname);
|
||||
} else if (cansee(player, lf)) {
|
||||
msg("^wA %s force prevents %s from attacking %s!",
|
||||
(f->val[1] == AL_GOOD) ? "demonic" : "holy",
|
||||
attackername, victimname);
|
||||
int lftr,victr;
|
||||
int protected = B_FALSE;
|
||||
lftr = gettr(lf);
|
||||
victr = gettr(victim);
|
||||
if (lftr > victr) {
|
||||
protected = B_TRUE;
|
||||
} else {
|
||||
// same level = 50% chance of protection.
|
||||
// for each level that victim is higher, -10%.
|
||||
if (pctchance(50 - (victr - lftr))) protected = B_TRUE;
|
||||
}
|
||||
f->val[0]--;
|
||||
if (f->val[0] <= 0) {
|
||||
killflag(f);
|
||||
|
||||
if (protected) {
|
||||
if (isplayer(lf)) {
|
||||
msg("^wA %s force prevents you from attacking %s!",
|
||||
(f->val[1] == AL_GOOD) ? "demonic" : "holy",
|
||||
victimname);
|
||||
} else if (cansee(player, lf)) {
|
||||
msg("^wA %s force prevents %s from attacking %s!",
|
||||
(f->val[1] == AL_GOOD) ? "demonic" : "holy",
|
||||
attackername, victimname);
|
||||
}
|
||||
if (f->val[0] != PERMENANT) {
|
||||
f->val[0]--;
|
||||
if (f->val[0] <= 0) {
|
||||
killflag(f);
|
||||
}
|
||||
}
|
||||
return B_FALSE;
|
||||
}
|
||||
return B_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1133,7 +1150,7 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag)
|
|||
enum SKILLLEVEL slev;
|
||||
float loreadd = 0;
|
||||
// blessed vs undead
|
||||
adjustdamforblessings(&(dam[0]), victim, wep->blessed);
|
||||
adjustdamforblessings(lf, &(dam[0]), victim, wep->blessed);
|
||||
|
||||
// modify for weapon skill, strength etc
|
||||
applylfdammod(&dam[0], lf, wep);
|
||||
|
@ -2538,22 +2555,27 @@ int getextradamlf(lifeform_t *lf, int *dam, enum DAMTYPE *damtype, int *ndam, in
|
|||
int *damwhere;
|
||||
int *damtypewhere;
|
||||
int doinc = B_FALSE;
|
||||
int amtextra = 0;
|
||||
|
||||
f = retflag[i];
|
||||
if (f->val[2] == NA) {
|
||||
amtextra = real_roll(f->text, wantmax); // addition
|
||||
} else {
|
||||
amtextra = f->val[2];
|
||||
}
|
||||
if ((f->val[0] == NA) || (f->val[0] == *damtype)) {
|
||||
// addition to the first one
|
||||
damwhere = dam;
|
||||
damtypewhere = damtype;
|
||||
*(damwhere) += real_roll(f->text, wantmax); // addition
|
||||
*(damwhere) += amtextra; // addition
|
||||
} else {
|
||||
// add a new damtype
|
||||
damwhere = (dam + *ndam);
|
||||
damtypewhere = (damtype + *ndam);
|
||||
doinc = B_TRUE;
|
||||
*(damwhere) = real_roll(f->text, wantmax); // set
|
||||
*(damwhere) = amtextra; // set
|
||||
*(damtypewhere) = f->val[0];
|
||||
}
|
||||
|
||||
|
||||
if ((f->lifetime == FROMOBEQUIP) ||
|
||||
(f->lifetime == FROMOBHOLD) ||
|
||||
|
@ -3107,10 +3129,16 @@ void wepeffects(flagpile_t *fp, cell_t *where, flag_t *damflag, int dam, int isu
|
|||
}
|
||||
}
|
||||
|
||||
getflags(fp, retflag, &nretflags, F_FLAMESTRIKE, F_HEAVYBLOW, F_HITCONFER, F_RACESLAY, F_REVENGE, F_RUSTED, F_NONE);
|
||||
getflags(fp, retflag, &nretflags, F_AUTOTANGLE, F_FLAMESTRIKE, F_HEAVYBLOW, F_HITCONFER, F_RACESLAY, F_REVENGE, F_RUSTED, F_NONE);
|
||||
for (i = 0; i < nretflags; i++) {
|
||||
f = retflag[i];
|
||||
if (f->id == F_FLAMESTRIKE) {
|
||||
if (f->id == F_AUTOTANGLE) {
|
||||
if (pctchance(f->val[0]) && !hasob(where->obpile, OT_VINE)) {
|
||||
dospelleffects(owner, OT_S_ENTANGLE, f->val[1], victim, NULL, where, B_UNCURSED,
|
||||
NULL, B_FALSE, NULL);
|
||||
f->known = B_KNOWN;
|
||||
}
|
||||
} else if (f->id == F_FLAMESTRIKE) {
|
||||
if (!hasob(where->obpile, OT_FIRESMALL)) {
|
||||
// ignite!
|
||||
addobfast(where->obpile, OT_FIRESMALL);
|
||||
|
|
119
data.c
119
data.c
|
@ -7992,10 +7992,6 @@ void initobjects(void) {
|
|||
|
||||
|
||||
// rings - uncommon
|
||||
addot(OT_RING_EDUCATION, "ring of education", "Boosts earned XP and Skill points.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_LEARNBOOST, 35, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 300, NA, NA, NULL);
|
||||
addot(OT_RING_ENDURANCE, "ring of endurance", "Boosts stamina regeneration.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_STAMREGEN, NA, NA, "0.5");
|
||||
|
@ -8059,11 +8055,6 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_ENCHANTABLE, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_IDWHENUSED, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 350, NA, NA, NULL);
|
||||
addot(OT_RING_INVIS, "ring of invisibility", "Renders the wearer invisible - but drains the wearer's health at the same time.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_INVISIBLE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_HPDRAIN, 1, DT_DIRECT, "life force draining");
|
||||
addflag(lastot->flags, F_VALUE, 400, NA, NA, NULL);
|
||||
addot(OT_RING_INVULN, "ring of invulnerability", "Grants the caster complete immunity to physical harm.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_INVULNERABLE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 450, NA, NA, NULL);
|
||||
|
@ -8071,27 +8062,10 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_MPREGEN, 1, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 250, NA, NA, NULL);
|
||||
addot(OT_RING_CONTROL, "ring of control", "Allows the wearer control over teleportation and polymorphic effects.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_CONTROL, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 350, NA, NA, NULL);
|
||||
addot(OT_RING_REGENERATION, "ring of regeneration", "Slowly regenerates the wearer's health, even when not resting.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_REGENERATES, 1, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 350, NA, NA, NULL);
|
||||
addot(OT_RING_RESISTMAG, "ring of magic resistance", "Confers a minor level of magical immunity to the wearer.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_RESISTMAG, 33, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 350, NA, NA, NULL);
|
||||
addot(OT_RING_MEDITATION, "ring of meditation", "Allows the wearer to rest by entering a state of meditation.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_MEDITATES, B_TRUE, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 250, NA, NA, NULL);
|
||||
addot(OT_RING_MIRACLES, "ring of miracles", "Grants a limited number of miracles to the wearer.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_CHARGES, 1, 3, NA, NULL); // always starts with just 1 charge
|
||||
addflag(lastot->flags, F_VALUE, 400, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
|
||||
addot(OT_RING_SPELLBOOST, "ring of arcane power", "Increases the power of the wearer's spells.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_VALUE, 250, NA, NA, NULL);
|
||||
|
@ -8107,16 +8081,50 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_DETECTLIFE, 5, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 300, NA, NA, NULL);
|
||||
addot(OT_RING_REFLECTION, "ring of missile turning", "Bounces any projectiles which hit the wearer back to their source.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addot(OT_RING_WATERBREATHING, "ring of water breathing", "Allows the wearer to breath normally while underwater.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_BREATHWATER, B_TRUE, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 300, NA, NA, NULL);
|
||||
|
||||
// rings - rare
|
||||
addot(OT_RING_REFLECTION, "ring of missile turning", "Bounces any projectiles which hit the wearer back to their source.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_RARE, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_REFLECTION, B_TRUE, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 350, NA, NA, NULL);
|
||||
addot(OT_RING_INVIS, "ring of invisibility", "Renders the wearer invisible - but drains the wearer's health at the same time.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_RARE, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_INVISIBLE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_HPDRAIN, 1, DT_DIRECT, "life force draining");
|
||||
addflag(lastot->flags, F_VALUE, 400, NA, NA, NULL);
|
||||
addot(OT_RING_CONTROL, "ring of control", "Allows the wearer control over teleportation and polymorphic effects.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_RARE, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_CONTROL, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 350, NA, NA, NULL);
|
||||
addot(OT_RING_STENCH, "ring of stench", "Causes the wearer to emit a foul stench.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_RARE, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_STENCH, 2, 1, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 300, NA, NA, NULL);
|
||||
addot(OT_RING_RESISTMAG, "ring of magic resistance", "Confers a minor level of magical immunity to the wearer.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_RARE, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_RESISTMAG, 33, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 350, NA, NA, NULL);
|
||||
addot(OT_RING_EDUCATION, "ring of education", "Boosts earned XP and Skill points.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_RARE, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_LEARNBOOST, 35, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 300, NA, NA, NULL);
|
||||
|
||||
// rings - very rare
|
||||
addot(OT_RING_REGENERATION, "ring of regeneration", "Slowly regenerates the wearer's health, even when not resting.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_VERYRARE, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_REGENERATES, 1, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 350, NA, NA, NULL);
|
||||
addot(OT_RING_MIRACLES, "ring of miracles", "Grants a limited number of miracles to the wearer.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_VERYRARE, "");
|
||||
addflag(lastot->flags, F_CHARGES, 1, 3, NA, NULL); // always starts with just 1 charge
|
||||
addflag(lastot->flags, F_VALUE, 400, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
|
||||
addot(OT_RING_UNHOLINESS, "ring of unholiness", "An evil ring which renders its wearer effectively undead.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_VERYRARE, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_UNDEAD, B_TRUE, NA, NULL);
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_DISEASEIMMUNE, B_TRUE, NA, NULL);
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_DTIMMUNE, DT_COLD, NA, NULL);
|
||||
|
@ -8132,11 +8140,6 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_VALUE, 300, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_STARTBLESSED, B_CURSED, NA, NA, NULL);
|
||||
|
||||
addot(OT_RING_WATERBREATHING, "ring of water breathing", "Allows the wearer to breath normally while underwater.", MT_METAL, 0.1, OC_RING, SZ_MINI);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_BREATHWATER, B_TRUE, NA, NULL);
|
||||
addflag(lastot->flags, F_VALUE, 300, NA, NA, NULL);
|
||||
|
||||
// unarmed weapons - note these damage/accuracys can be
|
||||
// overridded with the lifeform flag F_HASATTACK
|
||||
//
|
||||
|
@ -9657,6 +9660,7 @@ void initrace(void) {
|
|||
objecttype_t *ot;
|
||||
skill_t *sk;
|
||||
int i;
|
||||
char buf[BUFLEN];
|
||||
|
||||
// behaviours
|
||||
addbehaviour(BH_INSANE, "insane");
|
||||
|
@ -10809,6 +10813,11 @@ void initrace(void) {
|
|||
|
||||
addflag(lastrace->flags, F_CANCAST, OT_S_WISHLIMITED, NA, NA, "pw:10;");
|
||||
addflag(lastrace->flags, F_CANCAST, OT_S_EXORCISE, NA, NA, "pw:50;");
|
||||
// granted bonuses
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_FLAG, F_PRODUCESLIGHT, "5,NA,NA");
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_FLAG, F_HOLYAURA, "1,NA,NA");
|
||||
sprintf(buf, "%d,%d,NA",PERMENANT, AL_EVIL);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_ECSTATIC, GB_FLAG, F_PROTALIGN, buf);
|
||||
// likes/dislikes
|
||||
addflag(lastrace->flags, F_GODPOISON, B_FALSE, 100, NA, NULL);
|
||||
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "destroying the undead or demons");
|
||||
|
@ -10886,6 +10895,13 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_SACRIFICEOBWITHFLAG, F_BATTLESPOILS, NA, 3, "OB explode#S into a shower of blood!");
|
||||
addflag(lastrace->flags, F_SACRIFICEOB, OT_SPELLBOOK, NA, 10, "OB explode#S into a shower of blood!");
|
||||
addflag(lastrace->flags, F_SACRIFICEOB, OT_GRIMOIRE, NA, 10, "OB explode#S into a shower of blood!");
|
||||
// god bonuses
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_FLAG, F_FEARLESS, "-1,NA,NA");
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_FLAG, F_STAMBOOST, "5,NA,NA");
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_FLAG, F_ACCURACYMOD, "15,NA,NA");
|
||||
sprintf(buf, "%d,%d,3", DT_DIRECT, B_FALSE);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_FLAG, F_EXTRADAM, buf);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_ECSTATIC, GB_FLAG, F_HEAVYBLOW, "1,0,0");
|
||||
|
||||
addflag(lastrace->flags, F_GODBATTLE, NA, NA, NA, "restoring stamina");
|
||||
addflag(lastrace->flags, F_GODBATTLE, NA, NA, NA, "enraging you");
|
||||
|
@ -10965,6 +10981,11 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "providing ammo");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "mending armour");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "blessing armour");
|
||||
// god bonus
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_FLAG, F_PLANTFRIEND, "-1,NA,NA");
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_FLAG, F_AUTOTANGLE, "10,5,NA");
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_FLAG, F_DISEASEIMMUNE, "1,NA,NA");
|
||||
|
||||
|
||||
|
||||
addrace(R_GODTHIEVES, "Felix", 300, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD, "Felix is the god of Thieves, Revenge and Greed. He generally appears as an overweight glutton carrying his contraband loot around in huge sacks. Despite this, he is amazingly agile and is said to be able to steal one's soul right out of their body.");
|
||||
|
@ -11079,6 +11100,10 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "healing you");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "restoring your mana");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "creating holy water");
|
||||
// god bonuses
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_FLAG, F_STAMBOOST, "3");
|
||||
// TODO: t = auto bless weapon
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_ECSTATIC, GB_FLAG, F_REGENERATES, "1,NA,NA");
|
||||
|
||||
addrace(R_GODDEATH, "Hecta", 100, '@', C_BOLDMAGENTA, MT_BONE, RC_GOD, "The skeletal god of Death is garbed in a cloak made of pure shadow. and weilds an enormous scythe.");
|
||||
setbodytype(lastrace, BT_HUMANOID);
|
||||
|
@ -11126,6 +11151,11 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "magical healing");
|
||||
addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "bestowing blessings");
|
||||
addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "casting holy spells");
|
||||
// granted bonuses
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_DTRESIST, DT_NECROTIC, NULL);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_FLAG, F_STENCH, "1,2,0");
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_DTIMMUNE, DT_NECROTIC, NULL);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_ECSTATIC, GB_CANWILL, OT_S_DRAINLIFE, "10,NA,NA");
|
||||
// sacrifices
|
||||
addflag(lastrace->flags, F_SACRIFICEOB, OT_CORPSE, NA, 2, "Bony claws rise up and drag OB underground.");
|
||||
addflag(lastrace->flags, F_GODBATTLE, NA, NA, NA, "granting heavenly armour");
|
||||
|
@ -11176,6 +11206,10 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_SACRIFICEOBWITHFLAG, F_FLAMMABLE, NA, 3, "OB IS consumed in a burst of white-hot fire!");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "restoring frozen weapons");
|
||||
addflag(lastrace->flags, F_GODBATTLE, NA, NA, NA, "setting nearby objects on fire");
|
||||
// granted bonuses
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_DTRESIST, DT_FIRE, NULL);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_DTIMMUNE, DT_FIRE, NULL);
|
||||
// TODO: e = burning body
|
||||
|
||||
addrace(R_GODMAGIC, "Lumara", 55, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD, "Lumara is the goddess of magic. She appears as a slender elderly woman, her expression wise with age.");
|
||||
setbodytype(lastrace, BT_HUMANOID);
|
||||
|
@ -11227,7 +11261,14 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "uncursing items");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "identifying items");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "increasing your maximum mana");
|
||||
|
||||
// granted bonuses
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_MAGICBOOST, 1, NULL);
|
||||
// p = also pick a spell on levelup.
|
||||
sprintf(buf, "101,%d,NA", SS_NONE);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_FLAG, F_LEVSPELLSCHOOL, buf);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_MAGICBOOST, 1, NULL);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_ECSTATIC, GB_MAGICBOOST, 1, NULL);
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_ECSTATIC, GB_FLAG, F_MPREGEN, "1,0,0");
|
||||
|
||||
addrace(R_GODMERCY, "Yumi", 300, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD, "Yumi is the goddess of Mercy and Forgiveness. She has a calm, serene face and wears simple clothing.");
|
||||
setbodytype(lastrace, BT_HUMANOID);
|
||||
|
@ -11280,6 +11321,11 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "curing poison");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "sating hunger");
|
||||
addflag(lastrace->flags, F_GODNOBATTLE, NA, NA, NA, "uncursing equipped items");
|
||||
// god bonuses
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_PLEASED, GB_FLAG, F_ENHANCESEARCH, "10,NA,NA");
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_FLAG, F_DETECTAURAS, "1,NA,NA");
|
||||
addflag(lastrace->flags, F_GODBONUS, PL_DELIGHTED, GB_FLAG, F_DETECTLIFE, "5,0,NA");
|
||||
// TODO: e = save life ???
|
||||
|
||||
|
||||
// monsters
|
||||
|
@ -11795,6 +11841,7 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_NOINJURIES, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_DTIMMUNE, DT_WATER, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_DTIMMUNE, DT_LIGHT, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_AUTOTANGLE, 10, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_STR, AT_VHIGH, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LOW, NA, NULL);
|
||||
|
@ -11836,6 +11883,7 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_NOINJURIES, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_DTIMMUNE, DT_WATER, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_DTIMMUNE, DT_LIGHT, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_AUTOTANGLE, 20, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_STR, AT_VHIGH, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LOW, NA, NULL);
|
||||
|
@ -11877,6 +11925,7 @@ void initrace(void) {
|
|||
addflag(lastrace->flags, F_NOINJURIES, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_DTIMMUNE, DT_WATER, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_DTIMMUNE, DT_LIGHT, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_AUTOTANGLE, 30, NA, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_STR, AT_VHIGH, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL);
|
||||
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LOW, NA, NULL);
|
||||
|
|
BIN
data/hiscores.db
BIN
data/hiscores.db
Binary file not shown.
29
defs.h
29
defs.h
|
@ -356,6 +356,17 @@
|
|||
|
||||
#define MAXDIR_MAP 15
|
||||
|
||||
enum GODBONUS {
|
||||
GB_DTRESIST, // resist damtype 'arg'
|
||||
GB_DTIMMUNE, // immune to damtype 'arg'
|
||||
GB_CANWILL, // canwill spellid 'arg'
|
||||
// every targ[0] turns.
|
||||
GB_FLAG, // grant flag 'arg', v0/1/2='text x,x,x'
|
||||
GB_MAGICBOOST, // set magic boost to arg (special case: you CAN
|
||||
// have multiple flags from this.)
|
||||
GB_FIREBODY,
|
||||
};
|
||||
|
||||
enum TIMEPHASE {
|
||||
TP_SUNRISE, // 6am - 6:59
|
||||
TP_MORNING, // 7am - 9:59
|
||||
|
@ -510,6 +521,7 @@ enum SHOPACTION {
|
|||
#define FROMOBMOD (-7864)
|
||||
#define FROMSKILL (-7863)
|
||||
#define FROMGODGIFT (-7862)
|
||||
#define FROMGODPIETY (-7861)
|
||||
#define FROMEXTERNAL_LOW (-7999)
|
||||
#define LEVABILITYDONE (-8000)
|
||||
|
||||
|
@ -3177,6 +3189,7 @@ enum FLAG {
|
|||
// can pick what alignment they want to be.
|
||||
// text shows the choices ("g", "n" or "e")
|
||||
F_PIETY, // for god lifeforms - tracks player's piety with them
|
||||
F_AUTOTANGLE, // v0% chance to auto entangle on hit. spellpower=v1
|
||||
F_PLANTFRIEND, // for player druids - makes plants friendly.
|
||||
F_HOMEMAP, // which map did this lf get created on?
|
||||
F_TOOKACTION, // lf purposely took action in their last turn.
|
||||
|
@ -3275,6 +3288,7 @@ enum FLAG {
|
|||
F_WILLTHROW, // this lf will treat obid v0 as a thrown missile.
|
||||
F_CANLEARN, // lf is able to learn skill val0
|
||||
// v1 = max lev
|
||||
F_STAMBOOST, // lf gets v0 extra stamina
|
||||
F_STARTOB, // val0 = %chance of starting with it, text = ob name
|
||||
// val1,2 = min/max amounts. if NA, min=max=1.
|
||||
F_STARTOBDT, // val0 = %chance of starting with damtype val1
|
||||
|
@ -3526,6 +3540,9 @@ enum FLAG {
|
|||
F_GENDER, // v0 = G_MALE or G_FEMALE. default if G_NONE if this
|
||||
// flag isn't set.
|
||||
F_JOB, // val0 = player's job
|
||||
F_GODBONUS, // this god gives enum GODBONUS v1 at pietylev v0
|
||||
// v2 = arg to GB..
|
||||
// text = arg2
|
||||
F_GODOF, // text = what this lf is the god of. use capitals.
|
||||
F_GODLIKES, // text = something this god likes (ie. incs piety)
|
||||
F_GODDISLIKES, // text = something this god likes (ie. decs piety)
|
||||
|
@ -3639,7 +3656,7 @@ enum FLAG {
|
|||
F_TRUESTRIKE, // your attacks ALWAYS hit. turnsleft=v0
|
||||
F_HURRICANESTRIKE, // lf is performing a hurricane strike
|
||||
F_PROTALIGN, // attacks from lfs with aligh = v1 are repelled.
|
||||
// turnsleft=v0
|
||||
// turnsleft=v0 (can be PERMENANT)
|
||||
// INTRINSICS
|
||||
F_MAGICARMOUR,// armour is magically boosted. f->text is the description
|
||||
// ie 'magic armour', 'force field'
|
||||
|
@ -3709,8 +3726,10 @@ enum FLAG {
|
|||
F_ENHANCESEARCH, // gives v0 bonus on search checks.
|
||||
F_ENHANCESMELL, // can 'see' scents with v0 range.
|
||||
F_EXTRADAM, // FOR LIFEFORMS OR WEAPONS!
|
||||
// this lf does 'text' extra damage of damtype v0
|
||||
// when they hit
|
||||
// if V2 is not NA, inflict this much extra dam of
|
||||
// damtype v0.
|
||||
// if V2 _IS_ NA, then:
|
||||
// this lf does 'text' extra damage of damtype v0
|
||||
// if v1 is TRUE, also deal extra damage based on
|
||||
// the flagpile's F_BONUS flag.
|
||||
F_EXTRADAMWITHCHARGES, // if this objects has charges remaining,
|
||||
|
@ -3727,6 +3746,7 @@ enum FLAG {
|
|||
// v0 is multiplier.
|
||||
F_FASTMOVE, // modifier for move speed
|
||||
F_FASTACTMOVE, // modifier for action and move speed
|
||||
F_FEARLESS, // cannot be scared.
|
||||
F_INCUBATING, // will become poisoned when v1 drops to 0.
|
||||
// ie obfrom is being used as a timer.
|
||||
// v0 = poison thpe
|
||||
|
@ -4741,12 +4761,13 @@ typedef struct flag_s {
|
|||
|
||||
struct skill_s *skillfrom; // only used if ->lifetime is FROMSKILL.
|
||||
long obfrom; // for conferred flags, link to object->id. -1 if not conferred.
|
||||
// also used for godgifts, in which case it is thr race->id of
|
||||
// for FROMGODGIFT or FROMGODPIETY, this is the race->id of
|
||||
// the god who gifted you this flag.
|
||||
|
||||
//
|
||||
int known;
|
||||
int lifetime;
|
||||
int origlifetime;
|
||||
|
||||
struct flagpile_s *pile;
|
||||
struct flag_s *next, *prev;
|
||||
|
|
48
flag.c
48
flag.c
|
@ -205,6 +205,7 @@ flag_t *addflag_real(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3,
|
|||
// fill in props
|
||||
f->id = id;
|
||||
f->lifetime = lifetime;
|
||||
f->origlifetime = lifetime;
|
||||
f->known = known;
|
||||
f->obfrom = obfromid;
|
||||
|
||||
|
@ -503,6 +504,7 @@ int copyflag(flagpile_t *dst, flagpile_t *src, enum FLAG id) {
|
|||
f->lifetime, f->known, -1);
|
||||
newf->condition = f->condition;
|
||||
newf->chance = f->chance;
|
||||
newf->origlifetime = f->origlifetime;
|
||||
if (f->altval) {
|
||||
addaltval(newf, f->altval->id,
|
||||
f->altval->val[0],
|
||||
|
@ -530,6 +532,7 @@ void copyflags(flagpile_t *dst, flagpile_t *src, int lifetime) {
|
|||
newf = addflag_real(dst, f->id, f->val[0], f->val[1], f->val[2], f->text,
|
||||
(lifetime == NA) ? f->lifetime : lifetime, f->known, -1);
|
||||
newf->condition = f->condition;
|
||||
newf->origlifetime = f->origlifetime;
|
||||
newf->chance = f->chance;
|
||||
if (f->altval) {
|
||||
addaltval(newf, f->altval->id,
|
||||
|
@ -959,6 +962,33 @@ int killflagsofid(flagpile_t *fp, enum FLAG fid) {
|
|||
return donesomething;
|
||||
}
|
||||
|
||||
// returns # flags removed if we did something
|
||||
int killflagsofval(int count, flagpile_t *fp, enum FLAG fid, int v0, int v1, int v2, int lifetime, long obfrom) {
|
||||
int ndone = 0;
|
||||
int nretflags,i;
|
||||
flag_t *retflag[MAXCANDIDATES],*f;
|
||||
|
||||
getflags(fp, retflag, &nretflags, fid, F_NONE);
|
||||
for (i = 0; i < nretflags; i++) {
|
||||
int matched = B_TRUE;
|
||||
f = retflag[i];
|
||||
if (matched && (v0 != NA) && (f->val[0] != v0)) matched = B_FALSE;
|
||||
if (matched && (v1 != NA) && (f->val[1] != v1)) matched = B_FALSE;
|
||||
if (matched && (v2 != NA) && (f->val[2] != v2)) matched = B_FALSE;
|
||||
if (matched && (lifetime != NA) && (f->lifetime != lifetime)) matched = B_FALSE;
|
||||
if (matched && (obfrom != NA) && (f->obfrom != obfrom)) matched = B_FALSE;
|
||||
if (matched) {
|
||||
killflag(f);
|
||||
ndone++;
|
||||
if ((count != ALL) && (ndone >= count)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ndone;
|
||||
}
|
||||
|
||||
void killflag(flag_t *f) {
|
||||
flag_t *nextone, *lastone;
|
||||
flagpile_t *pile;
|
||||
|
@ -1546,20 +1576,18 @@ void revealflagob(lifeform_t *lf, flag_t *f) {
|
|||
}
|
||||
}
|
||||
|
||||
void sumflags(flagpile_t *fp, int id, int *val0, int *val1, int *val2) {
|
||||
flag_t *f;
|
||||
void sumflags(flagpile_t *fp, enum FLAG id, int *val0, int *val1, int *val2) {
|
||||
flag_t *retflag[MAXCANDIDATES];
|
||||
int nretflags = 0,i;
|
||||
if (val0) *val0 = 0;
|
||||
if (val1) *val1 = 0;
|
||||
if (val2) *val2 = 0;
|
||||
for (f = fp->first ; f ; f = f->next) {
|
||||
// gone past the requrested id's number - ie. it's not there.
|
||||
if (f->id > id) break;
|
||||
|
||||
if (f->id == id) {
|
||||
if (val0) *val0 = *val0 + f->val[0];
|
||||
if (val1) *val1 = *val1 + f->val[1];
|
||||
if (val2) *val2 = *val2 + f->val[2];
|
||||
}
|
||||
getflags(fp, retflag, &nretflags, id, F_NONE);
|
||||
for (i = 0; i < nretflags; i++) {
|
||||
if (val0) *val0 = *val0 + retflag[i]->val[0];
|
||||
if (val1) *val1 = *val1 + retflag[i]->val[1];
|
||||
if (val2) *val2 = *val2 + retflag[i]->val[2];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
3
flag.h
3
flag.h
|
@ -37,6 +37,7 @@ flag_t *hasflagvalknown(flagpile_t *fp, int id, int val1, int val2, int val3, /*
|
|||
flag_t *hasflagval_real(flagpile_t *fp, int id, int val1, int val2, int val3, /*@null@*/ char *text, int wantknown, int lifetimeexception);
|
||||
int istransitoryflag(flag_t *f);
|
||||
int killflagsofid(flagpile_t *fp, enum FLAG fid);
|
||||
int killflagsofval(int count, flagpile_t *fp, enum FLAG fid, int v0, int v1, int v2, int lifetime, long obfrom);
|
||||
void killflag(flag_t *f);
|
||||
void killflagpile(flagpile_t *fp);
|
||||
int killtransitoryflags(flagpile_t *fp, enum FLAG fid);
|
||||
|
@ -45,7 +46,7 @@ void makeflagknown(flagpile_t *fp);
|
|||
int modcounter(flagpile_t *fp, int amt);
|
||||
flag_t *modflag(flagpile_t *fp, enum FLAG fid, int val1, int val2, int val3, /*@null@*/ char *text);
|
||||
void revealflagob(lifeform_t *lf, flag_t *f);
|
||||
void sumflags(flagpile_t *fp, int id, int *val0, int *val1, int *val2);
|
||||
void sumflags(flagpile_t *fp, enum FLAG id, int *val0, int *val1, int *val2);
|
||||
void timeeffectsflag(flag_t *f, int howlong);
|
||||
void timeeffectsflags(flagpile_t *fp);
|
||||
void updatefpindex(flagpile_t *fp);
|
||||
|
|
209
god.c
209
god.c
|
@ -38,7 +38,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
|
|||
lifeform_t *god;
|
||||
int piety;
|
||||
char buf[BUFLEN];
|
||||
enum PIETYLEV plev;
|
||||
enum PIETYLEV plev,oldplev;
|
||||
int dosay = B_FALSE;
|
||||
|
||||
// don't please/anger gods while enraged.
|
||||
|
@ -53,6 +53,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
|
|||
limit(&amt, 1, NA);
|
||||
}
|
||||
|
||||
oldplev = getpietylev(rid, NULL, NULL);
|
||||
modpiety(rid, -amt);
|
||||
piety = getpiety(rid);
|
||||
plev = getpietylev(rid, NULL, NULL);
|
||||
|
@ -497,6 +498,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
|
|||
aiattack(god, player, PERMENANT);
|
||||
}
|
||||
}
|
||||
checkgodbonus(rid,plev, oldplev);
|
||||
}
|
||||
|
||||
// anger the god if you are worshippin them.
|
||||
|
@ -514,6 +516,30 @@ int angergodmaybe(enum RACE rid, int amt, enum GODANGERREASON why) {
|
|||
return B_FALSE;
|
||||
}
|
||||
|
||||
void checkgodbonus(enum RACE rid, enum PIETYLEV newlev, enum PIETYLEV oldlev) {
|
||||
flag_t *retflag[MAXCANDIDATES];
|
||||
int nretflags,i;
|
||||
enum PIETYLEV plev;
|
||||
lifeform_t *god;
|
||||
if (!godprayedto(rid)) return;
|
||||
if (newlev == oldlev) return;
|
||||
god = findgod(rid);
|
||||
plev = getpietylev(rid, NULL, NULL);
|
||||
getflags(god->flags, retflag, &nretflags, F_GODBONUS, F_NONE);
|
||||
for (i = 0; i < nretflags; i++) {
|
||||
if (newlev < oldlev) {
|
||||
if ((retflag[i]->val[0] > newlev) && (retflag[i]->val[0] <= oldlev)) {
|
||||
removegodbonus(rid, retflag[i]);
|
||||
}
|
||||
} else if (newlev > oldlev) {
|
||||
// piety increased
|
||||
if ((retflag[i]->val[0] <= newlev) && (retflag[i]->val[0] > oldlev)) {
|
||||
givegodbonus(rid, retflag[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dooffer(void) {
|
||||
object_t *o, *nexto;
|
||||
lifeform_t *god;
|
||||
|
@ -839,6 +865,156 @@ enum OBTYPE getrelatedgodstone(enum RACE rid) {
|
|||
return OT_NONE;
|
||||
}
|
||||
|
||||
void givegodbonus(enum RACE rid, flag_t *bf) {
|
||||
flag_t *f;
|
||||
int targ[3], arg = NA;
|
||||
enum PIETYLEV bonuslev;
|
||||
enum GODBONUS bonusid;
|
||||
|
||||
// god announcement.
|
||||
switch (rid) {
|
||||
case R_GODPURITY:
|
||||
godsay(rid, B_TRUE, "You have impressed me, mortal!");
|
||||
break;
|
||||
case R_GODTHIEVES:
|
||||
godsay(rid, B_TRUE, "Very impressive...");
|
||||
break;
|
||||
case R_GODDEATH:
|
||||
godsay(rid, B_TRUE, "Your killing is impressive...");
|
||||
break;
|
||||
case R_GODFIRE:
|
||||
godsay(rid, B_TRUE, "DESTROY!");
|
||||
break;
|
||||
case R_GODLIFE:
|
||||
godsay(rid, B_TRUE, "A good life has its rewards!");
|
||||
break;
|
||||
case R_GODMERCY:
|
||||
godsay(rid, B_TRUE, "Your devoutness is impressive.");
|
||||
break;
|
||||
case R_GODNATURE:
|
||||
godsay(rid, B_TRUE, "You are progressing in nature's path...");
|
||||
break;
|
||||
case R_GODBATTLE:
|
||||
godsay(rid, B_TRUE, "Onwards to victory!");
|
||||
break;
|
||||
case R_GODMAGIC:
|
||||
godsay(rid, B_TRUE, "One is on the right path!");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
more();
|
||||
|
||||
// parse regular rags
|
||||
parsegodbonusargs(bf, &bonuslev, &bonusid, &arg, targ);
|
||||
|
||||
// now do something...
|
||||
switch (bonusid) {
|
||||
case GB_DTIMMUNE:
|
||||
if (!lfhasflagval(player, F_DTIMMUNE, arg, NA, NA, NULL)) {
|
||||
f = addtempflag(player->flags, F_DTIMMUNE, arg, NA, NA, NULL, FROMGODPIETY);
|
||||
f->obfrom = rid;
|
||||
}
|
||||
break;
|
||||
case GB_DTRESIST:
|
||||
if (!lfhasflagval(player, F_DTRESIST, arg, NA, NA, NULL)) {
|
||||
f = addtempflag(player->flags, F_DTRESIST, arg, NA, NA, NULL, FROMGODPIETY);
|
||||
f->obfrom = rid;
|
||||
}
|
||||
break;
|
||||
case GB_FLAG:
|
||||
if (!lfhasflagval(player, arg, targ[0], targ[1], targ[2], NULL)) {
|
||||
f = addtempflag(player->flags, arg, targ[0], targ[1], targ[2], NULL, FROMGODPIETY);
|
||||
f->obfrom = rid;
|
||||
}
|
||||
break;
|
||||
case GB_CANWILL:
|
||||
if (!lfhasflagval(player, F_CANWILL, arg, NA, NA, NULL)) {
|
||||
f = addtempflag(player->flags, F_CANWILL, arg, targ[0], targ[0], NULL, FROMGODPIETY);
|
||||
f->obfrom = rid;
|
||||
}
|
||||
break;
|
||||
case GB_MAGICBOOST:
|
||||
f = addtempflag(player->flags, F_MAGICBOOST, arg, NA, NA, NULL, FROMGODPIETY);
|
||||
f->obfrom = rid;
|
||||
break;
|
||||
case GB_FIREBODY:
|
||||
if (player->material->id != MT_FIRE) {
|
||||
player->material = findmaterial(MT_FIRE);
|
||||
msg("^gYour body bursts into flames!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
void removegodbonus(enum RACE rid, flag_t *bf) {
|
||||
int targ[3], arg = NA;
|
||||
enum PIETYLEV bonuslev;
|
||||
enum GODBONUS bonusid;
|
||||
|
||||
// god announcement.
|
||||
switch (rid) {
|
||||
case R_GODPURITY:
|
||||
godsay(rid, B_TRUE, "I am not impressed, mortal.");
|
||||
break;
|
||||
case R_GODTHIEVES:
|
||||
godsay(rid, B_TRUE, "Disloyalty deserves punishment.");
|
||||
break;
|
||||
case R_GODDEATH:
|
||||
godsay(rid, B_TRUE, "Disobediant servants can easily be removed...");
|
||||
break;
|
||||
case R_GODFIRE:
|
||||
godsay(rid, B_TRUE, "WRONG!");
|
||||
break;
|
||||
case R_GODLIFE:
|
||||
godsay(rid, B_TRUE, "No, no, no...");
|
||||
break;
|
||||
case R_GODMERCY:
|
||||
godsay(rid, B_TRUE, "You disappoint me...");
|
||||
break;
|
||||
case R_GODNATURE:
|
||||
godsay(rid, B_TRUE, "Nature will not tolerate your transgressions.");
|
||||
break;
|
||||
case R_GODBATTLE:
|
||||
godsay(rid, B_TRUE, "You have earned yourself a demotion, soldier.");
|
||||
break;
|
||||
case R_GODMAGIC:
|
||||
godsay(rid, B_TRUE, "One is deviating from the path!");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
more();
|
||||
|
||||
// parse regular rags
|
||||
parsegodbonusargs(bf, &bonuslev, &bonusid, &arg, targ);
|
||||
|
||||
// now do something...
|
||||
switch (bonusid) {
|
||||
case GB_DTRESIST:
|
||||
killflagsofval(ALL, player->flags, F_DTRESIST, arg, NA, NA, FROMGODPIETY, rid);
|
||||
break;
|
||||
case GB_DTIMMUNE:
|
||||
killflagsofval(ALL, player->flags, F_DTIMMUNE, arg, NA, NA, FROMGODPIETY, rid);
|
||||
break;
|
||||
case GB_FLAG:
|
||||
killflagsofval(ALL, player->flags, arg, targ[0], targ[1], targ[2], FROMGODPIETY, rid);
|
||||
break;
|
||||
case GB_CANWILL:
|
||||
killflagsofval(ALL, player->flags, F_CANWILL, arg, NA, NA, FROMGODPIETY, rid);
|
||||
break;
|
||||
case GB_MAGICBOOST:
|
||||
// special case: just remove ONE of these.
|
||||
killflagsofval(1, player->flags, F_MAGICBOOST, arg, NA, NA, FROMGODPIETY, rid);
|
||||
break;
|
||||
case GB_FIREBODY:
|
||||
if (player->material->id == MT_FIRE) {
|
||||
// TODO: what if player is polymorphed?
|
||||
player->material = player->race->material;
|
||||
msg("Your body is no longer aflame.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
lifeform_t *godappears(enum RACE rid, cell_t *where) {
|
||||
lifeform_t *god;
|
||||
|
@ -937,7 +1113,6 @@ int godgiftmaybe(enum RACE rid, int fromtemple) {
|
|||
|
||||
killflagsofid(player->flags, F_ASLEEP);
|
||||
|
||||
|
||||
switch (god->race->id) {
|
||||
case R_GODPURITY:
|
||||
godsay(god->race->id, B_TRUE, "I bestow a gift upon you, mortal!");
|
||||
|
@ -1669,7 +1844,6 @@ void modpiety(enum RACE rid, int amt) {
|
|||
lifeform_t *god;
|
||||
flag_t *f;
|
||||
|
||||
|
||||
god = findgod(rid);
|
||||
if (godblocked(god->race->id)) return;
|
||||
|
||||
|
@ -1680,9 +1854,28 @@ void modpiety(enum RACE rid, int amt) {
|
|||
limit(&f->val[0], PIETY_MIN, PIETY_MAX);
|
||||
}
|
||||
|
||||
void parsegodbonusargs(flag_t *bf, enum PIETYLEV *bonuslev, enum GODBONUS *bonusid, int *arg, int *targ) {
|
||||
int i;
|
||||
char *p, buf[BUFLEN];
|
||||
*bonuslev = bf->val[0];
|
||||
*bonusid = bf->val[1];
|
||||
*arg = bf->val[2];
|
||||
// parse text args
|
||||
for (i = 0; i < 3; i++) targ[i] = NA;
|
||||
p = readuntil(buf, bf->text, ',');
|
||||
i = 0;
|
||||
while (p && (i < 3)) {
|
||||
if (streq(buf, "NA")) targ[i] = NA;
|
||||
else targ[i] = atoi(buf);
|
||||
i++;
|
||||
p = readuntil(buf, p, ',');
|
||||
}
|
||||
}
|
||||
|
||||
void pleasegod(enum RACE rid, int amt) {
|
||||
lifeform_t *lf;
|
||||
char lfname[BUFLEN];
|
||||
enum PIETYLEV oldplev,newplev;
|
||||
|
||||
// don't please/anger gods while enraged.
|
||||
if (lfhasflag(player, F_RAGE)) return;
|
||||
|
@ -1690,7 +1883,9 @@ void pleasegod(enum RACE rid, int amt) {
|
|||
lf = findgod(rid);
|
||||
real_getlfname(lf, lfname, NULL, B_NOSHOWALL, B_REALRACE);
|
||||
|
||||
oldplev = getpietylev(rid, NULL, NULL);
|
||||
modpiety(rid, amt);
|
||||
newplev = getpietylev(rid, NULL, NULL);
|
||||
|
||||
// announce
|
||||
if (hasflag(lf->flags, F_PRAYEDTO)) {
|
||||
|
@ -1734,8 +1929,10 @@ void pleasegod(enum RACE rid, int amt) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
godgiftmaybe(rid, B_FALSE);
|
||||
//godgiftmaybe(rid, B_FALSE);
|
||||
}
|
||||
//
|
||||
checkgodbonus(rid,newplev, oldplev);
|
||||
}
|
||||
|
||||
void pleasegodmaybe(enum RACE rid, int amt) {
|
||||
|
@ -2549,10 +2746,10 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
|
|||
}
|
||||
|
||||
|
||||
if (!godgiftmaybe(god->race->id, B_FALSE)) {
|
||||
// if (!godgiftmaybe(god->race->id, B_FALSE)) {
|
||||
// if you didn't get a gift, lower piety for this god
|
||||
modpiety(god->race->id, -PIETYPRAYLOSS);
|
||||
}
|
||||
// }
|
||||
|
||||
// lower piety for other related gods
|
||||
for (i = 0; i < ngodlfs; i++) {
|
||||
|
|
4
god.h
4
god.h
|
@ -2,6 +2,7 @@
|
|||
|
||||
void angergod(enum RACE rid, int amt, enum GODANGERREASON why);
|
||||
int angergodmaybe(enum RACE rid, int amt, enum GODANGERREASON why);
|
||||
void checkgodbonus(enum RACE rid, enum PIETYLEV newlev, enum PIETYLEV oldlev);
|
||||
void dooffer(void);
|
||||
lifeform_t *findgod(enum RACE rid);
|
||||
enum RACE getopposinggod(enum RACE rid);
|
||||
|
@ -13,6 +14,7 @@ int getprayedgods(lifeform_t **retgod, int *nretgods);
|
|||
lifeform_t *getrandomgod(void);
|
||||
lifeform_t *getrandomprayedgod(void);
|
||||
enum OBTYPE getrelatedgodstone(enum RACE rid);
|
||||
void givegodbonus(enum RACE rid, flag_t *bf);
|
||||
lifeform_t *godappears(enum RACE rid, cell_t *where);
|
||||
void god_usepoison_response(void);
|
||||
int godblocked(enum RACE rid);
|
||||
|
@ -22,8 +24,10 @@ int godprayedto(enum RACE rid);
|
|||
void godsay(enum RACE rid, int says, char *format, ...);
|
||||
void godstone_pickup_effects(lifeform_t *god, lifeform_t *opposegod, object_t *o);
|
||||
void modpiety(enum RACE rid, int amt);
|
||||
void parsegodbonusargs(flag_t *bf, enum PIETYLEV *bonuslev, enum GODBONUS *bonusid, int *arg, int *targ);
|
||||
void pleasegod(enum RACE rid, int amt);
|
||||
void pleasegodmaybe(enum RACE rid, int amt);
|
||||
int prayto(lifeform_t *lf, lifeform_t *god);
|
||||
void removegodbonus(enum RACE rid, flag_t *bf);
|
||||
void setpiety(enum RACE rid, int amt);
|
||||
int uncurse_one_equipped(lifeform_t *lf, char *text);
|
||||
|
|
81
io.c
81
io.c
|
@ -1497,6 +1497,15 @@ int announceflaggain(lifeform_t *lf, flag_t *f) {
|
|||
msg("^%c%s begin%s to turn to stone!",isplayer(lf) ? 'b' : 'n', lfname, isplayer(lf) ? "" : "s");
|
||||
donesomething = B_TRUE;
|
||||
break;
|
||||
case F_AUTOTANGLE:
|
||||
if (isplayer(lf)) {
|
||||
msg("^%cSmall tendrils sprout from your %s.",getlfcol(lf, CC_GOOD), getbodypartname(lf, BP_HANDS));
|
||||
} else {
|
||||
msg("^%cSmall tendrils sprout from %s%s %s.",getlfcol(lf, CC_GOOD),
|
||||
lfname, getpossessive(lfname), getbodypartname(lf, BP_HANDS));
|
||||
}
|
||||
donesomething = B_TRUE;
|
||||
break;
|
||||
case F_AWARENESS:
|
||||
if (isplayer(lf)) {
|
||||
msg("You can suddenly see out the back of your head!");
|
||||
|
@ -1808,6 +1817,10 @@ int announceflaggain(lifeform_t *lf, flag_t *f) {
|
|||
msg("%s %s",lfname, isplayer(lf) ? "feel accelerated!" : "looks accelerated!");
|
||||
donesomething = B_TRUE;
|
||||
break;
|
||||
case F_FEARLESS:
|
||||
msg("^%c%s %s fearless!", getlfcol(lf, CC_GOOD), lfname, isplayer(lf) ? "feel" : "looks");
|
||||
donesomething = B_TRUE;
|
||||
break;
|
||||
case F_FASTMETAB:
|
||||
if (isplayer(lf)) { // don't know if monsters get it
|
||||
msg("^bYou feel ravenous!");
|
||||
|
@ -2031,6 +2044,12 @@ int announceflaggain(lifeform_t *lf, flag_t *f) {
|
|||
msg("%s %s sprinting!",lfname, isplayer(lf) ? "start" : "starts");
|
||||
donesomething = B_TRUE;
|
||||
break;
|
||||
case F_STAMBOOST:
|
||||
if (isplayer(lf)) {
|
||||
msg("^gYour stamina feels boosted!");
|
||||
donesomething = B_TRUE;
|
||||
}
|
||||
break;
|
||||
case F_STENCH:
|
||||
msg("%s start%s emitting a foul odour!",lfname, isplayer(lf) ? "" : "s" );
|
||||
donesomething = B_TRUE;
|
||||
|
@ -2282,6 +2301,14 @@ int announceflagloss(lifeform_t *lf, flag_t *f) {
|
|||
msg("The fragments of stone around %s%s body drop%s away.",lfname, getpossessive(lfname), isplayer(lf) ? "" : "s");
|
||||
donesomething = B_TRUE;
|
||||
break;
|
||||
case F_AUTOTANGLE:
|
||||
if (isplayer(lf)) {
|
||||
msg("The tendrils vanish from your %s.",getlfcol(lf, CC_GOOD), getbodypartname(lf, BP_HANDS));
|
||||
} else {
|
||||
msg("Tendrils vanish from %s%s %s.",lfname, getpossessive(lfname), getbodypartname(lf, BP_HANDS));
|
||||
}
|
||||
donesomething = B_TRUE;
|
||||
break;
|
||||
case F_AWARENESS:
|
||||
if (isplayer(lf)) {
|
||||
msg("You can no longer see out the back of your head.");
|
||||
|
@ -2554,6 +2581,10 @@ int announceflagloss(lifeform_t *lf, flag_t *f) {
|
|||
donesomething = B_TRUE;
|
||||
}
|
||||
break;
|
||||
case F_FEARLESS:
|
||||
msg("%s no longer %s fearless.", lfname, isplayer(lf) ? "feel" : "looks");
|
||||
donesomething = B_TRUE;
|
||||
break;
|
||||
case F_FLYING:
|
||||
msg("%s %s flying.", lfname, isplayer(lf) ? "cease" : "stops");
|
||||
donesomething = B_TRUE;
|
||||
|
@ -2763,6 +2794,12 @@ int announceflagloss(lifeform_t *lf, flag_t *f) {
|
|||
donesomething = B_TRUE;
|
||||
}
|
||||
break;
|
||||
case F_STAMBOOST:
|
||||
if (isplayer(lf)) {
|
||||
msg("Your stamina no longer feels boosted.");
|
||||
donesomething = B_TRUE;
|
||||
}
|
||||
break;
|
||||
case F_STENCH:
|
||||
msg("%s no longer smell%s bad.",lfname, isplayer(lf) ? "" : "s" );
|
||||
donesomething = B_TRUE;
|
||||
|
@ -6197,7 +6234,11 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
|||
getflags(o->flags, retflag, &nretflags, F_EXTRADAM, F_NONE);
|
||||
for (i = 0 ; i < nretflags; i++) {
|
||||
f = retflag[i];
|
||||
sprintf(buf,"@It also inflicts %s extra %s damage.\n", f->text, getdamname(f->val[0]));
|
||||
if (f->val[2] == NA) {
|
||||
sprintf(buf,"@It also inflicts %s extra %s damage.\n", f->text, getdamname(f->val[0]));
|
||||
} else {
|
||||
sprintf(buf,"@It also inflicts %d extra %s damage.\n", f->val[2], getdamname(f->val[0]));
|
||||
}
|
||||
strncat(retbuf, buf, HUGEBUFLEN);
|
||||
}
|
||||
f = hasflag(o->flags, F_FROZEN);
|
||||
|
@ -6917,6 +6958,10 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
|||
sprintf(buf2, "%s will increase your mana pool by %d%%.\n", buf, f->val[0]);
|
||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||
break;
|
||||
case F_FEARLESS:
|
||||
sprintf(buf2, "%s will reder you fearless.\n", buf);
|
||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||
break;
|
||||
case F_FASTACT:
|
||||
sprintf(buf2, "%s will speed up your actions.\n", buf);
|
||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||
|
@ -7069,6 +7114,10 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
|||
sprintf(buf2, "%s prevents you from slipping over.\n", buf);
|
||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||
break;
|
||||
case F_STAMBOOST:
|
||||
sprintf(buf2, "%s boosts your stamina by %d.\n", buf, f->val[0]);
|
||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||
break;
|
||||
case F_STENCH:
|
||||
sprintf(buf2, "%s makes you smell bad.\n", buf);
|
||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||
|
@ -7517,6 +7566,11 @@ char *makedesc_race(enum RACE rid, char *retbuf, int showextra, int forplayersel
|
|||
free(p);
|
||||
}
|
||||
break;
|
||||
case F_AUTOTANGLE:
|
||||
if (lorelev >= PR_BEGINNER) {
|
||||
sprintf(buf, "%d%% chance to entangle enemies", f->val[0]);
|
||||
}
|
||||
break;
|
||||
case F_ABSORBKINETIC: if (lorelev >= PR_BEGINNER) strcpy(buf, "Grows stronger through kinetic damage."); break;
|
||||
case F_AQUATIC: if (lorelev >= PR_NOVICE) strcpy(buf, "Moves normally through water"); break;
|
||||
case F_AWARENESS: if (lorelev >= PR_BEGINNER) strcpy(buf, "Can see in all directions."); break;
|
||||
|
@ -7583,6 +7637,7 @@ char *makedesc_race(enum RACE rid, char *retbuf, int showextra, int forplayersel
|
|||
}
|
||||
break;
|
||||
case F_ENHANCESMELL: if (lorelev >= PR_BEGINNER) sprintf(buf, "Enhanced sense of smell (range %d)", f->val[0]); break;
|
||||
case F_FEARLESS: if (lorelev >= PR_BEGINNER) sprintf(buf, "Fearless"); break;
|
||||
case F_FLIGHTEVASION: if (lorelev >= PR_BEGINNER) sprintf(buf, "%d%% evasion while flying", f->val[0]); break;
|
||||
case F_FLYING: if (lorelev >= PR_NOVICE) sprintf(buf, "Can fly at will"); break;
|
||||
case F_HEAVYBLOW: if (lorelev >= PR_ADEPT) sprintf(buf, "Attacks will knock enemies backwards"); break;
|
||||
|
@ -12430,6 +12485,10 @@ void showlfstats(lifeform_t *lf, int showall) {
|
|||
if (f && (f->known)) {
|
||||
wrapprint(mainwin, &y, &x, 0, "%s %s pretending to be dead. ", you(lf), is(lf));
|
||||
}
|
||||
f = lfhasknownflag(lf, F_FEARLESS);
|
||||
if (f && (f->known)) {
|
||||
wrapprint(mainwin, &y, &x, 0, "%s %s fearless. ", you(lf), is(lf));
|
||||
}
|
||||
f = lfhasknownflag(lf, F_FLYING);
|
||||
if (f && (f->known)) {
|
||||
wrapprint(mainwin, &y, &x, 0, "%s %s flying. ", you(lf), is(lf));
|
||||
|
@ -13460,6 +13519,12 @@ void showlfstats(lifeform_t *lf, int showall) {
|
|||
mvwprintw(mainwin, y, 0, "%s identity is obscured.", your(lf));
|
||||
y++;
|
||||
}
|
||||
f = hasflag_real(lf->flags, F_AUTOTANGLE, B_TRUE, NULL, FROMRACE);
|
||||
if (f) {
|
||||
mvwprintw(mainwin, y, 0, "%s %s a %d%% chance to automatically entangle enemies.", you(lf),
|
||||
isplayer(lf) ? "have" : "has", f->val[0]);
|
||||
y++;
|
||||
}
|
||||
f = hasflag_real(lf->flags, F_AWARENESS, B_TRUE, NULL, FROMRACE);
|
||||
if (f) {
|
||||
mvwprintw(mainwin, y, 0, "%s can see things which are behind %s.", you(lf), you(lf));
|
||||
|
@ -13603,7 +13668,13 @@ void showlfstats(lifeform_t *lf, int showall) {
|
|||
char damtypebuf[BUFLEN];
|
||||
int min = 0,max = 0;
|
||||
f = retflag[i];
|
||||
texttodice(f->text, &ndice,&nsides,&bonus);
|
||||
if (f->val[2] == NA) {
|
||||
texttodice(f->text, &ndice,&nsides,&bonus);
|
||||
} else {
|
||||
ndice = 0;
|
||||
nsides = 1;
|
||||
bonus = f->val[2];
|
||||
}
|
||||
|
||||
if ((f->lifetime == FROMOBEQUIP) ||
|
||||
(f->lifetime == FROMOBHOLD) ||
|
||||
|
@ -13829,6 +13900,12 @@ void showlfstats(lifeform_t *lf, int showall) {
|
|||
y++;
|
||||
}
|
||||
|
||||
f = hasflag_real(lf->flags, F_STAMBOOST, B_TRUE, NULL, FROMRACE);
|
||||
if (f && (f->known)) {
|
||||
mvwprintw(mainwin, y, 0, "%s stamina is currently being boosted.", your(lf));
|
||||
y++;
|
||||
}
|
||||
|
||||
f = hasflag_real(lf->flags, F_STENCH, B_TRUE, NULL, FROMRACE);
|
||||
if (f) {
|
||||
mvwprintw(mainwin, y, 0, "%s %s emitting a foul stench, nauseating those nearby.", you(lf), is(lf));
|
||||
|
|
30
lf.c
30
lf.c
|
@ -9149,12 +9149,19 @@ float getmaxpushweight(lifeform_t *lf) {
|
|||
float getmaxstamina(lifeform_t *lf) {
|
||||
int stam = 0;
|
||||
int slev;
|
||||
int boostamt = 0;
|
||||
slev = getskill(lf, SK_ATHLETICS);
|
||||
limit(&slev, 1, NA);
|
||||
|
||||
stam = (getattr(lf, A_CON) / 15) * (slev+1);
|
||||
|
||||
sumflags(lf->flags, F_STAMBOOST, &boostamt, NULL, NULL);
|
||||
stam += boostamt;
|
||||
|
||||
if (lfhasflagval(lf, F_INJURY, IJ_LUNGCOLLAPSED, NA, NA, NULL)) {
|
||||
limit(&stam, NA, 2);
|
||||
}
|
||||
|
||||
return stam;
|
||||
}
|
||||
|
||||
|
@ -14729,7 +14736,7 @@ void age(lifeform_t *lf, int pct) {
|
|||
}
|
||||
}
|
||||
|
||||
void adjustdamforblessings(int *dam, lifeform_t *victim, int blessed) {
|
||||
void adjustdamforblessings(lifeform_t *attacker, int *dam, lifeform_t *victim, int blessed) {
|
||||
if ((blessed == B_BLESSED) && lfhasflagval(victim, F_DTVULN, DT_HOLY, NA, NA, NULL)) {
|
||||
// a little extra damage
|
||||
*dam = pctof(125, *dam);
|
||||
|
@ -15535,7 +15542,7 @@ flag_t *levelabilityready(lifeform_t *lf) {
|
|||
for (i = 0; i < nretflags; i++) {
|
||||
f = retflag[i];
|
||||
// we'll set lifetime to -1 while actually assigning these.
|
||||
if (f->lifetime == FROMJOB) {
|
||||
if ((f->lifetime == FROMJOB) || (f->lifetime == FROMGODPIETY)) {
|
||||
switch (f->id) {
|
||||
case F_LEVFLAG:
|
||||
if (lf->newlevel == f->val[0]) {
|
||||
|
@ -18219,7 +18226,8 @@ void refreshlevelabilities(lifeform_t *lf) {
|
|||
getflags(lf->flags, retflag, &nretflags, F_LEVABIL, F_LEVFLAG, F_LEVSPELL, F_LEVSPELLSCHOOL, F_LEVSPELLSCHOOLFROMX, F_LEVSKILL, F_NONE);
|
||||
for (i = 0; i < nretflags; i++) {
|
||||
f = retflag[i];
|
||||
// we'll set timeleft to -1 while actually assigning these.
|
||||
// we previously set timeleft to -1 while actually assigning these.
|
||||
// now we need to restore the original setting.
|
||||
switch (f->id) {
|
||||
case F_LEVFLAG:
|
||||
case F_LEVABIL:
|
||||
|
@ -18227,7 +18235,8 @@ void refreshlevelabilities(lifeform_t *lf) {
|
|||
case F_LEVSPELL:
|
||||
case F_LEVSPELLSCHOOL:
|
||||
case F_LEVSPELLSCHOOLFROMX:
|
||||
f->lifetime = FROMJOB;
|
||||
//f->lifetime = FROMJOB;
|
||||
f->lifetime = f->origlifetime;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -19087,12 +19096,10 @@ int scare(lifeform_t *lf, lifeform_t *scarer, int howlong, int scarerbonus) {
|
|||
if (lfhasflag(lf, F_UNDEAD)) return B_FALSE;
|
||||
if (isgod(lf)) return B_FALSE;
|
||||
|
||||
if (lfhasflag(lf, F_ASLEEP)) {
|
||||
return B_FALSE;
|
||||
}
|
||||
if (lfhasflag(lf, F_RAGE)) {
|
||||
return B_FALSE;
|
||||
}
|
||||
if (lfhasflag(lf, F_ASLEEP)) return B_FALSE;
|
||||
if (lfhasflag(lf, F_RAGE)) return B_FALSE;
|
||||
if (lfhasflag(lf, F_FEARLESS)) return B_FALSE;
|
||||
|
||||
// not intelligent enough to be scared?
|
||||
if (getattrbracket(getattr(lf, A_IQ), A_IQ, NULL) <= IQ_MINDLESS) {
|
||||
return B_FALSE;
|
||||
|
@ -20296,6 +20303,9 @@ int modskillcheckroll(lifeform_t *lf, enum CHECKTYPE ct, int *roll) {
|
|||
othermod += 50;
|
||||
}
|
||||
}
|
||||
if (lfhasflag(lf, F_SPRINTING)) {
|
||||
othermod -= 40;
|
||||
}
|
||||
} else if (ct == SC_FALL) {
|
||||
if (lfhasflag(lf, F_STABILITY) || !hasbp(lf, BP_FEET)) {
|
||||
othermod += 30;
|
||||
|
|
2
lf.h
2
lf.h
|
@ -16,7 +16,7 @@ object_t *addtrail(lifeform_t *lf, cell_t *where, int dir, int doprints, int dos
|
|||
void adjustdamlf(lifeform_t *lf, int *amt, enum DAMTYPE damtype);
|
||||
void adjustspeedforwater(lifeform_t *lf, int *speed);
|
||||
void age(lifeform_t *lf, int pct);
|
||||
void adjustdamforblessings(int *dam, lifeform_t *victim, int blessed);
|
||||
void adjustdamforblessings(lifeform_t *attacker, int *dam, lifeform_t *victim, int blessed);
|
||||
void applylfdammod(int *dam, lifeform_t *lf, object_t *wep);
|
||||
void applywalkdam(lifeform_t *lf, int dam, enum DAMTYPE damtype, object_t *o, int bodypart);
|
||||
int areallies(lifeform_t *lf1, lifeform_t *lf2);
|
||||
|
|
14
objects.c
14
objects.c
|
@ -12449,6 +12449,8 @@ int removeob(object_t *o,int howmany) {
|
|||
int rv = 0;
|
||||
lifeform_t *owner;
|
||||
|
||||
if ((howmany != ALL) && howmany <= 0) return o->amt;
|
||||
|
||||
owner = o->pile->owner;
|
||||
if (owner) {
|
||||
preburdened = isburdened(o->pile->owner);
|
||||
|
@ -14032,7 +14034,7 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp
|
|||
|
||||
throwdam = getthrowdam(o);
|
||||
|
||||
adjustdamforblessings(&throwdam, target, o->blessed);
|
||||
adjustdamforblessings(NULL, &throwdam, target, o->blessed);
|
||||
|
||||
//dam = (int)((float)throwdam * multiplier);
|
||||
dam = throwdam + (speed/2);
|
||||
|
@ -14315,6 +14317,7 @@ void timeeffectsob(object_t *o) {
|
|||
obpile_t *op;
|
||||
char *newobname = NULL;
|
||||
flagpile_t *fp;
|
||||
|
||||
newamt = o->amt / f->val[0];
|
||||
op = o->pile;
|
||||
fp = addflagpile(NULL, NULL);
|
||||
|
@ -14325,11 +14328,14 @@ void timeeffectsob(object_t *o) {
|
|||
newoid = f->val[1];
|
||||
}
|
||||
// some flags will be inherited by the new object
|
||||
killflagsofid(o->flags, F_FILLPOT);
|
||||
copyflag(fp, o->flags, F_FILLPOT);
|
||||
removeob(o, o->amt);
|
||||
killflagsofid(o->flags, F_FILLPOT);
|
||||
|
||||
// remove some instances of the original object.
|
||||
removeob(o, newamt * f->val[0]);
|
||||
|
||||
for (i = 0; i < newamt; i++) {
|
||||
object_t *newob;
|
||||
object_t *newob = NULL;
|
||||
if (newobname) {
|
||||
newob = addob(op, newobname);
|
||||
} else {
|
||||
|
|
2
spell.c
2
spell.c
|
@ -7202,7 +7202,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
}
|
||||
|
||||
// create vine
|
||||
o = addob(targcell->obpile, "entangling vine");
|
||||
o = addobfast(targcell->obpile, OT_VINE);
|
||||
// set power
|
||||
f = hasflag(o->flags, F_RESTRICTMOVEMENT);
|
||||
if (f) {
|
||||
|
|
Loading…
Reference in New Issue