- [+] add a bunch of gemstones - worth points

- [+] 'thrust' ability isn't showing up in ABILS
- [+] give slight accuracy penalty when thrusting
- [+] fixed shieldblock difficulty in melee combat
- [+] increased maxstamina
- [+] don't require stamina to move!
- [+] "You hear a roars."
- [+] remove duplicate corpse rot code
- [+] CRASH
    - [+] malloc: *** error for object 0x1349d94f8: incorrect checksum
          for freed object - object was probably modified after being
          freed.
    - [+] #7  0x00000001000f438a in addobject (where=0x134edc060,
          name=0x0, canstack=0, wantlinkholes=-1, forceoid=OT_CLAWS) at
          objects.c:983
          #8  0x00000001000f298d in addobfast (where=0x134edc060,
          oid=OT_CLAWS) at objects.c:409
          #9  0x00000001000b621b in getbestweapon (lf=0x114439ff0) at
          lf.c:5194
          #10 0x00000001000087fa in aiturn (lf=0x114439ff0) at ai.c:1236
    - [+] fixed ?
- [+] instead of everything >=6 being dark, make a CHANCE to be dark
      starting at l6.
- [+] why do i ese gem of seeing so often
    - [+] because i need more types or 'rock'
- [+] have to cook food before eating it?
    - [+] need novice cooking skill for preparecorpse ability
    - [+] otherwise you only get a very small amount of nutrition (10%)
- [+] split ob piles before eating them
- [+] detect poison should detect poison traps
- [+] telling your ally to rest until healed isn't working...
    - [+] wasn't taking injuries or stamina into account.
- [+] change druid spells
    - [+] start with 3 random spells
    - [+] on levelup, select a random nature spell (up to your highest
          level)
This commit is contained in:
Rob Pearce 2011-11-08 01:19:25 +00:00
parent 7cd169637c
commit d5c24cd742
16 changed files with 429 additions and 162 deletions

View File

@ -613,12 +613,12 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag)
// long weapon in an enclosed space?
if (wep && hasflag(wep->flags, F_NEEDSSPACE)) {
if (countcellexits(lf->cell) < 3) {
if (countcellexits(lf->cell, DT_COMPASS) < 3) {
if (pctchance(75)) {
if (isplayer(lf)) {
msg("^wYour %s glances off a nearby wall.", wepname);
msg("^wYour %s glances off a nearby wall.", noprefix(wepname));
} else if (cansee(player, lf)) {
msg("^w%s%s %s glances off a nearby wall.", attackername, getpossessive(attackername), wepname);
msg("^w%s%s %s glances off a nearby wall.", attackername, getpossessive(attackername), noprefix(wepname));
}
//taketime(lf, getattackspeed(lf));
return B_FALSE;
@ -831,7 +831,7 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag)
shield = getshield(victim);
if (shield && cansee(victim, lf)) {
int difficulty;
difficulty = 25 + ((gethitdice(lf) - gethitdice(victim)*3) );
difficulty = 25 + ((gethitdice(lf) - gethitdice(victim))*3 );
if (skillcheck(victim, SC_SHIELDBLOCK, difficulty, 0)) {
char shname[BUFLEN];
// announce

213
data.c
View File

@ -172,6 +172,7 @@ void initjobs(void) {
// initial skills
addflag(lastjob->flags, F_STARTSKILL, SK_ATHLETICS, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_SKILLED, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_COOKING, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_LOCKPICKING, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_TECHUSAGE, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_NOVICE, NA, NULL);
@ -237,6 +238,7 @@ void initjobs(void) {
addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 bullets");
// initial skills
addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_COOKING, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_ATHLETICS, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_FIRSTAID, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_RANGED, PR_ADEPT, NA, NULL);
@ -248,7 +250,6 @@ void initjobs(void) {
addflag(lastjob->flags, F_CANLEARN, SK_BACKSTAB, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CARTOGRAPHY, PR_EXPERT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, PR_SKILLED, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_METALWORK, NA, NA, NULL);
@ -270,6 +271,7 @@ void initjobs(void) {
addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "pair of sandals");
addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "2 sprigs of mistletoe");
// initial skills
addflag(lastjob->flags, F_STARTSKILL, SK_COOKING, PR_BEGINNER, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_LORE_NATURE, PR_SKILLED, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_STAVES, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_ADEPT, NA, NULL);
@ -277,7 +279,6 @@ void initjobs(void) {
addflag(lastjob->flags, F_STARTSKILL, SK_SPEECH, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_SS_NATURE, PR_NOVICE, NA, NULL);
// learnable skills
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_EXOTICWEPS, PR_BEGINNER, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, NA, NA, NULL);
@ -289,7 +290,8 @@ void initjobs(void) {
addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LORE_DRAGONS, PR_BEGINNER, NA, NULL);
// abilities
mayusespellschool(lastjob->flags, SS_NATURE, F_CANCAST);
//mayusespellschool(lastjob->flags, SS_NATURE, F_CANCAST);
addflag(lastjob->flags, F_LEVSPELLSCHOOL, 101, SS_NATURE, B_TRUE, NULL); // new enviromancy spell every 1 level
addflag(lastjob->flags, F_HASPET, NA, NA, NA, "young wolf");
addflag(lastjob->flags, F_PARTVEGETARIAN, B_TRUE, NA, NA, NULL);
addflag(lastjob->flags, F_LEVSKILL, 5, SK_LORE_NATURE, NA, NULL);
@ -382,6 +384,7 @@ void initjobs(void) {
addflag(lastjob->flags, F_STARTSKILL, SK_TECHUSAGE, PR_BEGINNER, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_ADEPT, NA, NULL);
// learnable akills
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CARTOGRAPHY, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL);
@ -425,6 +428,7 @@ void initjobs(void) {
addflag(lastjob->flags, F_STARTSKILL, SK_STEALTH, PR_BEGINNER, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_TECHUSAGE, PR_BEGINNER, NA, NULL);
// learnable skills
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_ARMOUR, PR_NOVICE, NA, NULL); // limit
addflag(lastjob->flags, F_CANLEARN, SK_CARTOGRAPHY, PR_BEGINNER, NA, NULL); // limit
addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, NA, NA, NULL);
@ -473,6 +477,7 @@ void initjobs(void) {
// learnable skills
addflag(lastjob->flags, F_CANLEARN, SK_ATHLETICS, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CARTOGRAPHY, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, PR_EXPERT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_METALWORK, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, NA, NA, NULL);
@ -509,6 +514,7 @@ void initjobs(void) {
// learnable skills
addflag(lastjob->flags, F_CANLEARN, SK_ATHLETICS, PR_EXPERT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_BACKSTAB, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, PR_EXPERT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, PR_SKILLED, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LORE_ARCANA, PR_SKILLED, NA, NULL);
@ -587,6 +593,7 @@ void initjobs(void) {
addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10-20 gold coins");
// initial skills
addflag(lastjob->flags, F_STARTSKILL, SK_AXES, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_COOKING, NA, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_CLUBS, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_SHORTBLADES, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_LONGBLADES, PR_NOVICE, NA, NULL);
@ -601,7 +608,7 @@ void initjobs(void) {
// learnable skills
addflag(lastjob->flags, F_CANLEARN, SK_CARTOGRAPHY, PR_SKILLED, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, PR_ADEPT, NA, NULL); // limit
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_AXES, NA, NA, NULL);
@ -649,6 +656,7 @@ void initjobs(void) {
addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_SEWING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_SPEECH, NA, NA, NULL);
@ -998,6 +1006,7 @@ void initobjects(void) {
addoc(OC_DFEATURE, "Dungeon Features", "Doors, etc.", '\\', C_GREY, RR_RARE);
addoc(OC_FURNITURE, "Furniture", "Various kinds of mundane (or not so mundane) furnishings.", '\\', C_BROWN, RR_COMMON);
addocnoun(lastobjectclass, "furniture");
addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addoc(OC_TERRAIN, "Terrain", "Water, etc.", '\\', C_GREY, RR_NEVER);
addoc(OC_TRAP, "Trap", "Fiendish traps.", '^', C_GREY, RR_RARE);
addocnoun(lastobjectclass, "trap");
@ -1180,43 +1189,8 @@ void initobjects(void) {
addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL);
addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL);
addot(OT_BOULDER, "boulder", "A massive stone boulder.", MT_STONE, 80, OC_ROCK, SZ_HUGE);
addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, "");
addflag(lastot->flags, F_GLYPH, NA, NA, NA, "'");
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL);
addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL);
// addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL);
addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "50-100 stones");
addot(OT_ICICLE, "huge icicle", "A massive ice stalacmite.", MT_ICE, 200, OC_ROCK, SZ_LARGE);
addflag(lastot->flags, F_GLYPH, C_CYAN, NA, NA, "'");
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL);
addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL);
addot(OT_STATUE, "statue", "A stone statue of a monster.", MT_STONE, 80, OC_ROCK, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, "");
addflag(lastot->flags, F_RARITY, H_VILLAGE, 80, NA, "");
addflag(lastot->flags, F_GLYPH, NA, NA, NA, "'");
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); // will be overridden
addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL);
addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "20-50 stones");
addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "a statue");
addot(OT_HOLEINGROUND, "hole in the ground", "A gaping hole in the ground.", MT_NOTHING, 0, OC_DFEATURE, SZ_LARGE);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL);
addflag(lastot->flags, F_GLYPH, C_BLUE, NA, NA, "^");
@ -1461,6 +1435,43 @@ void initobjects(void) {
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some gold");
// rocks
addot(OT_BOULDER, "boulder", "A massive stone boulder.", MT_STONE, 80, OC_ROCK, SZ_HUGE);
addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, "");
addflag(lastot->flags, F_GLYPH, NA, NA, NA, "'");
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL);
addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL);
// addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL);
addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "50-100 stones");
addot(OT_ICICLE, "huge icicle", "A massive ice stalacmite.", MT_ICE, 200, OC_ROCK, SZ_LARGE);
addflag(lastot->flags, F_GLYPH, C_CYAN, NA, NA, "'");
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL);
addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL);
addot(OT_STATUE, "statue", "A stone statue of a monster.", MT_STONE, 80, OC_ROCK, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, "");
addflag(lastot->flags, F_RARITY, H_VILLAGE, 80, NA, "");
addflag(lastot->flags, F_GLYPH, NA, NA, NA, "'");
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); // will be overridden
addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL);
addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "20-50 stones");
addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "a statue");
addot(OT_STONE, "stone", "A medium-sized roundish stone.", MT_STONE, 0.5, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, "");
@ -1468,6 +1479,64 @@ void initobjects(void) {
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL);
// gems
addot(OT_AQUAMARINE, "aquamarine stone", "An aqua-coloured gemstone.", MT_STONE, 0.2, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_WHITE, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 250, NA, NA, NULL);
addot(OT_AMETHYST, "amethyst", "A purple gemstone.", MT_STONE, 0.2, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_MAGENTA, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 15, NA, NA, NULL);
addot(OT_DIAMOND, "diamond", "A sparkling diamond.", MT_STONE, 0.2, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_WHITE, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addot(OT_EMERALD, "emerald", "A deep green gem.", MT_STONE, 0.2, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 650, NA, NA, NULL);
addot(OT_OPAL, "opal", "An amorphous form of silica related to quartz.", MT_STONE, 0.1, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 70, NA, NA, NULL);
addot(OT_PEARL, "pearl", "A small pinkish-white gem.", MT_STONE, 0.1, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_WHITE, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 30, NA, NA, NULL);
addot(OT_RUBY, "ruby", "A large red gem.", MT_STONE, 0.2, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_RED, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 110, NA, NA, NULL);
addot(OT_SAPPHIRE, "sapphire", "A brilliant blue gem.", MT_STONE, 0.2, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_CYAN, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 850, NA, NA, NULL);
addot(OT_TOPAZ, "topaz stone", "A dull blue gem.", MT_STONE, 0.2, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, C_BLUE, NA, NA, "*");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VALUE, 60, NA, NA, NULL);
addot(OT_ASH, "pile of ash", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, NA, NA, NA, ",");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
@ -1479,7 +1548,7 @@ void initobjects(void) {
addflag(lastot->flags, F_GLYPH, NA, NA, NA, ",");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_EXPLODEONDAM, NA, NA, NA, "1d6");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash");
@ -1487,7 +1556,7 @@ void initobjects(void) {
addot(OT_ASHCONCEAL, "pile of concealing powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, NA, NA, NA, ",");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash");
@ -1496,19 +1565,19 @@ void initobjects(void) {
addot(OT_ASHSLEEP, "pile of sleeping powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_GLYPH, NA, NA, NA, ",");
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, "");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash");
addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash");
addot(OT_GEMOFSEEING, "gem of seeing", "Magically enhances your eyesight.", MT_STONE, 1, OC_ROCK, SZ_TINY);
addflag(lastot->flags, F_HOLDCONFER, F_XRAYVIS, 2, NA, NULL);
addflag(lastot->flags, F_HOLDCONFER, F_XRAYVIS, 1, NA, NULL);
addflag(lastot->flags, F_HOLDCONFER, F_SEEINVIS, B_TRUE, NA, NULL);
addflag(lastot->flags, F_HOLDCONFER, F_ENHANCESEARCH, 20, NA, NULL);
addflag(lastot->flags, F_HOLDCONFER, F_DETECTAURAS, B_TRUE, NA, NULL);
addflag(lastot->flags, F_HOLDCONFER, F_DETECTMAGIC, B_TRUE, NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, RR_VERYRARE, NULL);
// godstones
addot(OT_GODSTONEJ, "Godstone of Justice", "An ancient artifact representing the power of justice.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
@ -2265,7 +2334,6 @@ void initobjects(void) {
// l1
addot(OT_S_SPARK, "flambe", "Creates very hot but short lived burst of flame around the target, dealing 1-6 fire damage to creatures and objects.", MT_NOTHING, 0, OC_SPELL, SZ_TINY);
addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL);
addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL);
addflag(lastot->flags, F_TARGETTEDSPELL, TT_MONSTER, NA, NA, NULL);
addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL);
addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL);
@ -3170,7 +3238,7 @@ void initobjects(void) {
addflag(lastot->flags, F_STAMCOST, 1, NA, NA, NULL);
addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL);
addflag(lastot->flags, F_AICASTTOFLEE, ST_ANYWHERE, NA, NA, NULL);
addot(OT_A_COOK, "cook", "Combine food and water into a healthy meals.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY);
addot(OT_A_COOK, "cook", "Combine various foods into a healthy meal.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY);
addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL);
addot(OT_A_DARKWALK, "darkwalk", "Step between the shadows.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY);
addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL);
@ -3220,6 +3288,8 @@ void initobjects(void) {
addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL);
addflag(lastot->flags, F_NOANNOUNCE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, 10, NA, NULL);
addot(OT_A_PREPARECORPSE, "prepare corpse", "Prepare and cook a corpse, making it more nutritious.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY);
addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL);
addot(OT_A_QUIVERINGPALM, "quivering palm", "A deadly palm strike which knocks the molecules in the target's body out of alignment.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY);
addflag(lastot->flags, F_STAMCOST, 10, NA, NA, NULL);
addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL);
@ -4180,7 +4250,7 @@ void initobjects(void) {
addflag(lastot->flags, F_DTVULN, DT_BASH, NA, NA, NULL);
addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL);
addot(OT_WOODENSTOOL, "wooden footstool", "A small, wooden footstool.", MT_WOOD, 5, OC_FURNITURE, SZ_SMALL);
addot(OT_WOODENSTOOL, "wooden footstool", "A small, wooden footstool.", MT_WOOD, 5, OC_FURNITURE, SZ_MEDIUM);
addflag(lastot->flags, F_RARITY, H_ALL, 83, NA, NULL);
addflag(lastot->flags, F_GLYPH, NA, NA, NA, "\\");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
@ -5479,7 +5549,7 @@ void initobjects(void) {
addflag(lastot->flags, F_CRITCHANCE, 8, NA, NA, NULL);
addot(OT_WIZARDSTAFF, "neophyte staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL);
addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL);
addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL);
addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL);
@ -5489,7 +5559,7 @@ void initobjects(void) {
addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch");
addot(OT_WIZARDSTAFF2, "enchanter staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL);
addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL);
addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL);
addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL);
@ -5511,7 +5581,7 @@ void initobjects(void) {
addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch");
addot(OT_WIZARDSTAFF4, "spellbinder staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, NULL);
addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL);
addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL);
addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL);
@ -5522,7 +5592,7 @@ void initobjects(void) {
addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch");
addot(OT_WIZARDSTAFF5, "warlock staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, NULL);
addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL);
addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL);
addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL);
@ -7714,7 +7784,7 @@ void initrace(void) {
addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL);
addflag(lastrace->flags, F_VEGETARIAN, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars");
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roar");
addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL);
addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL);
addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:2d4;");
@ -7741,7 +7811,7 @@ void initrace(void) {
addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL);
addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars");
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roar");
addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL);
addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL);
addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:2d6;");
@ -7768,7 +7838,7 @@ void initrace(void) {
addflag(lastrace->flags, F_MAXATTACKS, 2, 2, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars");
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roar");
addflag(lastrace->flags, F_SEEINDARK, 4, NA, NA, NULL);
addflag(lastrace->flags, F_CRITKNOCKDOWN, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, "");
@ -7846,7 +7916,7 @@ void initrace(void) {
addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL);
addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^scuttling");
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars");
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roar");
addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL);
addflag(lastrace->flags, F_MORALE, 14, NA, NA, NULL);
addrace(R_CHICKEN, "chicken", 0.5, 'c', C_BROWN, MT_FLESH, RC_ANIMAL, "A common farm-yard chicken.");
@ -8537,7 +8607,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roar");
addflag(lastrace->flags, F_ATTACKRANGE, 2, 5, NA, NULL); // maintain distance
addflag(lastrace->flags, F_FLEEONHPPCT, 15, NA, NA, NULL);
addflag(lastrace->flags, F_DTIMMUNE, DT_ELECTRIC, NA, NA, NULL);
@ -8578,7 +8648,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roar");
addflag(lastrace->flags, F_ATTACKRANGE, 2, 5, NA, NULL); // maintain distance
addflag(lastrace->flags, F_DTIMMUNE, DT_ELECTRIC, NA, NA, NULL);
addflag(lastrace->flags, F_STARTSKILL, SK_SS_AIR, PR_ADEPT, NA, NULL);
@ -8619,7 +8689,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roar");
addflag(lastrace->flags, F_FLEEONHPPCT, 15, NA, NA, NULL);
addflag(lastrace->flags, F_ATTACKRANGE, 2, 5, NA, NULL); // maintain distance
addflag(lastrace->flags, F_DTIMMUNE, DT_ELECTRIC, NA, NA, NULL);
@ -8666,7 +8736,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roar");
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);
@ -8707,7 +8777,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roar");
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);
@ -8744,7 +8814,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roar");
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);
@ -8789,7 +8859,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roar");
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);
@ -8829,7 +8899,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roar");
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);
@ -8864,7 +8934,7 @@ void initrace(void) {
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_NOISETEXT, N_GETANGRY, 5, NA, "roars^a roar");
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);
@ -9483,13 +9553,14 @@ void initskills(void) {
addskilldesc(SK_CLIMBING, PR_EXPERT, "-10% accuracy penalty while climbing.", B_FALSE);
addskilldesc(SK_CLIMBING, PR_MASTER, "No accuracy penalty or stamina cost to remain climbing.", B_FALSE);
addskill(SK_COOKING, "Cooking", "Your ability to combine foods into nutritious meals.", 50);
addskilldesc(SK_COOKING, PR_INEPT, " - Note: when cooking, all ingredients must already be recognised.", B_TRUE);
addskilldesc(SK_COOKING, PR_NOVICE, "^gYou now recognise water and rotting food.^n", B_TRUE);
addskilldesc(SK_COOKING, PR_BEGINNER, "^gYou can cook recipes using up to 2 ingredients.", B_TRUE);
addskilldesc(SK_COOKING, PR_ADEPT, "^gYou can cook recipes using up to 3 ingredients.", B_TRUE);
addskilldesc(SK_COOKING, PR_SKILLED, "^gYou can cook recipes using up to 4 ingredients.", B_TRUE);
addskilldesc(SK_COOKING, PR_EXPERT, "^gYou can cook recipes using up to 5 ingredients.", B_TRUE);
addskilldesc(SK_COOKING, PR_MASTER, "^gYou can cook all recipes.", B_TRUE);
addskilldesc(SK_COOKING, PR_INEPT, " - Note: when cooking, all ingredients must already be recognised.", B_FALSE);
addskilldesc(SK_COOKING, PR_NOVICE, "^gYou can now prepare corpses for consumption.", B_FALSE);
addskilldesc(SK_COOKING, PR_BEGINNER, "^gYou now recognise bad food.^n", B_TRUE);
addskilldesc(SK_COOKING, PR_BEGINNER, "^gYou can now cook recipes using up to 2 ingredients.", B_TRUE);
addskilldesc(SK_COOKING, PR_ADEPT, "^gYou can now cook recipes using up to 3 ingredients.", B_TRUE);
addskilldesc(SK_COOKING, PR_SKILLED, "^gYou can now cook recipes using up to 4 ingredients.", B_TRUE);
addskilldesc(SK_COOKING, PR_EXPERT, "^gYou can now cook recipes using up to 5 ingredients.", B_TRUE);
addskilldesc(SK_COOKING, PR_MASTER, "^gYou can now cook all recipes.", B_TRUE);
addskill(SK_EVASION, "Evasion", "Your ability to dodge blows or traps.", 50);
addskilldesc(SK_EVASION, PR_NOVICE, "^gIncreases your EV by 5%.^n", B_FALSE);
addskilldesc(SK_EVASION, PR_BEGINNER, "^gIncreases your EV by 10%.^n", B_FALSE);

Binary file not shown.

21
defs.h
View File

@ -1033,14 +1033,26 @@ enum OBTYPE {
OT_TRAPTELEPORT,
OT_TRAPTRIP,
OT_TRAPWIND,
// rocks / plants
OT_GOLD,
// rocks
OT_STONE,
OT_ASH,
OT_ASHEXPLODE,
OT_ASHCONCEAL,
OT_ASHSLEEP,
OT_GEMOFSEEING,
// gems
OT_AQUAMARINE,
OT_AMETHYST,
OT_DIAMOND,
OT_EMERALD,
OT_OPAL,
OT_PEARL,
OT_RUBY,
OT_SAPPHIRE,
OT_TOPAZ,
// money
OT_GOLD,
// godstones
OT_GODSTONEJ,
// flora
OT_FLOWER,
@ -1365,6 +1377,7 @@ enum OBTYPE {
OT_A_INSPECT,
OT_A_HURRICANESTRIKE,
OT_A_POLYREVERT,
OT_A_PREPARECORPSE,
OT_A_QUIVERINGPALM,
OT_A_STEAL,
OT_A_THRUST, // attack up to 2 cells away with a piercing weapon.
@ -1955,6 +1968,7 @@ enum FLAG {
F_TECHLEVEL, // v0 is a PR_xxx enum for tech usage skill
// what can you do with this object?
F_TAINTED, // will give food poisoning if you eat/drink it
F_PREPARED, // raw meat has been prepared using cooking skill
F_EDIBLE, // you can eat this. val1 = nutrition. 100 = a meal
// -1 means "nutrition is weight x abs(val1)"
// v2 = nutrition left when partially eaten
@ -2645,7 +2659,7 @@ enum FLAG {
F_LEVSPELL, // at level v0, this job gains f_cancast v1.
F_LEVSPELLSCHOOL, // at level v0, this job gains f_cancast for a spell
// of their choice from school v1. if v1 is SS_NONE, they can
// pick form any school they are skilled in.
// pick from any school they are skilled in.
// if v0 is >100, this triggers every (v0-100) levels.
F_LEVFLAG, // at level v0, this job gains flagid v1, flagval0=v2,
// flagtext = text
@ -2996,6 +3010,7 @@ typedef struct map_s {
int id;
region_t *region;
int depth;
int lit;
struct room_s room[MAXROOMS];
int nrooms; // how many rooms on this map
char *name; // name of this map

7
flag.c
View File

@ -207,9 +207,10 @@ flag_t *addflag_real(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3,
updatefpindex(fp);
// notify
if ((gamemode == GM_GAMESTARTED)) {
if (f->pile->owner) {
if (announceflaggain(f->pile->owner, f)) {
if ( ((gamemode == GM_CHARGEN) && isplayer(f->pile->owner)) ||
((gamemode == GM_GAMESTARTED) && announceflaggain(f->pile->owner, f)) ) {
if (gamemode == GM_GAMESTARTED) {
// don't include flags which interrupt will kill!
switch (f->id) {
case F_RUNNING:
@ -225,6 +226,7 @@ flag_t *addflag_real(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3,
addflag(f->pile, F_INTERRUPTED, B_TRUE, NA, NA, NULL);
break;
}
}
f->known = B_TRUE;
if (f->obfrom) {
@ -254,6 +256,7 @@ flag_t *addflag_real(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3,
if (flagcausesredraw(f->pile->owner, f->id)) redrawscreenatend = B_TRUE;
if (flagcausesstatredraw(f->pile->owner, f->id)) redrawstatatend = B_TRUE;
} else if (f->pile->ob) {
if (gamemode == GM_GAMESTARTED) {
if (announceobflaggain(f->pile->ob, f)) {
f->known = B_TRUE;
}

4
io.c
View File

@ -1096,11 +1096,11 @@ int announceflaggain(lifeform_t *lf, flag_t *f) {
char *buf2;
char *p;
if (isdead(player)) {
if (player && isdead(player)) {
return B_FALSE;
}
if (!lf->born) {
if (!lf->born && !isplayer(lf)) {
return B_FALSE;
}

84
lf.c
View File

@ -1720,6 +1720,7 @@ int celltransparentfor(lifeform_t *lf, cell_t *c, int *xray, int *rangemod) {
if (sizediff >= 2) {
if (xray && *xray) {
(*xray) -= (sizediff-1);
if (*xray < 0) *xray = 0;
} else return B_FALSE;
}
}
@ -2834,6 +2835,7 @@ int eat(lifeform_t *lf, object_t *o) {
flag_t *alreadyeating;
enum HUNGER hlev,posthlev;
int stopeating = B_FALSE;
int rawmeat = B_FALSE;
if (hasflag(o->flags, F_DRINKABLE)) {
drinking = B_TRUE;
@ -2890,6 +2892,7 @@ int eat(lifeform_t *lf, object_t *o) {
// get total nutrition
nutrition = getnutrition(o);
if (nutrition == 0) {
// this might happen if you purposely try to eat a potion.
// technically a potion will pass above checks because you can
@ -2912,6 +2915,30 @@ int eat(lifeform_t *lf, object_t *o) {
}
}
// after this point, you ARE going to eat it.
if (o->amt > 1) {
o = splitob(o);
}
// uncooked meat?
if (iscorpse(o) && isplayer(lf)) {
if (!hasflag(o->flags, F_PREPARED)) {
if (getskill(lf, SK_COOKING)) {
int ch;
char ques[BUFLEN];
more();
sprintf(ques,"Really eat %s raw?",obname);
ch = askchar(ques,"yn","y", B_TRUE, B_FALSE);
if (ch != 'y') {
return B_TRUE;
}
}
// limit
if (nutrition > (HUNGERCONST/4)) nutrition = (HUNGERCONST/4);
rawmeat = B_TRUE;
}
}
if (touch(lf, o)) {
taketime(lf, getactspeed(lf));
return B_TRUE;
@ -2954,7 +2981,9 @@ int eat(lifeform_t *lf, object_t *o) {
// announce
if (turnstoeat <= 1) {
char taste[BUFLEN];
if (hasflagval(o->flags, F_CORPSEOF, R_CHICKEN, NA, NA, NULL)) {
if (rawmeat) {
sprintf(taste, "The raw meat tastes disgusting!");
} else if (hasflagval(o->flags, F_CORPSEOF, R_CHICKEN, NA, NA, NULL)) {
sprintf(taste, "Tastes like chicken!");
} else if (f->val[1] >= 20) {
sprintf(taste, "Yum!");
@ -2963,16 +2992,15 @@ int eat(lifeform_t *lf, object_t *o) {
}
if (alreadyeating) {
if (isplayer(lf)) {
msg("You finish %s.%s", drinking ? "drinking" : "eating",
(f->val[1] >= 20) ? " Yum!" : "");
msg("You finish %s.", drinking ? "drinking" : "eating");
if (strlen(taste)) msg("%s", taste);
} else if (cansee(player, lf)) {
msg("%s finishes %s.", lfname, drinking ? "drinking" : "eating");
}
} else {
if (isplayer(lf)) {
msg("You %s %s.%s", drinking ? "drink" : "eat", obname,
(f->val[1] >= 20) ? " Yum!" : "");
msg("You %s %s.", drinking ? "drink" : "eat", obname);
if (strlen(taste)) msg("%s", taste);
} else if (cansee(player, lf)) {
msg("%s %s %s.", lfname, drinking ? "drinks" : "eats", obname);
}
@ -5173,9 +5201,11 @@ object_t *getbestweapon(lifeform_t *lf) {
object_t *bestwep = NULL;
//int bestmaxdam = -999;
object_t *o;
obpile_t *op = NULL;
flag_t *retflag[MAXCANDIDATES];
int nretflags;
obpile_t *op = NULL;
op = addobpile(NULL, NULL, NULL);
bestwep = getweapon(lf);
if (!bestwep) {
@ -5185,10 +5215,6 @@ object_t *getbestweapon(lifeform_t *lf) {
for (i = 0; i < nretflags; i++) {
objecttype_t *ot;
if (!op) {
op = addobpile(NULL, NULL, NULL);
}
ot = findot(retflag[i]->val[0]);
if (ot) {
o = addobfast(op, ot->id);
@ -5223,10 +5249,7 @@ object_t *getbestweapon(lifeform_t *lf) {
bestwep = NULL;
}
if (op) {
killobpile(op);
}
return bestwep;
}
@ -6248,7 +6271,7 @@ float getmaxstamina(lifeform_t *lf) {
int slev;
slev = getskill(lf, SK_ATHLETICS);
limit(&slev, 1, NA);
stam = (getattr(lf, A_CON) / 3) * (slev);
stam = (getattr(lf, A_CON) / 3) * (slev+1);
if (lfhasflagval(lf, F_INJURY, IJ_LUNGCOLLAPSED, NA, NA, NULL)) {
limit(&stam, NA, 2);
}
@ -7927,6 +7950,11 @@ flag_t *giveskill(lifeform_t *lf, enum SKILL id) {
if (isplayer(lf)) {
makeknown(OT_POT_WATER);
}
newf = hasflagval(lf->flags, F_CANWILL, OT_A_PREPARECORPSE, NA, NA, NULL);
if (!newf) {
newf = addflag(lf->flags, F_CANWILL, OT_A_PREPARECORPSE, NA, NA, NULL);
newf->lifetime = FROMSKILL;
}
} else if (id == SK_LORE_ARCANA) {
newf = hasflagval(lf->flags, F_CANWILL, OT_A_INSPECT, NA, NA, NULL);
if (!newf) {
@ -8412,6 +8440,18 @@ int hasfreeaction(lifeform_t *lf) {
return B_TRUE;
}
int hashealableinjuries(lifeform_t *lf) {
flag_t *retflag[MAXCANDIDATES];
int nretflags,i;
int injurycount = 0;
// has injuries which can heal?
getflags(lf->flags, retflag, &nretflags, F_INJURY, F_NONE);
for (i = 0; i < nretflags; i++) {
if (retflag[i]->lifetime > 0) injurycount++;
}
return injurycount;
}
job_t *hasjob(lifeform_t *lf, enum JOB job) {
job_t *j = NULL;
if (lfhasflagval(lf, F_JOB, job, NA, NA, NULL)) {
@ -11061,7 +11101,7 @@ int losehp_real(lifeform_t *lf, int amt, enum DAMTYPE damtype, lifeform_t *froml
// "while xxx"
strcpy(buf2, "");
if ((countcellexits(lf->cell) == 1) && fromlf && (getcelldist(fromlf->cell, lf->cell) == 1)) {
if ((countcellexits(lf->cell, DT_COMPASS) == 1) && fromlf && (getcelldist(fromlf->cell, lf->cell) == 1)) {
strcat(buf2, "^while cornered");
}
if (!hasfreeaction(lf)) {
@ -12754,7 +12794,9 @@ int sayphrase(lifeform_t *lf, enum SAYPHRASE what, int volume, int val0, char *t
if (cansee(player, lf)) {
switch (rnd(1,3)) {
case 1: snprintf(buf, BUFLEN, "I'm attacking %s!", text); break;
case 2: snprintf(buf, BUFLEN, "%s is mine!", text); break;
case 2: snprintf(buf, BUFLEN, "%s is mine!", text);
buf[0] = toupper(buf[0]);
break;
case 3: snprintf(buf, BUFLEN, "I'll take care of %s!", text); break;
}
} else {
@ -12781,7 +12823,9 @@ int sayphrase(lifeform_t *lf, enum SAYPHRASE what, int volume, int val0, char *t
case SP_ALLY_TARGETKILL:
switch (rnd(1,4)) {
case 1: snprintf(buf, BUFLEN, "Got it!"); break;
case 2: snprintf(buf, BUFLEN, "%s one, %s zero!", lf->race->name, noprefix(text)); break;
case 2: snprintf(buf, BUFLEN, "%s one, %s zero!", lf->race->name, noprefix(text));
buf[0] = toupper(buf[0]);
break;
case 3: snprintf(buf, BUFLEN, "Pow!"); break;
case 4: snprintf(buf, BUFLEN, "Take that!"); break;
}
@ -16174,10 +16218,12 @@ int rest(lifeform_t *lf, int onpurpose) {
}
// allies should wake up once healed
if (areallies(player, lf) && !isplayer(lf)) {
if ((lf->hp >= lf->maxhp) && (lf->mp >= getmaxmp(lf))) {
if ((lf->hp >= lf->maxhp) && (lf->mp >= getmaxmp(lf)) && (getstamina(lf) >= getmaxstamina(lf))) {
if (!hashealableinjuries(lf)) {
killflagsofid(lf->flags, F_ASLEEP);
}
}
}
} // end if !poisoned
if (statdirty || needredraw) {

1
lf.h
View File

@ -242,6 +242,7 @@ map_t *gotolev(lifeform_t *lf, int depth, object_t *fromstairs);
int gotosleep(lifeform_t *lf, int onpurpose);
flag_t *hasbleedinginjury(lifeform_t *lf, enum BODYPART bp);
int hasfreeaction(lifeform_t *lf);
int hashealableinjuries(lifeform_t *lf);
job_t *hasjob(lifeform_t *lf, enum JOB job);
void inc_quad_range(enum QUADRANT *start, enum QUADRANT *end, int howmuch);
int injure(lifeform_t *lf, enum BODYPART where, enum DAMTYPE damtype);

56
map.c
View File

@ -168,6 +168,7 @@ map_t *addmap(void) {
}
a->flags = addflagpile(NULL, NULL);
a->beingcreated = B_TRUE;
a->lit = B_TRUE;
a->habitat = findhabitat(H_DUNGEON); // default!!!
a->lastplayervisit = -1;
a->nfixedrooms = 0;
@ -296,11 +297,13 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int
}
}
}
// monsters who on dark levels can always see in the dark
if (!islit(lf->cell) && !lfhasflag(lf, F_SEEINDARK)) {
// nonhuman monsters who on dark levels can always see in the dark
if (!lf->cell->map->lit && !lfhasflag(lf, F_SEEINDARK)) {
if (getraceclass(lf) != RC_HUMANOID) {
addflag(lf->flags, F_SEEINDARK, rnd(3,5), NA, NA, NULL);
}
}
}
// appears in groups?
if (db) dbtime("handling groups");
@ -337,9 +340,11 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int
if (lfhasflag(lf, F_ASLEEP)) {
addflag(newlf->flags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL);
}
if (!islit(newlf->cell) && !lfhasflag(newlf, F_SEEINDARK)) {
if (!newlf->cell->map->lit && !lfhasflag(newlf, F_SEEINDARK)) {
if (getraceclass(newlf) != RC_HUMANOID) {
addflag(newlf->flags, F_SEEINDARK, rnd(3,5), NA, NA, NULL);
}
}
// minions never have certain flags.
killflagsofid(newlf->flags, F_DEMANDSBRIBE);
@ -380,9 +385,11 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int
newlf->born = B_FALSE;
if (lfhasflag(lf, F_ASLEEP)) addflag(newlf->flags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL);
if (!islit(newlf->cell) && !lfhasflag(newlf, F_SEEINDARK)) {
if (!newlf->cell->map->lit && !lfhasflag(newlf, F_SEEINDARK)) {
if (getraceclass(newlf) != RC_HUMANOID) {
addflag(newlf->flags, F_SEEINDARK, rnd(3,5), NA, NA, NULL);
}
}
newlf->born = B_TRUE;
}
}
@ -821,7 +828,7 @@ int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, in
// if there is only one way out of the adjacent empty cell, and
// walls to either side of the potential door location, then
// always add a door
if ((countcellexits(newcell) == 1) && wallstoleftright(newcell, d)) {
if ((countcellexits(newcell, DT_ORTH) == 1) && wallstoleftright(newcell, d)) {
if (rnd(1,100) <= doorpct) {
makedoor(cell[i], dooropenchance);
} else {
@ -1543,7 +1550,8 @@ void calclight(map_t *map) {
makelit(c, L_PERMLIGHT, -1);
}
} else {
if ((map->depth <= 5) && (c->lit != L_PERMDARK)) {
//if ((map->depth <= 5) && (c->lit != L_PERMDARK)) {
if (map->lit && (c->lit != L_PERMDARK)) {
makelit(c, L_PERMLIGHT, -1);
}
}
@ -1640,7 +1648,7 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int
// is this cell adjacent to an empty cell and not a
// corner (ie. a valid door location)
if (countcellexits(cell)) {
if (countcellexits(cell, DT_ORTH)) {
score++;
if ( ((ry == y) && (rx == x)) ||
((ry == y) && (rx == (x+w-1))) ||
@ -1655,7 +1663,7 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int
// is this cell empty itself?
if (!cell->type->solid) score += 3;
// avoid being adjacent to other room walls
if (countcellexits(cell)) score++;
if (countcellexits(cell, DT_ORTH)) score++;
score += (countadjrooms(cell)*3);
@ -1772,12 +1780,21 @@ int countadjwalls(cell_t *cell) {
return walls;
}
int countcellexits(cell_t *cell) {
int countcellexits(cell_t *cell, int dirtype) {
int d;
int exits = 0;
int start,end;
cell_t *newcell;
assert(cell);
for (d = D_N; d < MAXDIR_ORTH; d++) {
if (dirtype == DT_ORTH) {
start = D_N;
end = D_W;
} else { // ie. dt_compass
start = DC_N;
end = DC_NW;
}
for (d = start; d <= end; d++) {
newcell = getcellindir(cell, d);
if (newcell && !newcell->type->solid) {
exits++;
@ -1855,6 +1872,19 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_
}
// is the map lit?
if (depth <= 5) {
map->lit = B_TRUE;
} else {
int chance;
chance = (depth - 5) * 10;
if (pctchance(chance)) {
map->lit = B_FALSE;
} else {
map->lit = B_TRUE;
}
}
// what kind of cells will 'empty' ones be?
emptycell = map->habitat->emptycelltype;
solidcell = map->habitat->solidcelltype;
@ -1953,7 +1983,7 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_
for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) {
cell = getcellat(map, x, y);
if (!cell->type->solid && countcellexits(cell) == 1) {
if (!cell->type->solid && countcellexits(cell, DT_ORTH) == 1) {
// dead end - maybe make loop from here
if (rnd(1,100) <= looppct) {
int connected = B_FALSE;
@ -3446,7 +3476,7 @@ int linkexits(map_t *m, int roomid) {
int ncorridors = 0,d;
// if exit is solid and COMPLETELY surrounded by solid, ignore it.
if (c->type->solid && (countcellexits(c) == 0)){
if (c->type->solid && (countcellexits(c, DT_ORTH) == 0)){
if (db) dblog("cell is solid and surrounded by solids. ignoring.");
continue;
}
@ -5430,7 +5460,7 @@ int remove_deadends(map_t *m, int howmuch) {
for (n = 0; n < m->w * m->h; n++) {
cell_t *c;
c = m->cell[n];
if (countcellexits(c) == 1) {
if (countcellexits(c, DT_ORTH) == 1) {
// erase this cell
clearcell(c);
setcelltype(c, solidcell);

2
map.h
View File

@ -43,7 +43,7 @@ int countadjcellsoftype(cell_t *cell, int id);
int countadjrooms(cell_t *cell);
int countadjcellswithflag(cell_t *cell, enum FLAG fid, int dirtype);
int countadjwalls(cell_t *cell);
int countcellexits(cell_t *cell);
int countcellexits(cell_t *cell, int dirtype);
int countcellexitsfor(lifeform_t *lf);
int countmapobs(map_t *m, enum OBTYPE oid);
void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);

10
move.c
View File

@ -2080,18 +2080,18 @@ 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)
// note: this only impacts the plaeyr
/*
if (!attacking && !getstamina(lf) && isplayer(lf)) {
msg("You are too tired to move!");
/*
} else {
//} else {
// this doesn't count as an action for the player, but it
// does for monsters
taketime(lf, getmovespeed(lf));
}
*/
// taketime(lf, getmovespeed(lf));
//}
reason = E_OK;
return B_TRUE;
}
*/
// checks which only happen if we're MOVING (ie not attacking)
// demon in pentagram

14
nexus.c
View File

@ -284,7 +284,19 @@ int main(int argc, char **argv) {
}
givejob(player, j->id);
// extra choices for some jobs
if (j->id == J_WIZARD) {
if (j->id == J_DRUID) {
enum OBTYPE spell;
int i;
for (i = 0;i < 3; i++) {
// pick a spell which you don't already have...
spell = getrandomspellfromschool(SS_NATURE, 1);
while (cancast(player, spell, NULL)) {
spell = getrandomspellfromschool(SS_NATURE, 1);
}
// you can now cast it.
addflag(player->flags, F_CANCAST, spell, NA, NA, NULL);
}
} else if (j->id == J_WIZARD) {
skill_t *sk;
object_t *sb1,*sb2;
initprompt(&prompt, "Select your primary spell specialty:");

View File

@ -2905,6 +2905,7 @@ objecttype_t *findotn(char *name) {
modname = strrep(modname, "puddles ", "puddle ", NULL);
modname = strrep(modname, "puffs ", "puff ", NULL);
modname = strrep(modname, "rings ", "ring ", NULL);
modname = strrep(modname, "rubies", "ruby", NULL);
modname = strrep(modname, "scrolls ", "scroll ", NULL);
modname = strrep(modname, "sets ", "set ", NULL);
modname = strrep(modname, "splashes ", "splash ", NULL);
@ -4850,13 +4851,17 @@ char *getobconditionname(object_t *o, char *buf) {
}
if (iscorpse(o)) {
strcpy(buf, "");
if (hasflag(o->flags, F_PREPARED)) {
strcat(buf, "cooked");
}
// you only know it's rotting if you are smart or a cook
if (isrotting(o) &&
( (iqb >= AT_GTAVERAGE) || getskill(player, SK_COOKING)) ) {
snprintf(buf, BUFLEN, "rotting");
} else {
strcpy(buf, "");
if (strlen(buf)) strcat(buf, " ");
strcat(buf, "rotting");
}
} else {
if (iqb >= AT_LOW) {
pct = getobhppct(o);
@ -11465,6 +11470,7 @@ void timeeffectsob(object_t *o) {
}
// corpses rot away...
/*
if ((f->id == F_EDIBLE) && (o->type->obclass->id == OC_CORPSE)) {
f->val[1] -= 4;
if (f->val[1] < 0) {
@ -11472,6 +11478,7 @@ void timeeffectsob(object_t *o) {
addflag(o->flags, F_TAINTED, B_TRUE, NA, NA, NULL);
}
}
*/
if (f->id == F_RECHARGE) {
flag_t *f2;

2
save.c
View File

@ -316,6 +316,7 @@ map_t *loadmap(char *basefile) {
fscanf(f, "seed:%u\n",&m->seed); // seed
fscanf(f, "lastplayervisit:%ld\n",&m->lastplayervisit);
fscanf(f, "dims:%d,%d\n",&m->w, &m->h); // map dimensons
fscanf(f, "lit:%d\n",&m->lit);
fscanf(f, "nextmaps:\n");
for (i = 0; i < MAXDIR_ORTH; i++) {
fscanf(f, "%d\n",&m->nextmap[i]); // map dimensons
@ -880,6 +881,7 @@ int savemap(map_t *m) {
fprintf(f, "seed:%u\n",m->seed); // seed
fprintf(f, "lastplayervisit:%ld\n",m->lastplayervisit);
fprintf(f, "dims:%d,%d\n",m->w, m->h); // map dimensons
fprintf(f, "lit:%d\n",m->lit); // seed
fprintf(f, "nextmaps:\n");
for (i = 0; i < MAXDIR_ORTH; i++) {
fprintf(f, "%d\n",m->nextmap[i] ); // map dimensons

88
spell.c
View File

@ -1840,6 +1840,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
}
} else if (abilid == OT_A_THRUST) {
object_t *wep;
flag_t *f;
char targetname[BUFLEN];
int badweapon = B_FALSE;
flag_t *damflag;
@ -1882,7 +1883,9 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
}
getlfname(target, targetname);
f = addflag(user->flags, F_ACCURACYMOD, -10, NA, NA, NULL);
attacklf(user, target, wep, damflag);
killflag(f);
taketime(user, getattackspeed(user));
} else if (abilid == OT_A_TRAIN) {
// can we train?
@ -2156,6 +2159,63 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
// this call will also remove this ability...
setrace(user, f->val[0], B_TRUE);
} else if (abilid == OT_A_PREPARECORPSE) {
object_t *o,*corpse = NULL;
char obname[BUFLEN];
if (!isplayer(user)) return B_TRUE;
// check ground first...
for (o = user->cell->obpile->first ; o ; o = o->next) {
if (iscorpse(o) && !hasflag(o->flags, F_PREPARED)) {
char yn;
char ques[BUFLEN];
getobname(o, obname, o->amt);
sprintf(ques, "There %s %s here. Prepare it?", (o->amt == 1) ? "is" : "are",obname);
yn = askchar(ques, "yn","n", B_TRUE, B_FALSE);
if (yn == 'y') {
corpse = o;
break;
}
}
}
if (!corpse) {
initprompt(&prompt, "What will you prepare (ESC to cancel)?");
for (o = user->pack->first ; o ; o = o->next) {
if (iscorpse(o) && !hasflag(o->flags, F_PREPARED)) {
getobname(o, obname, o->amt);
addchoice(&prompt, o->letter, obname, NULL, o, NULL);
}
}
addchoice(&prompt, '-', "(cancel)", NULL, NULL, NULL);
getchoice(&prompt);
corpse = (object_t *)prompt.result;
if (!corpse) {
msg("Cancelled.");
return B_TRUE;
}
}
if (!corpse) {
msg("There are no corpses here to prepare.");
return B_TRUE;
}
if (corpse->amt > 1) {
corpse = splitob(corpse);
}
if (corpse->pile->owner == user) {
// add flag before getting the name
addflag(corpse->flags, F_PREPARED, B_TRUE, NA, NA, NULL);
getobname(corpse, obname, corpse->amt);
msgnocap("%c - %s.", corpse->letter, obname);
} else {
// add flag after getting the name
getobname(corpse, obname, corpse->amt);
msg("You cook %s.", obname);
addflag(corpse->flags, F_PREPARED, B_TRUE, NA, NA, NULL);
}
} else if (abilid == OT_A_PRAY) {
lifeform_t *lf;
if (!isplayer(user)) return B_FALSE;
@ -4480,6 +4540,14 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
isdecayed = B_TRUE;
} else if (o->type->id == OT_POT_POISON) {
ispoisoned = B_TRUE;
} else if ((o->type->id == OT_TRAPARROWP) ||
(o->type->id == OT_TRAPNEEDLEP) ||
(o->type->id == OT_TRAPGAS)) {
char obname[BUFLEN];
getobname(o, obname, o->amt);
msg("%s %s revealed!", obname, (o->amt == 1) ? "is" : "are");
npoisoned++;
killflagsofid(o->flags, F_SECRET);
} else {
for (f = o->flags->first ; f ; f = f->next) {
if (f->id == F_POISONED) {
@ -4492,6 +4560,18 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
break;
}
}
f = hasflag(o->flags, F_TRAPPED);
if (f) {
if ((f->val[0] == OT_TRAPARROWP) ||
(f->val[0] == OT_TRAPNEEDLEP) ||
(f->val[0] == OT_TRAPGAS)) {
char obname[BUFLEN];
getobname(o, obname, o->amt);
msg("A poison trap on %s is revealed!", obname);
npoisoned++;
f->val[2] = B_TRUE;
}
}
}
@ -7509,9 +7589,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
donesomething = B_TRUE;
}
f = hasflag(o->flags, F_TAINTED);
if (f) {
killflag(f);
if (killflagsofid(o->flags, F_TAINTED)) {
donesomething = B_TRUE;
}
}
@ -9825,8 +9903,8 @@ int getspellpower(lifeform_t *lf, enum OBTYPE spellid) {
// this check doesn't apply for monsters.
if (isplayer(lf)) {
int maxspelllevel = MAXSPELLLEV;
if (hasjob(lf, J_DRUID) && (school == SS_NATURE)) {
} else if ((school == SS_ALLOMANCY) || (school == SS_MENTAL)) {
// if (hasjob(lf, J_DRUID) && (school == SS_NATURE)) {
if ((school == SS_ALLOMANCY) || (school == SS_MENTAL)) {
} else {
switch (schoolskill) {
case PR_INEPT: maxspelllevel = 0; break;

2
text.c
View File

@ -1113,6 +1113,8 @@ char *makeplural(char *text) {
if (rv) return newtext;
newtext = strrep(newtext, "ring ", "rings ", &rv);
if (rv) return newtext;
newtext = strrep(newtext, "ruby", "rubies", &rv);
if (rv) return newtext;
newtext = strrep(newtext, "scroll ", "scrolls ", &rv);
if (rv) return newtext;
newtext = strrep(newtext, "splash ", "splashes ", &rv);