diff --git a/ai.c b/ai.c index 5b5670b..79de1fe 100644 --- a/ai.c +++ b/ai.c @@ -606,6 +606,11 @@ int aimovetolf(lifeform_t *lf, lifeform_t *target, int wantattack) { if (f) spellchance = f->val[0]; else spellchance = 30; + // some attacks can always happen + if (cancast(lf, OT_A_THRUST, NULL) && (dist == 2)) { + spellchance = 100; + } + if (pctchance(spellchance)) { spell = aigetattackspell(lf, target); } else { @@ -613,10 +618,11 @@ int aimovetolf(lifeform_t *lf, lifeform_t *target, int wantattack) { } st = findot(spell); if ( (spell != OT_NONE) && // found a valid spell/ability to use - ((dist != 1) || // there is distance between us and target - (st->obclass->id == OC_ABILITY) || // OR this works from adjacent - (st->obclass->id == OC_ABILITY) || // OR we have no melee attack - !countinnateattacks(lf) || + // AND one of these: + ((dist != 1) || // there is distance between us and target + (getspellrange(lf, st->id, 1) == 1) || // OR this works from adjacent + (st->obclass->id == OC_ABILITY) || // OR this is an ability + !countinnateattacks(lf) || // OR we have no melee attack (rnd(1,3) == 1)) // OR random chance of using anyway... ) { int spellfailed = B_FALSE; @@ -1468,8 +1474,8 @@ void aiturn(lifeform_t *lf) { // will usually ignore targets who we can't reach if (!canreach(lf, who, &reachpenalty)) { if (!aigetrangedattack(lf, NULL, NULL)) { // no ranged attack? - // 1 size to small = 53% chance to attack - // 1 size to small = 6% chance to attack + // 1 size too small = 53% chance to attack + // 1 size too small = 6% chance to attack chance = 100 - (reachpenalty*47); if (db) dblog(".oO { target %d (%s) is %d sizes out of reach. %d%% chance to ignore }",who->id, who->race->name, reachpenalty, reachpenalty*47); @@ -1747,7 +1753,14 @@ int aispellok(lifeform_t *lf, enum OBTYPE spellid, lifeform_t *victim, enum FLAG } if (specialcase) { - if (ot->id == OT_S_TELEKINESIS) { + if (ot->id == OT_S_PYROMANIA) { + int i; + for (i = 0; i < lf->nlos; i++) { + if ((lf->los[i] != lf->cell) && getflamingobs(lf->los[i]->obpile, NULL, NULL)) { + ok = B_TRUE; + } + } + } else if (ot->id == OT_S_TELEKINESIS) { int i,nposs; float maxweight; maxweight = getlfweight(lf, B_NOOBS) + diff --git a/attack.c b/attack.c index 5fad5a7..add1e1b 100644 --- a/attack.c +++ b/attack.c @@ -573,7 +573,7 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag) } else if (cansee(player, lf)) { msg("^wSomething prevents %s from attacking %s!", attackername, victimname); } - taketime(lf, getattackspeed(lf)); + //taketime(lf, getattackspeed(lf)); return B_FALSE; } } @@ -589,7 +589,7 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag) noprefix(wepname), victimname); if (!f->known) f->known = B_TRUE; } - taketime(lf, getattackspeed(lf)); + //taketime(lf, getattackspeed(lf)); return B_FALSE; } } @@ -605,12 +605,28 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag) } else if (cansee(player, lf)) { msg("^w%s%s attack passes straight through %s!", attackername, getpossessive(attackername), victimname); } - taketime(lf, getattackspeed(lf)); + //taketime(lf, getattackspeed(lf)); return B_FALSE; } } + // long weapon in an enclosed space? + if (wep && hasflag(wep->flags, F_NEEDSSPACE)) { + if (countcellexits(lf->cell) < 3) { + if (pctchance(75)) { + if (isplayer(lf)) { + msg("^wYour %s glances off a nearby wall.", wepname); + } else if (cansee(player, lf)) { + msg("^w%s%s %s glances off a nearby wall.", attackername, getpossessive(attackername), wepname); + } + //taketime(lf, getattackspeed(lf)); + return B_FALSE; + } + } + } + + // did you hit? ndam = 0; @@ -1971,7 +1987,7 @@ int rolltohit(lifeform_t *lf, lifeform_t *victim, object_t *wep, int *critical) // size difference (penalty for attacking smaller ones) modifyforsize(&acc, lf, victim, -5, M_VAL); - + // easier to hit victims who are prone. if (isprone(victim)) { acc += 30; @@ -2058,7 +2074,7 @@ void wepeffects(flagpile_t *fp, cell_t *where, flag_t *damflag, int dam) { } victim = where->lf; - getflags(fp, retflag, &nretflags, F_FLAMESTRIKE, F_HEAVYBLOW, F_HITCONFER, F_REVENGE, F_NONE); + getflags(fp, retflag, &nretflags, F_FLAMESTRIKE, F_HEAVYBLOW, F_HITCONFER, F_RACESLAY, F_REVENGE, F_NONE); for (i = 0; i < nretflags; i++) { f = retflag[i]; if (f->id == F_FLAMESTRIKE) { @@ -2071,6 +2087,20 @@ void wepeffects(flagpile_t *fp, cell_t *where, flag_t *damflag, int dam) { f->known = B_KNOWN; } } + } else if ((f->id == F_RACESLAY) && victim && !isdead(victim) && (getraceclass(victim) == f->val[0])) { + char ownername[BUFLEN]; + char wepname[BUFLEN]; + char damstring[BUFLEN]; + if (haslos(player, where)) { + char vname[BUFLEN]; + getlfname(victim, vname); + msg("^wA pulse of lethal power blasts %s!", vname); + f->known = B_KNOWN; + } + real_getlfname(owner, ownername, B_FALSE); + getobname(wep, wepname, 1); + snprintf(damstring, BUFLEN, "%s%s %s",ownername, getpossessive(ownername), wepname); + losehp(victim, dam*3, DT_DIRECT, owner, damstring); } else if ((f->id == F_REVENGE) && victim && !isdead(victim)) { if (dam) { // only works if we did damage lifeform_t *owner; diff --git a/data.c b/data.c index 906c569..f3cdea4 100644 --- a/data.c +++ b/data.c @@ -122,7 +122,7 @@ void initjobs(void) { addflag(lastjob->flags, F_STARTATT, A_CHA, AT_EXHIGH, NA, NULL); addflag(lastjob->flags, F_MPDICE, 100, NA, NA, NULL); //addflag(lastjob->flags, F_MPREGEN, 100, NA, NA, NULL); - addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "short sword of pyromania"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "gladius of pyromania"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "hand of god"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 blocks of chocolate"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 vials of ambrosia"); @@ -163,7 +163,7 @@ void initjobs(void) { addjob(J_ADVENTURER, "Adventurer", "Adventurers are a basic jack-of-all-trades type job. They can learn all skills, and already have basic Cartography and Lore skills. They start the game with three healing potions. Recommended for beginners."); // stat mods // initial objects - addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "short sword"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "gladius"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather armour"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 gold coins"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "3 potions of healing"); @@ -823,7 +823,8 @@ void initobjects(void) { // weapons addbrand(BR_BALANCE, "of balance", BP_WEAPON); addflag_real(lastbrand->flags, F_BALANCE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_IMPACT, "of impact", BP_WEAPON); // TODO: make thisonly go ont obashing weapons + addbrand(BR_IMPACT, "of impact", BP_WEAPON); + addflag_real(lastbrand->flags, F_ONLYFORDAMTYPE, DT_BASH, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_HEAVYBLOW, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addbrand(BR_MERCY, "of mercy", BP_WEAPON); addflag_real(lastbrand->flags, F_MERCIFUL, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); @@ -836,6 +837,23 @@ void initobjects(void) { addbrand(BR_LIFESUCK, "of lifesucking", BP_WEAPON); addflag_real(lastbrand->flags, F_VAMPIRIC, NA, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SLAY_ANIMAL, "of butchering", BP_WEAPON); + addflag_real(lastbrand->flags, F_ONLYFORDAMTYPE, DT_SLASH, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addflag_real(lastbrand->flags, F_RACESLAY, RC_ANIMAL, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SLAY_DRAGON, "of dragonslaying", BP_WEAPON); + addflag_real(lastbrand->flags, F_ONLYFORWEPSKILL, SK_POLEARMS, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addflag_real(lastbrand->flags, F_RACESLAY, RC_DRAGON, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SLAY_MAGIC, "of antimagic", BP_WEAPON); + addflag_real(lastbrand->flags, F_RACESLAY, RC_MAGIC, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SLAY_PLANT, "of blight", BP_WEAPON); + addflag_real(lastbrand->flags, F_ONLYFOROBTYPE, OT_SCYTHE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addflag_real(lastbrand->flags, F_RACESLAY, RC_PLANT, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SLAY_UNDEAD, "of divine power", BP_WEAPON); + addflag_real(lastbrand->flags, F_ONLYFORWEPSKILL, SK_LONGBLADES, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addflag_real(lastbrand->flags, F_ONLYFORWEPSKILL, SK_SHORTBLADES, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addflag_real(lastbrand->flags, F_RACESLAY, RC_UNDEAD, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_PRODUCESLIGHT, 2, NA, NULL, PERMENANT, B_KNOWN, -1); + // feet addbrand(BR_LEVITATION, "of hovering", BP_FEET); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_LEVITATING, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); @@ -2253,6 +2271,11 @@ void initobjects(void) { addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_PYROMANIA, "pyromania", "Increases the potency of all fire within the caster's line of sight.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SPECIAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); // l2 addot(OT_S_BLADEBURN, "bladeburn", "Ignites the target's bladed weapon, causing it to temporarily deal fire damage. The spell's power determines how long it will last.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines its duration."); @@ -3238,6 +3261,11 @@ void initobjects(void) { addflag(lastot->flags, F_STAMCOST, 2, NA, NA, NULL); addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addot(OT_A_THRUST, "thrust", "Perform a long range attack on an enemy up to two cells away.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_STAMCOST, 1, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 2, NA, NA, NULL); addot(OT_A_TRIPLF, "trip", "Attempt to trip your opponent over.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); addflag(lastot->flags, F_STAMCOST, 2, NA, NA, NULL); addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); @@ -4877,7 +4905,7 @@ void initobjects(void) { // this one is for the pirate addot(OT_HOOKHAND, "hook", "hook", MT_METAL, 0, OC_WEAPON, SZ_TINY); - addflag(lastot->flags, F_DAM, DT_PIERCE, 4, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, 4, NA, NULL); addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_UNARMED, NA, NA, NULL); addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); @@ -5115,6 +5143,7 @@ void initobjects(void) { addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 15, NA, NULL); + // MELEE WEAPONS / melee weapons // axes addot(OT_AXE, "axe", "A short pole with a heavy, wedge-shaped blade for chopping.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); @@ -5133,6 +5162,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 180, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_CHOP, 18, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); @@ -5163,7 +5193,7 @@ void initobjects(void) { // short blades addot(OT_COMBATKNIFE, "combat knife", "A sharp knife designed for military use.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); - addflag(lastot->flags, F_DAM, DT_PIERCE, 5, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, 5, NA, NULL); addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); @@ -5181,7 +5211,7 @@ void initobjects(void) { addot(OT_DAGGER, "dagger", "A short stabbing weapon with a pointed blade.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 4, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); @@ -5193,13 +5223,13 @@ void initobjects(void) { addot(OT_FORK, "fork", "A common kitchen fork.", MT_METAL, 0.2, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 2, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 65, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addot(OT_KNIFE, "knife", "A moderately sharp stabbing tool.", MT_METAL, 0.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 3, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_PICKLOCKS, 7, B_BLUNTONFAIL, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); @@ -5209,7 +5239,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); addflag(lastot->flags, F_SHINY, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 3, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_PICKLOCKS, 7, B_BLUNTONFAIL, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); @@ -5223,7 +5253,7 @@ void initobjects(void) { addot(OT_RAPIER, "rapier", "A long, narrow French sword lacking a cutting edge. Made for stabbing.", MT_METAL, 3.5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 7, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 6, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 3, NA, NA, NULL); @@ -5231,10 +5261,10 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 81, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 4, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_DISARMLF, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_EXOTICWEPS, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_AGI, 10, NA, NULL); - addot(OT_SHORTSWORD, "short sword", "A short blade for fighting. Better for stabbing.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); + addot(OT_SHORTSWORD, "gladius", "A short gladiator blade. Designed for stabbing rather than slashing.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 6, NA, NULL); addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); @@ -5245,13 +5275,13 @@ void initobjects(void) { addot(OT_SICKLE, "sickle", "A hand-held agricultural tool with a curved blade.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 6, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 60, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); addot(OT_STEAKKNIFE, "steak knife", "A common kitchen knife.", MT_METAL, 0.2, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 2, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); @@ -5280,6 +5310,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_SLASH, 15, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 15, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 7, NA, NA, NULL); @@ -5321,6 +5352,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_SLASH, 12, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); @@ -5328,6 +5360,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_TRIPLF, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 130, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 9, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); @@ -5342,6 +5375,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_CHOP, 13, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_AGI, 9, NA, NULL); @@ -5351,6 +5385,7 @@ void initobjects(void) { addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 140, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 11, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_THRUST, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); @@ -5361,6 +5396,7 @@ void initobjects(void) { addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 120, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 11, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_THRUST, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); @@ -5369,15 +5405,16 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 8, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 65, NA, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); addot(OT_SPEAR, "spear", "A long pole with a sharpened head.", MT_METAL, 9, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); - addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 140, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 10, NA, NULL); - addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_THRUST, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 65, NA, NA, NULL); addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); @@ -5398,6 +5435,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_BASH, 8, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 7, NA, NULL); @@ -5408,6 +5446,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 9, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 6, NA, NULL); @@ -5418,6 +5457,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 12, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); @@ -5430,6 +5470,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 10, NA, NULL); + addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); @@ -6694,7 +6735,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-25 gold coins"); - addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "short sword"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "gladius"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "sling"); addflag(lastrace->flags, F_STARTOBCLASS, 40, OC_POTION, NA, NULL); addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, B_COVETS, NA, NULL); @@ -6755,7 +6796,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "short sword"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "gladius"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "hand crossbow"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "1-15 bolts"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); @@ -8476,15 +8517,13 @@ void initrace(void) { // end animals // dragons - - addrace(R_DRAGONBLUE, "blue dragon", 400, 'D', C_BLUE, MT_FLESH, RC_DRAGON, "Blue dragons are massive reptilian creatures who can (and will) consume almost any living creature."); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUGE, NA, NA, NULL); addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); - addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "30d4"); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "28d4"); addflag(lastrace->flags, F_ARMOURRATING, 18, NA, NA, NULL); addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_BREATHWATER, B_TRUE, NA, NA, NULL); @@ -8493,7 +8532,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 16, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 12, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); @@ -8512,6 +8551,7 @@ void initrace(void) { addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); addflag(lastrace->flags, F_CANCAST, OT_S_GUSTOFWIND, NA, NA, "pw:8;"); addflag(lastrace->flags, F_CANCAST, OT_S_LIGHTNINGBOLT, NA, NA, "pw:8;"); + addflag(lastrace->flags, F_CASTCHANCE, 40, NA, NA, NULL); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "unleashes its lightning breath"); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_GUSTOFWIND, NA, NA, "flaps its wings"); addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); @@ -8524,7 +8564,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUGE, NA, NA, NULL); addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); - addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "15d4"); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "13d4"); addflag(lastrace->flags, F_ARMOURRATING, 12, NA, NA, NULL); addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_BREATHWATER, B_TRUE, NA, NA, NULL); @@ -8533,7 +8573,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 10, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 8, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); @@ -8565,7 +8605,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUGE, NA, NA, NULL); addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); - addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "45d4"); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "40d4"); addflag(lastrace->flags, F_ARMOURRATING, 24, NA, NA, NULL); addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_BREATHWATER, B_TRUE, NA, NA, NULL); @@ -8574,7 +8614,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 30, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 21, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_GTAVERAGE, NA, NULL); @@ -8597,6 +8637,7 @@ void initrace(void) { addflag(lastrace->flags, F_CANCAST, OT_S_FLOOD, NA, NA, "pw:4;"); addflag(lastrace->flags, F_CANCAST, OT_S_CHAINLIGHTNING, NA, NA, "pw:10;"); addflag(lastrace->flags, F_CANWILL, OT_S_FEAR, 30, 30, "pw:6;"); + addflag(lastrace->flags, F_CASTCHANCE, 40, NA, NA, NULL); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "unleashes its lightning breath"); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_GUSTOFWIND, NA, NA, "flaps its wings"); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_AIRBLAST, NA, NA, "flaps its wings"); @@ -8620,7 +8661,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 20, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 16, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); @@ -8628,6 +8669,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars"); addflag(lastrace->flags, F_FLEEONHPPCT, 15, NA, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_SS_FIRE, PR_MASTER, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_LORE_DRAGONS, PR_MASTER, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_LORE_ARCANA, PR_SKILLED, NA, NULL); @@ -8636,11 +8678,14 @@ void initrace(void) { addflag(lastrace->flags, F_STARTSKILL, SK_SPEECH, PR_EXPERT, NA, NULL); addflag(lastrace->flags, F_ENHANCESMELL, 7, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_PYROMANIA, NA, NA, "pw:10;"); addflag(lastrace->flags, F_CANCAST, OT_S_FIREBALL, NA, NA, "pw:7;"); addflag(lastrace->flags, F_CANCAST, OT_S_BURNINGWAVE, NA, NA, "pw:8;"); addflag(lastrace->flags, F_CANCAST, OT_S_HEATMETAL, NA, NA, "pw:8;"); + addflag(lastrace->flags, F_CASTCHANCE, 40, NA, NA, NULL); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "unleashes its fiery breath"); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_HEATMETAL, NA, NA, "radiates an aura of intense heat"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_PYROMANIA, NA, NA, "flaps its wings"); addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); @@ -8657,13 +8702,14 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 14, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 10, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roars"); addflag(lastrace->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_SS_FIRE, PR_ADEPT, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_LORE_DRAGONS, PR_MASTER, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_LISTEN, PR_ADEPT, NA, NULL); @@ -8672,9 +8718,11 @@ void initrace(void) { addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); addflag(lastrace->flags, F_CANCAST, OT_S_FIREDART, NA, NA, "pw:7;"); + addflag(lastrace->flags, F_CANCAST, OT_S_PYROMANIA, NA, NA, "pw:10;"); addflag(lastrace->flags, F_CANCAST, OT_S_HEATMETAL, NA, NA, "pw:7;"); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "unleashes its fiery breath"); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_HEATMETAL, NA, NA, "radiates an aura of intense heat"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_PYROMANIA, NA, NA, "flaps its wings"); addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 15, NA, NA, NULL); addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); @@ -8691,7 +8739,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 30, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 21, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_GTAVERAGE, NA, NULL); @@ -8699,6 +8747,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roars"); addflag(lastrace->flags, F_FLEEONHPPCT, 15, NA, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_SS_FIRE, PR_MASTER, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_LORE_DRAGONS, PR_MASTER, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_LORE_ARCANA, PR_MASTER, NA, NULL); @@ -8710,10 +8759,132 @@ void initrace(void) { addflag(lastrace->flags, F_CANCAST, OT_S_FIREBALL, NA, NA, "pw:10;"); addflag(lastrace->flags, F_CANCAST, OT_S_FLAMEPILLAR, NA, NA, "pw:10;"); addflag(lastrace->flags, F_CANCAST, OT_S_BURNINGWAVE, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANCAST, OT_S_PYROMANIA, NA, NA, "pw:10;"); addflag(lastrace->flags, F_CANWILL, OT_S_FEAR, 30, 30, "pw:6;"); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "unleashes its fiery breath"); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_FEAR, NA, NA, NULL); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_FLAMEPILLAR, NA, NA, "breaths fire into the ground"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_PYROMANIA, NA, NA, "flaps its wings"); + addflag(lastrace->flags, F_CASTCHANCE, 40, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 45, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + + addrace(R_DRAGONWHITE, "white dragon", 400, 'D', C_WHITE, MT_FLESH, RC_DRAGON, "Although white dragons are smaller than other varieties, their icy breath still makes them a formidable threat."); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUGE, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "22d4"); + addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STABILITY, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 16, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 10, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars"); + addflag(lastrace->flags, F_FLEEONHPPCT, 15, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_COLD, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_LORE_DRAGONS, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_LORE_ARCANA, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_LISTEN, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPEECH, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 7, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_COLDRAY, NA, NA, "pw:7;"); + addflag(lastrace->flags, F_CANCAST, OT_S_COLDBURST, NA, NA, "pw:8;"); + addflag(lastrace->flags, F_CANCAST, OT_S_WALLOFICE, NA, NA, "pw:8;"); + addflag(lastrace->flags, F_CASTCHANCE, 40, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "unleashes its icy breath"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_WALLOFICE, NA, NA, "breaths a line of frost along the ground"); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addrace(R_DRAGONWHITEY, "young white dragon", 150, 'D', C_WHITE, MT_FLESH, RC_DRAGON, "Although white dragons are smaller than other varieties, their icy breath still makes them a formidable threat."); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUGE, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "10d4"); + addflag(lastrace->flags, F_ARMOURRATING, 7, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STABILITY, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 8, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 6, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roars"); + addflag(lastrace->flags, F_DTIMMUNE, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_COLD, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_LORE_DRAGONS, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_LISTEN, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPEECH, PR_BEGINNER, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_COLDBURST, NA, NA, "pw:5;"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "unleashes its icy breath"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_WALLOFICE, NA, NA, "breaths a line of frost along the ground"); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 15, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addrace(R_DRAGONWHITEA, "ancient white dragon", 600, 'D', C_WHITE, MT_FLESH, RC_DRAGON, "Although white dragons are smaller than other varieties, their icy breath still makes them a formidable threat."); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUGE, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "32d4"); + addflag(lastrace->flags, F_ARMOURRATING, 16, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STABILITY, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 30, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TAIL, 21, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roars"); + addflag(lastrace->flags, F_FLEEONHPPCT, 15, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_COLD, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_LORE_DRAGONS, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_LORE_ARCANA, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_LISTEN, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPEECH, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 12, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_COLDRAY, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANCAST, OT_S_COLDBURST, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANCAST, OT_S_WALLOFICE, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANCAST, OT_S_SHARDSHOT, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANCAST, OT_S_HAILSTORM, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CASTCHANCE, 40, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "unleashes its icy breath"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_WALLOFICE, NA, NA, "breaths a line of frost along the ground"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_HAILSTORM, NA, NA, "breaths out a blast of hailstones"); addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 45, NA, NA, NULL); addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); @@ -9473,7 +9644,7 @@ void initskills(void) { addskill(SK_EXOTICWEPS, "Exotic Weapons", "Helps you use nunchaku, sais, etc.", 50); addskill(SK_LONGBLADES, "Long Blades", "Helps you use long swords, scimitars, etc.", 50); addskill(SK_POLEARMS, "Polearms", "Helps you use long bladed weapons like halberds.", 50); - addskill(SK_SHORTBLADES, "Short Blades", "Helps you use daggers, short swords, etc.", 50); + addskill(SK_SHORTBLADES, "Short Blades", "Helps you use daggers, gladius', etc.", 50); addskill(SK_STAVES, "Staves", "Helps you use quarterstaffs, staffs, etc.", 50); addskill(SK_UNARMED, "Unarmed Combat", "Helps you fight using your bare hands.", 50); addskilldesc(SK_UNARMED, PR_ADEPT, "^gYour unarmed attacks can now smash wooden objects.^n", B_TRUE); diff --git a/defs.h b/defs.h index f81e9ca..acf05de 100644 --- a/defs.h +++ b/defs.h @@ -908,6 +908,9 @@ enum RACE { R_DRAGONRED, R_DRAGONREDY, R_DRAGONREDA, + R_DRAGONWHITE, + R_DRAGONWHITEY, + R_DRAGONWHITEA, // insects R_BUTTERFLY, R_CENTIPEDE, @@ -1195,6 +1198,7 @@ enum OBTYPE { OT_S_FIREBALL, OT_S_FLAMEPILLAR, OT_S_FLAMEBURST, + OT_S_PYROMANIA, OT_S_SPARK, // -- elemental - ice OT_S_ABSOLUTEZERO, @@ -1363,6 +1367,7 @@ enum OBTYPE { OT_A_POLYREVERT, OT_A_QUIVERINGPALM, OT_A_STEAL, + OT_A_THRUST, // attack up to 2 cells away with a piercing weapon. OT_A_TRAIN, OT_A_TUMBLE, OT_A_WARCRY, // uses F_NOISETEXT -> N_WARCRY if it is there. @@ -1848,6 +1853,10 @@ enum FLAG { F_VALUE, // how much an item is worth (over its base weight+material) F_NOPOINTS, // object is worth 0 points (but might still have a // monetary value) + // for object brands + F_ONLYFOROBTYPE, // brand can only go on obtype v0 + F_ONLYFORDAMTYPE, // brand can only go on obs with damtype v0 + F_ONLYFORWEPSKILL, // brand can only go on obclass v0 // weapon/armour flags F_EQUIPPED, // val0 = where it is equipped. CLEAR WHEN OB MOVED! F_GOESON, // val0 = where it can be equipped. @@ -2063,6 +2072,8 @@ enum FLAG { F_UNARMEDWEP, // this is not a real weapon, ie. claws, teeth etc F_ARMOURPIERCE, // goes through armour F_TWOHANDED, // weapon uses two hands to weild + F_NEEDSSPACE, // weapon needs space to swing - 75% chance of hitting + // a wall if used with < 3 empty cells around you // gun flags F_FIREARM, // this weapon is equipped in bp_secweapon, not _weapon. F_FIRESPEED, // how fast this weapon shoots projectiles @@ -2169,6 +2180,7 @@ enum FLAG { F_DEBUG, // debugging enabled F_ACCURACYMOD, // modify your accuracy by val0 F_PLAYABLE, // player can select to be this race. + F_RACESLAY, // deal 4x damage to creatures of raceclass v0 F_VAMPIRIC, // when on a lf: // successful bite attacks form this lf will heal it // when on an object @@ -3403,6 +3415,11 @@ enum BRAND { BR_TELEKINESIS, BR_TELEPATHY, BR_WEAKNESS, + BR_SLAY_ANIMAL, + BR_SLAY_DRAGON, + BR_SLAY_MAGIC, + BR_SLAY_PLANT, + BR_SLAY_UNDEAD, }; typedef struct brand_s { diff --git a/flag.c b/flag.c index 86ca67c..b589d9d 100644 --- a/flag.c +++ b/flag.c @@ -353,6 +353,14 @@ void copyflag(flagpile_t *dst, flagpile_t *src, enum FLAG id) { void copyflags(flagpile_t *dst, flagpile_t *src, int lifetime) { flag_t *f; for (f = src->first ; f ; f = f->next) { + // omit certain flags + if (lifetime == FROMBRAND) { + if ((f->id == F_ONLYFOROBTYPE) || + (f->id == F_ONLYFORDAMTYPE) || + (f->id == F_ONLYFORWEPSKILL)) { + continue; + } + } addflag_real(dst, f->id, f->val[0], f->val[1], f->val[2], f->text, (lifetime == NA) ? f->lifetime : lifetime, f->known, -1); } diff --git a/io.c b/io.c index 90e7233..dd839ae 100644 --- a/io.c +++ b/io.c @@ -1259,7 +1259,7 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { ot = findot(f->val[0]); if (ot && (!hasflag(ot->flags, F_NOANNOUNCE))) { char buf[BUFLEN]; - snprintf(buf, BUFLEN, "^gYou have learned the ability '%s'.", ot->name); + snprintf(buf, BUFLEN, "^gYou have gained the ability '%s'.", ot->name); /* if (f->val[2] != NA) { char turnbuf[BUFLEN]; @@ -4738,16 +4738,6 @@ char *makedesc_ob(object_t *o, char *retbuf) { strcat(buf, ".\n"); strncat(retbuf, buf, HUGEBUFLEN); - - - - f = hasflag(o->flags, F_ARMOURPIERCE); - if (f && f->known) { - sprintf(buf, "@Armour will not reduce %s damage.\n",(o->amt == 1) ? "its" : "their"); - strncat(retbuf, buf, HUGEBUFLEN); - } - - } // damage if (isarmour(o)) { @@ -5084,6 +5074,55 @@ char *makedesc_ob(object_t *o, char *retbuf) { strncat(retbuf, buf, HUGEBUFLEN); } + f = hasflag(o->flags, F_NEEDSSPACE); + if (f) { + sprintf(buf, "It is ineffective in confined spaces due to its length.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + // show special properties where known + f = hasflag(o->flags, F_ARMOURPIERCE); + if (f && f->known) { + sprintf(buf, "Armour will not reduce %s damage.\n",(o->amt == 1) ? "its" : "their"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_BALANCE); + if (f && f->known) { + sprintf(buf, "It heals weaker enemies, and does extra damage to stronger ones.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_FLAMESTRIKE); + if (f && f->known) { + sprintf(buf, "It ignites fires wherever it hits.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_HEAVYBLOW); + if (f && f->known) { + sprintf(buf, "Its powerful blows knock enemies backwards.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_MERCIFUL); + if (f && f->known) { + sprintf(buf, "It will knock out enemies rather than deal lethal damage.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_REVENGE); + if (f && f->known) { + sprintf(buf, "It does more damage as your HP are lowered.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_RACESLAY); + if (f && f->known) { + raceclass_t *rc; + rc = findraceclass(f->val[0]); + sprintf(buf, "It deals 4x damage against %s.\n",rc->pluralname); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_VAMPIRIC); + if (f && f->known) { + sprintf(buf, "It drains life force from its victims into the weilder.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } // if known, show what it confers for (f = o->flags->first ; f ; f = f->next) { @@ -5393,27 +5432,6 @@ char *makedesc_ob(object_t *o, char *retbuf) { } } - // show special properties where known - f = hasflag(o->flags, F_BALANCE); - if (f && f->known) { - sprintf(buf, "It heals weaker enemies, and does extra damage to stronger ones.\n"); - strncat(retbuf, buf, HUGEBUFLEN); - } - f = hasflag(o->flags, F_FLAMESTRIKE); - if (f && f->known) { - sprintf(buf, "It ignites fires wherever it hits.\n"); - strncat(retbuf, buf, HUGEBUFLEN); - } - f = hasflag(o->flags, F_HEAVYBLOW); - if (f && f->known) { - sprintf(buf, "Its powerful blows knock enemies backwards.\n"); - strncat(retbuf, buf, HUGEBUFLEN); - } - f = hasflag(o->flags, F_REVENGE); - if (f && f->known) { - sprintf(buf, "It does more damage as your HP are lowered.\n"); - strncat(retbuf, buf, HUGEBUFLEN); - } // requirements i = B_FALSE; diff --git a/lf.c b/lf.c index 9b5e639..1281fc7 100644 --- a/lf.c +++ b/lf.c @@ -6700,12 +6700,16 @@ float getstamregen(lifeform_t *lf) { char *getplayername(char *buf) { flag_t *f; - f = hasflag(player->flags, F_NAME); - if (f) { - strcpy(buf, f->text); - } else{ - // should never happen! + if (!player) { strcpy(buf, ""); + } else { + f = hasflag(player->flags, F_NAME); + if (f) { + strcpy(buf, f->text); + } else{ + // should never happen! + strcpy(buf, ""); + } } return buf; @@ -7445,6 +7449,11 @@ void getwantdistance(lifeform_t *lf, lifeform_t *victim, int *min, int *max, int *min = f->val[0]; *max = f->val[1]; } + // if you can thrust, keep your distance + if (cancast(lf, OT_A_THRUST, NULL)) { + if (*min < 2) *min = 2; + if (*max < *min) *max = *min; + } // if you're timid, it means you will only go close if you are // behind them. if (victim && lfhasflag(lf, F_TIMID)) { diff --git a/move.c b/move.c index 18fafd3..876d80e 100644 --- a/move.c +++ b/move.c @@ -2079,14 +2079,16 @@ int initiatemove(lifeform_t *lf, cell_t *cell, int *didmsg) { // too tired? (if we're attacking, leave the 'too tired' message to // the attack code) - if (!attacking && !getstamina(lf)) { - if (isplayer(lf)) { - msg("You are too tired to move!"); + // note: this only impacts the plaeyr + if (!attacking && !getstamina(lf) && isplayer(lf)) { + msg("You are too tired to move!"); + /* } else { // this doesn't count as an action for the player, but it // does for monsters taketime(lf, getmovespeed(lf)); } + */ reason = E_OK; return B_TRUE; } diff --git a/objects.c b/objects.c index 72d02f2..cae847b 100644 --- a/objects.c +++ b/objects.c @@ -6159,7 +6159,6 @@ int ismagical(object_t *o) { switch (o->type->obclass->id) { case OC_SCROLL: switch (o->type->id) { - case OT_GRAPHPAPER: case OT_SCR_NOTHING: // these scrolls are non-magical break; @@ -7199,18 +7198,51 @@ enum DAMTYPE oblastdamtype(object_t *o) { return DT_NONE; } -int brandappliesto(brand_t *om, objecttype_t *ot) { - if (om->bp == BP_WEAPON) { - if (ot->obclass->id == OC_WEAPON) { - return B_TRUE; +int brandappliesto(brand_t *br, objecttype_t *ot) { + flag_t *f; + + if (br->bp == BP_WEAPON) { + if (ot->obclass->id != OC_WEAPON) { + return B_FALSE; } } else { // TODO: how do we differentiate shields from guns? - if (hasflagval(ot->flags, F_GOESON, om->bp, NA, NA, NULL)) { - return B_TRUE; + if (!hasflagval(ot->flags, F_GOESON, br->bp, NA, NA, NULL)) { + return B_FALSE; } } - return B_FALSE; + // other restrictions? + + if (hasflag(br->flags, F_ONLYFOROBTYPE)) { + if (!hasflagval(br->flags, F_ONLYFOROBTYPE, ot->id, NA, NA, NULL)) { + return B_FALSE; + } + } + if (hasflag(br->flags, F_ONLYFORDAMTYPE)) { + enum DAMTYPE dt; + f = hasflag(ot->flags, F_DAM); + if (!f) { + return B_FALSE; + } + dt = f->val[0]; + if (!hasflagval(br->flags, F_ONLYFORDAMTYPE, dt, NA, NA, NULL)) { + return B_FALSE; + } + } + if (hasflag(br->flags, F_ONLYFORWEPSKILL)) { + enum SKILL skid; + + f = hasflag(ot->flags, F_USESSKILL); + if (!f) { + return B_FALSE; + } + skid = f->val[0]; + + if (!hasflagval(br->flags, F_ONLYFORWEPSKILL, skid, NA, NA, NULL)) { + return B_FALSE; + } + } + return B_TRUE; } @@ -12160,6 +12192,25 @@ int geteffecttime(int min, int max, enum BLESSTYPE isblessed) { return howlong; } +// populate retob[] with all fire in the obpile +int getflamingobs(obpile_t *op, object_t **retob, int *nretobs) { + object_t *o; + int num = 0; + + for (o = op->first ; o ; o = o->next) { + int addit = B_FALSE; + if (hasflag(o->flags, F_ONFIRE) || (o->material->id == MT_FIRE)) { + addit = B_TRUE; + } + if (addit && retob) { + retob[num++] = o; + } + } + if (nretobs) *nretobs = num; + return num; +} + + // populate retob[] with ingredents for the given recipe, taken from the given object pile int getingredients(obpile_t *op, recipe_t *rec, object_t **retob, int *retcount, int *retconsume, int *nretobs, int promptformulti) { int i; diff --git a/objects.h b/objects.h index 05bb942..c39ad54 100644 --- a/objects.h +++ b/objects.h @@ -68,6 +68,7 @@ int getcritchance(lifeform_t *lf, object_t *o, lifeform_t *victim); int getdr(object_t *o); int checkcritprotection(lifeform_t *lf, object_t *o); int geteffecttime(int min, int max, enum BLESSTYPE isblessed); +int getflamingobs(obpile_t *op, object_t **retob, int *nretobs); int getingredients(obpile_t *op, recipe_t *rec, object_t **retob, int *retcount, int *retconsume, int *nretobs, int promptformulti); objecttype_t *getlinkspell(object_t *o); enum COLOUR getmaterialcolour(enum MATERIAL mat ); diff --git a/spell.c b/spell.c index c10c2fb..09b8a0d 100644 --- a/spell.c +++ b/spell.c @@ -1830,9 +1830,60 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef // teleport back to initial pos movelf(user, origcell); - if (haslos(player, origcell)) { + if (haslos(player, adjcell)) { + msg("%s swoop%s away!",username,isplayer(user) ? "" : "s"); + needredraw = B_TRUE; + drawlevelfor(player); redraw(); + //if (!isplayer(user)) { + //} } + } else if (abilid == OT_A_THRUST) { + object_t *wep; + char targetname[BUFLEN]; + int badweapon = B_FALSE; + flag_t *damflag; + + if (isswimming(user) && !lfhasflag(user, F_AQUATIC)) { + if (isplayer(user)) msg("You lack the stability for a thrust while swimming."); + return B_TRUE; + } + + wep = getweapon(user); + if (!wep) { + badweapon = B_TRUE; + } else if (getdamtype(wep) != DT_PIERCE) { + badweapon = B_TRUE; + } + damflag = hasflag(wep->flags, F_DAM); + if (!damflag) { + badweapon = B_TRUE; + } + + if (badweapon) { + if (isplayer(user)) msg("You need a long piercing weapon to perform a thrust!" ); + return B_TRUE; + } + + // ask for direction + if (!targcell) { + snprintf(buf, BUFLEN, "Thrust at who (max range 2)?"); + targcell = askcoords(buf, "Thrust->", TT_MONSTER, user, 2, LOF_NEED, B_TRUE); + if (!targcell) { + msg("Cancelled."); + return TRUE; + } + } + + target = targcell->lf; + if (!target) { + if (isplayer(user)) msg("There is nobody there to attack!"); + return B_TRUE; + } + getlfname(target, targetname); + + attacklf(user, target, wep, damflag); + taketime(user, getattackspeed(user)); } else if (abilid == OT_A_TRAIN) { // can we train? if (!user->skillpoints && !lfhasflag(user, F_HASNEWLEVEL)) { @@ -2374,7 +2425,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef object_t *wep; char dirch; char targetname[BUFLEN]; - flag_t *f; + flag_t *f,*damflag; int badweapon = B_FALSE; if (isswimming(user) && !lfhasflag(user, F_AQUATIC)) { @@ -2390,6 +2441,10 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef } else if (!ismeleeweapon(wep) || !isheavyweapon(wep)) { badweapon = B_TRUE; } + damflag = hasflag(wep->flags, F_DAM); + if (!damflag) { + badweapon = B_TRUE; + } if (badweapon) { if (isplayer(user)) msg("You need a heavy weapon (%dkg or more) to perform a heavy blow!", HEAVYWEPKG); @@ -2422,7 +2477,8 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef getlfname(target, targetname); f = addflag(user->flags, F_HEAVYBLOW, B_TRUE, NA, NA, NULL); - attackcell(user, targcell, B_TRUE); + attacklf(user, target, wep, damflag); + taketime(user, getattackspeed(user)); killflag(f); } else if (abilid == OT_A_QUIVERINGPALM) { object_t *wep; @@ -3907,7 +3963,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ // animation anim(caster->cell, targcell, '}', C_GREY); if (isplayer(caster) || cansee(player, caster)) { - msg("%s shoot%s a ray of coldness.",castername,isplayer(caster) ? "" : "s"); + msg("%s shoot%s a blast of ice-cold air.",castername,isplayer(caster) ? "" : "s"); if (seenbyplayer) *seenbyplayer = B_TRUE; } @@ -3922,14 +3978,19 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ if (skillcheck(target, SC_DODGE, 20 + (power*2), 0)) { // miss if (cansee(player, target)) { - msg("A ray of coldness misses %s.",lfname); + msg("A blast of icy air misses %s.",lfname); } } else { + int dam; // hit if (cansee(player, target)) { - msg("A ray of coldness ray hits %s.",lfname); + msg("A blast of icy air hits %s.",lfname); } - losehp(target, roll("3d6"), DT_COLD, caster, "a blast of coldness"); + dam = roll("3d6"); + if (power > 1) { // overcast for dragons + dam += (power-1); + } + losehp(target, roll("3d6"), DT_COLD, caster, "a blast of ice-cold air"); // ray stops here. break; } @@ -7469,6 +7530,52 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ } else { // monsters can't purify things! } + } else if (spellid == OT_S_PYROMANIA) { + int i,donesomething = B_FALSE; + object_t *retob[MAXRECIPEINGREDIENTS]; + int nretobs; + for (i = 0; i < caster->nlos; i++) { + int n; + flag_t *f; + targcell = caster->los[i]; + getflamingobs(targcell->obpile, retob, &nretobs); + for (n = 0 ; n < nretobs; n++) { + donesomething = B_TRUE; + if (retob[n]->material->id == MT_FIRE) { + // large fires get surrounded with small ones + f = hasflag(retob[n]->flags, F_DIECONVERT); + if (f) { + cell_t *retcell[MAXCANDIDATES]; + int nretcells,nn; + getradiuscells(targcell, 1, DT_COMPASS, B_FALSE, LOF_WALLSTOP, B_FALSE, retcell, &nretcells, 90); + for (nn = 0; nn < nretcells; nn++) { + addob(retcell[nn]->obpile, f->text); + } + } else { + // small fires last longer + f = hasflag(retob[n]->flags, F_OBHP); + if (f) { + f->val[1] = pctof(150, f->val[1]); + f->val[0] = f->val[1]; + } + } + } else { + f = hasflag(retob[n]->flags, F_ONFIRE); + if (f) { + addob(targcell->obpile, "small fire"); + } + } + if (haslos(player, targcell)) { + char obname[BUFLEN]; + getobname(retob[n], obname, retob[n]->amt); + msg("%s flare%s up!", obname, (retob[n]->amt == 1) ? "s" : ""); + if (seenbyplayer) *seenbyplayer = B_TRUE; + } + } // end foreach flaming ob + } + if (!donesomething) { + fizzle(caster); + } } else if (spellid == OT_S_QUENCH) { object_t *o,*nexto; int ndone = 0;