- [+] reduce F_WALKDAM on fire objects to 1d4,2d4,3d4

- [+] bug: getvaulttype causes infinite loop if none found.
- [+] flameburst from klikirak offer shouldn't incrase piety further.
- [+] fireball / flame pillar spell: mark that the player created the
      fire
    - [+] ... so that when it damages otehr objects, damge caomes form
          the playerh
- [+] make shieldbash stun effect last longer
This commit is contained in:
Rob Pearce 2012-02-02 05:26:14 +00:00
parent d97c0c9421
commit b1abb5ad76
10 changed files with 73 additions and 56 deletions

9
data.c
View File

@ -2331,7 +2331,7 @@ void initobjects(void) {
addot(OT_POT_EXPERIENCE, "potion of experience", "Instantly grants the imbiber the next experience level.", MT_GLASS, 1, OC_POTION, SZ_TINY); addot(OT_POT_EXPERIENCE, "potion of experience", "Instantly grants the imbiber the next experience level.", MT_GLASS, 1, OC_POTION, SZ_TINY);
addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_RARE, NULL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_RARE, NULL);
addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, 40, NA, NULL); addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, 40, NA, NULL);
addflag(lastot->flags, F_VALUE, 210, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 410, NA, NA, NULL);
addot(OT_POT_BLOODC, "potion of cockatrice blood", "A small quantity of cockatrice blood.", MT_GLASS, 1, OC_POTION, SZ_TINY); addot(OT_POT_BLOODC, "potion of cockatrice blood", "A small quantity of cockatrice blood.", MT_GLASS, 1, OC_POTION, SZ_TINY);
addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL); addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL);
@ -2926,6 +2926,7 @@ void initobjects(void) {
addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJSELF, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJSELF, NA, NA, NULL);
addot(OT_S_FIREBALL, "fireball", "Creates a huge ball of fire, dealing up to ^bpower^nd3 damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); addot(OT_S_FIREBALL, "fireball", "Creates a huge ball of fire, dealing up to ^bpower^nd3 damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY);
addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The damage is lower for enemies further away from the ball's centre."); addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The damage is lower for enemies further away from the ball's centre.");
addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power level 5, the size of the fireball is slightly increased.");
addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL);
addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL);
addflag(lastot->flags, F_RANGE, 6, NA, NA, NULL); addflag(lastot->flags, F_RANGE, 6, NA, NA, NULL);
@ -5179,7 +5180,7 @@ void initobjects(void) {
addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL);
addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL);
addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_WALKDAM,DT_FIRE, NA, NA, "6d4"); addflag(lastot->flags, F_WALKDAM,DT_FIRE, NA, NA, "3d4");
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_PRODUCESLIGHT, 10, NA, NA, NULL); addflag(lastot->flags, F_PRODUCESLIGHT, 10, NA, NA, NULL);
addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!");
@ -5190,7 +5191,7 @@ void initobjects(void) {
addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL);
addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL);
addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "4d4"); addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "2d4");
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_PRODUCESLIGHT, 7, NA, NA, NULL); addflag(lastot->flags, F_PRODUCESLIGHT, 7, NA, NA, NULL);
addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!");
@ -5200,7 +5201,7 @@ void initobjects(void) {
addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL);
addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL);
addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "2d4"); addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "1d4");
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_PRODUCESLIGHT, 5, NA, NA, NULL); addflag(lastot->flags, F_PRODUCESLIGHT, 5, NA, NA, NULL);
addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!");

Binary file not shown.

4
god.c
View File

@ -760,13 +760,15 @@ int godblocked(enum RACE rid) {
int godgiftmaybe(enum RACE rid, int fromtemple) { int godgiftmaybe(enum RACE rid, int fromtemple) {
lifeform_t *god; lifeform_t *god;
int piety,gotgift = B_FALSE; int piety,gotgift = B_FALSE;
enum PIETYLEV plev;
int chance; int chance;
god = findgod(rid); god = findgod(rid);
piety = getpiety(rid); piety = getpiety(rid);
plev = getpietylev(rid, NULL, NULL);
if (fromtemple) { if (fromtemple) {
chance = 100; chance = 100;
} else if (piety >= 200) { } else if (plev >= PL_PLEASED) { // ie. >= 200
// ie. 200 -> 4% // ie. 200 -> 4%
// ie. 500 -> 10% // ie. 500 -> 10%
chance = piety / 50; chance = piety / 50;

17
io.c
View File

@ -4856,7 +4856,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
strncat(retbuf, thisline, HUGEBUFLEN); strncat(retbuf, thisline, HUGEBUFLEN);
// note: we manually handle SACRIFICEOBWITHFLAG // note: we manually handle SACRIFICEOBWITHFLAG
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_SACRIFICEOBCLASS, F_SACRIFICEOBBLESSED, F_NONE); getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_SACRIFICEOBCLASS, F_SACRIFICEOBBLESSED, F_SACRIFICEOBWITHFLAG,F_NONE);
if (nretflags == 0) { if (nretflags == 0) {
sprintf(thisline, "%s does not accept sacrifices.\n", godname); sprintf(thisline, "%s does not accept sacrifices.\n", godname);
strncat(retbuf, thisline, HUGEBUFLEN); strncat(retbuf, thisline, HUGEBUFLEN);
@ -4922,12 +4922,15 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
} }
strcpy(thisline, ""); strcpy(thisline, "");
switch (retflag[i]->val[0]) { switch (retflag[i]->val[0]) {
case F_GEM:
sprintf(thisline, "- gems\n");
break;
case F_BATTLESPOILS: case F_BATTLESPOILS:
sprintf(thisline, "- untouched battle spoils\n"); sprintf(thisline, "- untouched battle spoils\n");
break; break;
case F_FLAMMABLE:
sprintf(thisline, "- flammable objects\n");
break;
case F_GEM:
sprintf(thisline, "- gems\n");
break;
default: default:
break; break;
} }
@ -12210,11 +12213,7 @@ void showlfstats(lifeform_t *lf, int showall) {
real_getlfname(god, godname, B_FALSE, B_FALSE); real_getlfname(god, godname, B_FALSE, B_FALSE);
f = lfhasflag(god, F_GODOF); f = lfhasflag(god, F_GODOF);
if (f->val[0] == B_FEMALE) { strcat(godname, " (");
strcat(godname, " (Goddess of ");
} else {
strcat(godname, " (God of ");
}
strcat(godname, f->text); strcat(godname, f->text);
strcat(godname, ")"); strcat(godname, ")");

3
lf.c
View File

@ -18434,6 +18434,9 @@ int useability(lifeform_t *lf, enum OBTYPE aid, lifeform_t *who, cell_t *where)
case E_NOSTAM: case E_NOSTAM:
msg("You are too tired to do that."); msg("You are too tired to do that.");
break; break;
case E_PRONE:
msg("You can't use abilities while prone.");
break;
case E_STUNNED: case E_STUNNED:
msg("You can't use abilities while stunned."); msg("You can't use abilities while stunned.");
break; break;

View File

@ -2974,12 +2974,13 @@ void damageallobs(object_t *srcob, obpile_t *op, int howmuch, int damtype, lifef
continue; continue;
} }
if ((o != srcob) && !hasflag(o->flags, F_DEAD)) { if ((o != srcob) && !hasflag(o->flags, F_TRAIL) && !hasflag(o->flags, F_DEAD)) {
takedamage(o, howmuch, damtype); if (takedamage(o, howmuch, damtype)) {
nhurt++; nhurt++;
}
} }
} }
if (srclf) { if (srclf && nhurt) {
if (isplayer(srclf)) { if (isplayer(srclf)) {
if (basedamagetype(damtype) == DT_FIRE) { if (basedamagetype(damtype) == DT_FIRE) {
pleasegodmaybe(R_GODFIRE, nhurt*2); pleasegodmaybe(R_GODFIRE, nhurt*2);
@ -3713,6 +3714,16 @@ int getobbonus(object_t *o, int onlyknown) {
return bonus; return bonus;
} }
lifeform_t *getobcreatedby(object_t *o) {
flag_t *f;
lifeform_t *creator = NULL;
f = hasflag(o->flags, F_CREATEDBY);
if (f) {
creator = findlf(NULL, f->val[0]);
}
return creator;
}
int getobpoints(object_t *o) { int getobpoints(object_t *o) {
if (hasflag(o->flags, F_NOPOINTS)) { if (hasflag(o->flags, F_NOPOINTS)) {
return 0; return 0;
@ -12785,26 +12796,23 @@ void timeeffectsob(object_t *o) {
int willvanish = B_FALSE; int willvanish = B_FALSE;
// creator no longer has los? // creator no longer has los?
f = hasflag(o->flags, F_CREATEDBY); creator = getobcreatedby(o);
if (f) { if (!creator || !haslos(creator, location)) {
creator = findlf(NULL, f->val[0]); willvanish = B_TRUE;
if (!creator || !haslos(creator, location)) { }
willvanish = B_TRUE;
}
// noone there? // noone there?
if (!location->lf) { if (!location->lf) {
willvanish = B_TRUE; willvanish = B_TRUE;
} }
if (willvanish) { if (willvanish) {
// vanish. // vanish.
if (haslos(player, location)) { if (haslos(player, location)) {
msg("%s vanish%s.", obname, OB1(o,"es","")); msg("%s vanish%s.", obname, OB1(o,"es",""));
}
removeob(o, o->amt);
return;
} }
removeob(o, o->amt);
return;
} }
} }
} }
@ -12996,7 +13004,7 @@ void timeeffectsob(object_t *o) {
if (f->id == F_WALKDAM) { if (f->id == F_WALKDAM) {
// everything here takes damage // everything here takes damage
//damageallobs(o, o->pile, f->val[0] * timespent, f->val[1]); //damageallobs(o, o->pile, f->val[0] * timespent, f->val[1]);
damageallobs(o, o->pile, roll(f->text), f->val[0], NULL); damageallobs(o, o->pile, roll(f->text), f->val[0], getobcreatedby(o));
//if (hasflag(o->flags, F_DEAD)) return; //if (hasflag(o->flags, F_DEAD)) return;
} }

View File

@ -83,6 +83,7 @@ enum MATSTATE getmaterialstate(enum MATERIAL mat);
int getmissileaccuracy(lifeform_t *thrower, cell_t *where, object_t *missile, object_t *firearm, flag_t *tkthrow); int getmissileaccuracy(lifeform_t *thrower, cell_t *where, object_t *missile, object_t *firearm, flag_t *tkthrow);
int getobaccuracy(object_t *wep, lifeform_t *weilder); int getobaccuracy(object_t *wep, lifeform_t *weilder);
int getobbonus(object_t *o, int onlyknown); int getobbonus(object_t *o, int onlyknown);
lifeform_t *getobcreatedby(object_t *o);
int getobpoints(object_t *o); int getobpoints(object_t *o);
skill_t *getobskill(flagpile_t *fp); skill_t *getobskill(flagpile_t *fp);
enum LFSIZE getobsize(object_t *o); enum LFSIZE getobsize(object_t *o);

View File

@ -698,7 +698,7 @@ enum SHOPRETURN shoppurchase(lifeform_t *lf, object_t *vm, int starty, char *top
enum SKILLLEVEL slev; enum SKILLLEVEL slev;
slev = getskill(lf, SK_SPEECH); slev = getskill(lf, SK_SPEECH);
// determine payment method // determine payment method
sprintf(ques, "How will you pay for %s?", obname); sprintf(ques, "How will you pay for %s ($%d)?", obname, value);
initprompt(&prompt, ques); initprompt(&prompt, ques);
for (oo = player->pack->first ; oo ; oo = oo->next) { for (oo = player->pack->first ; oo ; oo = oo->next) {
if ((oo->type->id == OT_GOLD) || (oo->type->id == OT_CREDITCARD) || hasflag(oo->flags, F_GEM)) { if ((oo->type->id == OT_GOLD) || (oo->type->id == OT_CREDITCARD) || hasflag(oo->flags, F_GEM)) {

40
spell.c
View File

@ -1698,7 +1698,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
modifyforsize(&mod, user, target, 5, M_VAL); modifyforsize(&mod, user, target, 5, M_VAL);
if (mod > 0) mod = 0; if (mod > 0) mod = 0;
if (skillcheck(user, SC_SHIELDBLOCK, 5 + getevasion(target), mod)) { if (skillcheck(user, SC_SHIELDBLOCK, 5 + getevasion(target), mod)) {
stun(target, 2); stun(target, 3);
} }
} }
@ -5851,7 +5851,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
anim(caster->cell, targcell, '^', C_RED); anim(caster->cell, targcell, '^', C_RED);
redrawpause(); redrawpause();
// add fires as follows (3 = medium, 2 = medium, 1 = smell) // add fires as follows (3 = medium, 2 = medium, 1 = small)
// //
// 1 // 1
// 232 // 232
@ -5897,25 +5897,27 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
} }
} }
} }
for (dir = D_N; dir <= D_W; dir++) { if ((spellid = OT_S_METEOR) || (power > 5)) {
cell_t *c; for (dir = D_N; dir <= D_W; dir++) {
c = getcellindir(targcell, dir); cell_t *c;
if (c) { c = getcellindir(targcell, dir);
c = getcellindir(c, dir); if (c) {
if (c && (!c->type->solid || hasflag(c->type->material->flags, F_FLAMMABLE)) ) { c = getcellindir(c, dir);
o = addobfast(c->obpile, fire3); if (c && (!c->type->solid || hasflag(c->type->material->flags, F_FLAMMABLE)) ) {
if (o) { o = addobfast(c->obpile, fire3);
setobcreatedby(o, caster); if (o) {
} setobcreatedby(o, caster);
if (c->lf) {
int ndice;
ndice = power / 2; if (ndice < 1) ndice = 1;
if (spellid == OT_S_FIREBALL) {
losehp(c->lf, rolldie(ndice,2), DT_FIRE, caster, "a fireball");
} else {
losehp(c->lf, 7+rolldie(ndice,4), DT_FIRE, caster, "a meteorite");
} }
if (c->lf) {
int ndice;
ndice = power / 2; if (ndice < 1) ndice = 1;
if (spellid == OT_S_FIREBALL) {
losehp(c->lf, rolldie(ndice,2), DT_FIRE, caster, "a fireball");
} else {
losehp(c->lf, 7+rolldie(ndice,4), DT_FIRE, caster, "a meteorite");
}
}
} }
} }
} }

View File

@ -775,6 +775,7 @@ vault_t *getvaulttype(map_t *m) {
// if we have no possibilities, lower rarity and try again // if we have no possibilities, lower rarity and try again
if (rr == RR_COMMON) { if (rr == RR_COMMON) {
// give up. // give up.
break;
} else { } else {
rr--; rr--;
} }