- [+] "really attack the helpless something?"

- [+] don't show this message if we can't see iT!
    - [+] also dont count this as a peaceful attack if we can't see it.
- [+] missiles missing you should interrupt training!
- [+] Why does monk acuracy start at -4?!
- [+] godstone of destruction (hammer )
- [+] godstone of life (heart ?)
- [+] godstone of mercy (flower?)
- [+] revenge/theft (glove?)
- [+] godstone of purity (orb ?)
- [+] death: of death. (skull ?)
    - [+] casts infinite death
- [+] nature: of Nature (seed ?)
    - [+] all plants become peaceful
    - [+] all animals become peaceful
    - [+] cure all diseases
    - [+] quench all fires
    - [+] flowers grow everywhere
    - [+] summon treants ?
- [+] battle: of Battle (make this a horn?)
    - [+] remove all curses on equipped wep/arm.
    - [+] bless weapon (if not already done)
    - [+] nullify all other lfs
    - [+] super speed attacks ?
    - [+] warriors appear
- [+] magic: of Magic (crown ?)
    - [+] restore all mp
    - [+] learn any spell
    - [+] identify all objects
- [+] make Lavax be playable
- [+] make Fishfolk be playable
- [+] fix bug with wand lof
- [+] reduce rarity of wands
- [+] getrandomobwithflag()
- [+] fix big memleak bug (allocating map cells twice)
- [+] infinite loop on win game by defeating a god.
- [+] klikirak shouldn't make fire when on plane of gods/
- [+] createhabitat shouldn't be allowed to blank pre-vault  (ie.
      locked) cells
- [+] bug: wasn't any lfs in realm of gods
- [+] master vault
    - [+] bottom of dungeon has link to "vaults".
    - [+] vault stairs needs a key to open it. (special stair type)
    - [+] stair type:
        - [+] metal hatch leading down
        - [+] metal ladder leading up
    - [+] add new habitat
    - [+] add new branch
    - [+] algorithm for making h_vault level:
        - [+] start with everything a wall
        - [+] place x number of random rooms or vaults with tag:vault
            - [+] rooms can't overlap
            - [+] rooms should be fairly small
            - [+] IMPORTANT: rooms can't be further than 2 (3?) cells
                  away from other rooms
        - [+] every room has locked doors (never open entrances)
        - [+] then go through, and cell which has a room cell near it
              becomes empty
        - [+] problems:
            - [+] rooms have no doors!
            - [+] rooms are too small!!
        - [+] populate with monsters (f_rarity)
        - [+] more chance of "guard" jobs
        - [+] automatically place chests
    - [+] 3 levels with:
        - [+] 1 staircase up/down form each
        - [+] down stairs require key to open.
    - [+] first level of vaults: outer vaults
        - [+] antechamber with vault guardians
    - [+] second level: inner vaults
    - [+] last level: master vault
        - [+] inner chamber with all the godstones
        - [+] once you pick up one godstone, the others vanish.
This commit is contained in:
Rob Pearce 2012-04-27 01:23:14 +00:00
parent a6942a58c5
commit 435b374c25
19 changed files with 997 additions and 285 deletions

310
data.c
View File

@ -485,8 +485,9 @@ void initjobs(void) {
addjob(J_MONK, "Monk", "A life of strict self-discipline from an early age makes Monks masters of unarmed combat. This discipline extends to their minds, sometimes allowing them to develop powerful psionic abilities over time. On the downside, they are useless with most weapons and are strict vegetarians."); addjob(J_MONK, "Monk", "A life of strict self-discipline from an early age makes Monks masters of unarmed combat. This discipline extends to their minds, sometimes allowing them to develop powerful psionic abilities over time. On the downside, they are useless with most weapons and are strict vegetarians.");
// stats // stats
addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 5, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 5, NA, NULL);
addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 10, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 20, NA, NULL);
addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 10, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 15, NA, NULL);
addflag(lastjob->flags, F_JOBATTRMOD, A_IQ, 5, NA, NULL);
addflag(lastjob->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne"); // ie. select addflag(lastjob->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne"); // ie. select
// initial objects // initial objects
addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "robe"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "robe");
@ -501,14 +502,14 @@ void initjobs(void) {
addflag(lastjob->flags, F_STARTSKILL, SK_COOKING, PR_BEGINNER, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_COOKING, PR_BEGINNER, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_EVASION, PR_NOVICE, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_EVASION, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_UNARMED, PR_NOVICE, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_UNARMED, PR_BEGINNER, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_SS_MENTAL, PR_NOVICE, NA, NULL);
addflag(lastjob->flags, F_STARTSKILL, SK_STAVES, PR_NOVICE, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_STAVES, PR_NOVICE, NA, NULL);
// learnable skills // learnable skills
addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_EXOTICWEPS, PR_BEGINNER, NA, NULL); // limit addflag(lastjob->flags, F_CANLEARN, SK_EXOTICWEPS, PR_BEGINNER, NA, NULL); // limit
addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_SS_MENTAL, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_SEWING, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_SEWING, NA, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_STEALTH, PR_ADEPT, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_STEALTH, PR_ADEPT, NA, NULL);
addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL);
@ -521,6 +522,7 @@ void initjobs(void) {
// gained abilities // gained abilities
// somewhere: slow falling when next to walls // somewhere: slow falling when next to walls
// somehwere: alertness when sleeping // somehwere: alertness when sleeping
addflag(lastjob->flags, F_LEVSKILL, 2, SK_SS_MENTAL, NA, NULL);
addflag(lastjob->flags, F_LEVFLAG, 2, F_MPDICE, 1, NULL); addflag(lastjob->flags, F_LEVFLAG, 2, F_MPDICE, 1, NULL);
// 2: body control - low metabolism // 2: body control - low metabolism
addflag(lastjob->flags, F_LEVSPELL, 3, OT_S_LOWERMETAB, NA, NULL); addflag(lastjob->flags, F_LEVSPELL, 3, OT_S_LOWERMETAB, NA, NULL);
@ -1375,6 +1377,9 @@ void initobjects(void) {
addflag(lastmaterial->flags, F_DTVULN, DT_COLD, NA, NA, NULL); addflag(lastmaterial->flags, F_DTVULN, DT_COLD, NA, NA, NULL);
addmaterial(MT_GOLD, "gold", 16); addmaterial(MT_GOLD, "gold", 16);
addflag(lastmaterial->flags, F_HARDNESS, 3, NA, NA, NULL); addflag(lastmaterial->flags, F_HARDNESS, 3, NA, NA, NULL);
addmaterial(MT_DURANITE, "duranite", 20);
addflag(lastmaterial->flags, F_DTIMMUNE, DT_ALL, NA, NA, NULL);
addflag(lastmaterial->flags, F_HARDNESS, 20, NA, NA, NULL);
// object classes // object classes
addoc(OC_BUILDING, "Buildings", "Shops, etc.", '_', C_GREY, RR_RARE); addoc(OC_BUILDING, "Buildings", "Shops, etc.", '_', C_GREY, RR_RARE);
@ -1407,7 +1412,7 @@ void initobjects(void) {
//addflag(lastobjectclass->flags, F_MATCONVERTTEXT, MT_WATER, NA, NA, "goes soggy"); //addflag(lastobjectclass->flags, F_MATCONVERTTEXT, MT_WATER, NA, NA, "goes soggy");
//addflag(lastobjectclass->flags, F_MATCONVERTTEXTPL, MT_WATER, NA, NA, "go soggy"); //addflag(lastobjectclass->flags, F_MATCONVERTTEXTPL, MT_WATER, NA, NA, "go soggy");
addoc(OC_WAND, "Wands", "A limited-use magical wand which casts the imbued spell.", '/', C_GREY, RR_VERYRARE); addoc(OC_WAND, "Wands", "A limited-use magical wand which casts the imbued spell.", '/', C_GREY, RR_RARE);
addocnoun(lastobjectclass, "wand"); addocnoun(lastobjectclass, "wand");
addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastobjectclass->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); addflag(lastobjectclass->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL);
@ -1649,6 +1654,7 @@ void initobjects(void) {
addflag(lastot->flags, F_STENCH, B_TRUE, 1, NA, NULL); addflag(lastot->flags, F_STENCH, B_TRUE, 1, NA, NULL);
addflag(lastot->flags, F_CANBELOCKED, 50, 0, NA, NULL); addflag(lastot->flags, F_CANBELOCKED, 50, 0, NA, NULL);
addot(OT_GRATINGROOF, "drain in the roof", "An open draining grate set into the roof.", MT_NOTHING, 0, OC_DFEATURE, SZ_LARGE); addot(OT_GRATINGROOF, "drain in the roof", "An open draining grate set into the roof.", MT_NOTHING, 0, OC_DFEATURE, SZ_LARGE);
addflag(lastot->flags, F_GLYPH, C_BLUE, '<', NA, NULL); addflag(lastot->flags, F_GLYPH, C_BLUE, '<', NA, NULL);
addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "drainage grate"); addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "drainage grate");
@ -1689,6 +1695,7 @@ void initobjects(void) {
addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, "hollow tree"); addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, "hollow tree");
addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TREEUP, NA, NA, NULL); addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TREEUP, NA, NA, NULL);
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_ONEPERCELL, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_MAKESNOISE, 33, 1, NA, "rustling leaves."); addflag(lastot->flags, F_MAKESNOISE, 33, 1, NA, "rustling leaves.");
addflag(lastot->flags, F_MAKESNOISE, 33, 1, NA, "birds chirping."); addflag(lastot->flags, F_MAKESNOISE, 33, 1, NA, "birds chirping.");
@ -1696,6 +1703,7 @@ void initobjects(void) {
addflag(lastot->flags, F_GLYPH, C_BROWN, '<', NA, NULL); addflag(lastot->flags, F_GLYPH, C_BROWN, '<', NA, NULL);
addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "hollow tree"); addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "hollow tree");
addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TREEDOWN, NA, NA, NULL); addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TREEDOWN, NA, NA, NULL);
addflag(lastot->flags, F_ONEPERCELL, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOPICKUP, 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_NOBLESS, B_TRUE, NA, NA, NULL);
@ -1705,12 +1713,14 @@ void initobjects(void) {
addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TUNNELUP, NA, NA, NULL); addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TUNNELUP, NA, NA, NULL);
addflag(lastot->flags, F_NOPICKUP, 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_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_ONEPERCELL, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_MAKESNOISE, 33, 1, NA, "a strange echoing."); addflag(lastot->flags, F_MAKESNOISE, 33, 1, NA, "a strange echoing.");
addflag(lastot->flags, F_MAKESNOISE, 33, 1, NA, "an echoing drip."); addflag(lastot->flags, F_MAKESNOISE, 33, 1, NA, "an echoing drip.");
addot(OT_TUNNELUP, "tunnel leading up", "A wide tunnel leading upwards.", MT_STONE, 3000, OC_DFEATURE, SZ_HUGE); addot(OT_TUNNELUP, "tunnel leading up", "A wide tunnel leading upwards.", MT_STONE, 3000, OC_DFEATURE, SZ_HUGE);
addflag(lastot->flags, F_GLYPH, C_BROWN, '<', NA, NULL); addflag(lastot->flags, F_GLYPH, C_BROWN, '<', NA, NULL);
addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "tunnel"); addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "tunnel");
addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TUNNELDOWN, NA, NA, NULL); addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TUNNELDOWN, NA, NA, NULL);
addflag(lastot->flags, F_ONEPERCELL, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOPICKUP, 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_NOBLESS, B_TRUE, NA, NA, NULL);
@ -1725,9 +1735,27 @@ void initobjects(void) {
addflag(lastot->flags, F_GLYPH, NA, '<', NA, NULL); addflag(lastot->flags, F_GLYPH, NA, '<', NA, NULL);
addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "staircase"); addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "staircase");
addflag(lastot->flags, F_OPPOSITESTAIRS, OT_STAIRSDOWN, NA, NA, NULL); addflag(lastot->flags, F_OPPOSITESTAIRS, OT_STAIRSDOWN, NA, NA, NULL);
addflag(lastot->flags, F_ONEPERCELL, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOPICKUP, 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_NOBLESS, B_TRUE, NA, NA, NULL);
addot(OT_VSTAIRSDOWN, "metal hatch leading down", "A study metal hatchway set into the floor.", MT_METAL, 3000, OC_DFEATURE, SZ_HUGE);
addflag(lastot->flags, F_GLYPH, NA, '>', NA, NULL);
addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, "staircase");
addflag(lastot->flags, F_OPPOSITESTAIRS, OT_VSTAIRSUP, NA, NA, NULL);
addflag(lastot->flags, F_ONEPERCELL, 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_LOCKED, 500, NA, B_TRUE, NULL); // impossible to disarm!
addot(OT_VSTAIRSUP, "metal ladder leading up", "A ladder of rigid metal, leading up to through roof.", MT_METAL, 3000, OC_DFEATURE, SZ_HUGE);
addflag(lastot->flags, F_GLYPH, NA, '<', NA, NULL);
addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, "staircase");
addflag(lastot->flags, F_OPPOSITESTAIRS, OT_VSTAIRSDOWN, 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_ONEPERCELL, B_TRUE, NA, NA, NULL);
// buildings // buildings
@ -2326,23 +2354,29 @@ void initobjects(void) {
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, RR_VERYRARE, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, RR_VERYRARE, NULL);
// godstones // godstones
addot(OT_GODSTONE_DESTRUCTION, "Godstone of Destruction", "An ancient artifact representing the power of anger.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL); addot(OT_GODSTONE_DESTRUCTION, "Hammer of Destruction", "An ancient artifact representing the power of anger.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_RED, '*', NA, NULL); addflag(lastot->flags, F_GLYPH, C_RED, ')', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL); addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL); addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL);
addflag(lastot->flags, F_AIHEALITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_AIHEALITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODFIRE, NA, NA, NULL); addflag(lastot->flags, F_LINKGOD, R_GODFIRE, NA, NA, NULL);
addot(OT_GODSTONE_LIFE, "Godstone of Life", "An ancient artifact representing the power of Life and Healing.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL); addflag(lastot->flags, F_OBATTACKDELAY, 200, NA, NA, NULL);
addflag(lastot->flags, F_GLYPH, C_WHITE, '*', NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 15, NA, NULL);
addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL);
addflag(lastot->flags, F_TWOHANDED, SZ_LARGE, NA, NA, NULL);
addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL);
addflag(lastot->flags, F_ATTREQ, A_STR, 75, 85, "10");
addot(OT_GODSTONE_LIFE, "Heart of Life", "An ancient artifact representing the power of Life and Healing.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_CYAN, '*', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL); addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL); addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL);
addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODLIFE, NA, NA, NULL); addflag(lastot->flags, F_LINKGOD, R_GODLIFE, NA, NA, NULL);
addot(OT_GODSTONE_MERCY, "Godstone of Mercy", "An ancient artifact representing the power of Mercy and Forgiveness.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL); addot(OT_GODSTONE_MERCY, "Teardrop of Mercy", "An ancient artifact representing the power of Mercy and Forgiveness.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_GREEN, '*', NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREEN, '*', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL); addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
@ -2350,25 +2384,63 @@ void initobjects(void) {
addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODMERCY, NA, NA, NULL); addflag(lastot->flags, F_LINKGOD, R_GODMERCY, NA, NA, NULL);
addot(OT_GODSTONE_PURITY, "Godstone of Purity", "An ancient artifact representing the power of Purity and Order.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL); addot(OT_GODSTONE_PURITY, "Orb of Purity", "An ancient artifact representing the power of Purity and Order.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_MAGENTA, '*', NA, NULL); addflag(lastot->flags, F_GLYPH, C_WHITE, '*', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL); addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL); addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL);
addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODPURITY, NA, NA, NULL); addflag(lastot->flags, F_LINKGOD, R_GODPURITY, NA, NA, NULL);
addot(OT_GODSTONE_REVENGE, "Dagger of Revenge", "An ancient artifact representing the power of Revenge and Thievery.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_MAGENTA, ')', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addot(OT_GODSTONE_REVENGE, "Godstone of Revenge", "An ancient artifact representing the power of Revenge and Thievery.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL); addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL);
addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODPURITY, NA, NA, NULL);
addflag(lastot->flags, F_DAM, DT_PIERCE, 10, NA, NULL);
addflag(lastot->flags, F_OBATTACKDELAY, 50, NA, NA, NULL);
addflag(lastot->flags, F_ACCURACY, 85, NA, NA, NULL);
addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL);
addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 70, "15");
addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL);
addot(OT_GODSTONE_DEATH, "Skull of Death", "An ancient artifact representing the power of Death.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_BLUE, '*', NA, NULL); addflag(lastot->flags, F_GLYPH, C_BLUE, '*', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL); addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL); addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL);
addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODTHIEVES, NA, NA, NULL); addflag(lastot->flags, F_LINKGOD, R_GODDEATH, NA, NA, NULL);
addot(OT_GODSTONE_NATURE, "Seed of Nature", "An ancient artifact representing the power of Nature and Creation.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_GREEN, '*', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL);
addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODNATURE, NA, NA, NULL);
addot(OT_GODSTONE_BATTLE, "Horn of Battle", "An ancient artifact representing the power of Battle.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_ORANGE, ']', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL);
addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODBATTLE, NA, NA, NULL);
addot(OT_GODSTONE_MAGIC, "Crown of Knowledge", "An ancient artifact representing the power of Magic and Knowledge.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_BLUE, '[', NA, NULL);
addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL);
addflag(lastot->flags, F_CHARGES, 100, 100, NA, NULL);
addflag(lastot->flags, F_RECHARGE, 1, NA, NA, NULL);
addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_REPLENISHABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_LINKGOD, R_GODMAGIC, NA, NA, NULL);
addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL);
addflag(lastot->flags, F_ARMOURRATING, 5, NA, NA, NULL);
addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL);
// flora // flora
addot(OT_FLOWER, "flower", "A colourful woodland flower.", MT_PLANT, 0.01, OC_FLORA, SZ_TINY); addot(OT_FLOWER, "flower", "A colourful woodland flower.", MT_PLANT, 0.01, OC_FLORA, SZ_TINY);
@ -3686,6 +3758,7 @@ void initobjects(void) {
addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's range is determined by its power."); addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's range is determined by its power.");
addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL);
addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL);
addflag(lastot->flags, F_RANGE, 4, NA, NA, NULL);
addflag(lastot->flags, F_TARGETTEDSPELL, TT_MONSTER, 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_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL);
addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_WALLSTOP, NA, NULL); addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_WALLSTOP, NA, NULL);
@ -4852,16 +4925,22 @@ void initobjects(void) {
addflag(lastot->flags, F_GLYPH, C_GREY, '[', NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '[', NA, NULL);
addflag(lastot->flags, F_UNIQUE, NA, NA, NA, NULL); addflag(lastot->flags, F_UNIQUE, NA, NA, NA, NULL);
addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VAULTKEY, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL);
addot(OT_KEYMOSS, "ancient mossy key", "An ancient key covered with moss. It looks important.", MT_METAL, 2, OC_TOOLS, SZ_SMALL); addot(OT_KEYMOSS, "ancient mossy key", "An ancient key covered with moss. It looks important.", MT_METAL, 2, OC_TOOLS, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_GREEN, '[', NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREEN, '[', NA, NULL);
addflag(lastot->flags, F_UNIQUE, NA, NA, NA, NULL); addflag(lastot->flags, F_UNIQUE, NA, NA, NA, NULL);
addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VAULTKEY, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL);
addot(OT_KEYSTONE, "ancient stone key", "An ancient key made of stone. It looks important.", MT_METAL, 2, OC_TOOLS, SZ_SMALL); addot(OT_KEYSTONE, "ancient stone key", "An ancient key made of stone. It looks important.", MT_METAL, 2, OC_TOOLS, SZ_SMALL);
addflag(lastot->flags, F_GLYPH, C_GREY, '[', NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '[', NA, NULL);
addflag(lastot->flags, F_UNIQUE, NA, NA, NA, NULL); addflag(lastot->flags, F_UNIQUE, NA, NA, NA, NULL);
addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_VAULTKEY, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL);
// tools // tools
addot(OT_BANDAGE, "bandage", "A small medical bandage. When worn, it will counteract bleeding.", MT_CLOTH, 0.5, OC_TOOLS, SZ_SMALL); addot(OT_BANDAGE, "bandage", "A small medical bandage. When worn, it will counteract bleeding.", MT_CLOTH, 0.5, OC_TOOLS, SZ_SMALL);
@ -7300,6 +7379,7 @@ void initobjects(void) {
addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, "");
addflag(lastot->flags, F_NOBLESS, 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_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_MISSILEALWAYSDIES, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL); addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL);
addflag(lastot->flags, F_MISSILEDAM, NA, NA, NA, "4"); addflag(lastot->flags, F_MISSILEDAM, NA, NA, NA, "4");
addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL);
@ -7312,6 +7392,7 @@ void initobjects(void) {
addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, "");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_MISSILEDAM, NA, NA, NA, "1"); addflag(lastot->flags, F_MISSILEDAM, NA, NA, NA, "1");
addflag(lastot->flags, F_MISSILEALWAYSDIES, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL); addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL);
addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL);
@ -8796,6 +8877,77 @@ void initrace(void) {
addflag(lastrace->flags, F_WANTSOBFLAG, F_GEM, NA, NA, NULL); addflag(lastrace->flags, F_WANTSOBFLAG, F_GEM, NA, NA, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne"); addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne");
addrace(R_FISHFOLK, "fishfolk", 75, 'h', C_BOLDBLUE, MT_FLESH, RC_HUMANOID, "Water-dwelling humanoids capable of breathing normally in both water and air.");
setbodytype(lastrace, BT_HUMANOID);
addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne");
addflag(lastrace->flags, F_STARTATT, A_STR, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_WIS, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
f = addflag(lastrace->flags, F_HITDICE, 1, NA, NA, NULL); addcondition(f, FC_IFPLAYER, 100);
addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL);
addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL);
addflag(lastrace->flags, F_HASATTACK, OT_FISTS, 2, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout");
addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL);
// bonuses
addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, "");
addflag(lastrace->flags, F_BREATHWATER, B_TRUE, NA, NA, "");
addflag(lastrace->flags, F_STARTSKILL, SK_SWIMMING, PR_ADEPT, NA, NULL);
// penalties
addflag(lastrace->flags, F_DTVULN, DT_FIRE, NA, NA, NULL);
// for monsters:
f = addflag(lastrace->flags, F_HITDICE, 2, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 100);
f = addflag(lastrace->flags, F_TR, 3, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 100);
addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_WANTSBETTERARM, B_TRUE, NA, NA, NULL);
f = addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "trident"); addcondition(f, FC_IFMONSTER, 100);
f = addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "spear"); addcondition(f, FC_IFMONSTER, 100);
f = addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 100);
addrace(R_LAVAX, "lavax", 90, 'h', C_RED, MT_FLESH, RC_HUMANOID, "The Lavax are a race of humanoid creatures who dwell in volcanic regions. Their skin has hardened into a clay-like substance, and is completely immune to the effects of heat or fire.");
setbodytype(lastrace, BT_HUMANOID);
addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_WIS, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne");
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL);
f = addflag(lastrace->flags, F_HASATTACK, OT_FISTS, 5, NA, NULL); addcondition(f, FC_IFMONSTER, 100);
f = addflag(lastrace->flags, F_HASATTACK, OT_FISTS, 2, NA, NULL); addcondition(f, FC_IFPLAYER, 100);
f = addflag(lastrace->flags, F_HITDICE, 1, NA, NA, NULL); addcondition(f, FC_IFPLAYER, 100);
// bonuses
addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL);
addflag(lastrace->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL);
addflag(lastrace->flags, F_EXTRADAM, DT_HEAT, NA, NA, "1d1");
addbonustext(lastrace->flags, F_BONDESC, "+1 heat damage to all attacks");
// penalties
addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout");
addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL);
// for monsters only:
addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_WANTSBETTERARM, B_TRUE, NA, NA, NULL);
f = addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_WEAPON, RANDOM, NULL); addcondition(f, FC_IFMONSTER, 100);
f = addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 100);
f = addflag(lastrace->flags, F_TR, 5, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 100);
f = addflag(lastrace->flags, F_ARMOURRATING, 6, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 100);
addrace(R_ELF, "selnor", 60, '@', C_GREEN, MT_FLESH, RC_HUMANOID, "The Selnor race are slender, graceful beings around human-sized but far nimbler. They have high intelligence and magical affinity, but lack physical strength. The Selnor meditate instead of sleeping, thus maintaining basic awareness."); addrace(R_ELF, "selnor", 60, '@', C_GREEN, MT_FLESH, RC_HUMANOID, "The Selnor race are slender, graceful beings around human-sized but far nimbler. They have high intelligence and magical affinity, but lack physical strength. The Selnor meditate instead of sleeping, thus maintaining basic awareness.");
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
@ -8906,6 +9058,7 @@ void initrace(void) {
addflag(lastrace->flags, F_EXTRAINFO, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_EXTRAINFO, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_STARTSKILL, SK_TECHUSAGE, PR_MASTER, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_TECHUSAGE, PR_MASTER, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 3, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 3, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 6, NA, NA, NULL); addflag(lastrace->flags, F_TR, 6, NA, NA, NULL);
@ -8932,6 +9085,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL);
@ -8969,6 +9123,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 1, NA, 4, NULL); addflag(lastrace->flags, F_HITDICE, 1, NA, 4, NULL);
addflag(lastrace->flags, F_TR, 4, NA, NA, NULL); addflag(lastrace->flags, F_TR, 4, NA, NA, NULL);
addflag(lastrace->flags, F_HEAVENARM, 6, NA, NA, "force field"); addflag(lastrace->flags, F_HEAVENARM, 6, NA, NA, "force field");
@ -8993,6 +9148,7 @@ void initrace(void) {
addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 1, NA, 4, NULL); addflag(lastrace->flags, F_HITDICE, 1, NA, 4, NULL);
addflag(lastrace->flags, F_TR, 4, NA, NA, NULL); addflag(lastrace->flags, F_TR, 4, NA, NA, NULL);
addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL);
@ -9016,6 +9172,7 @@ void initrace(void) {
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL);
@ -9043,6 +9200,7 @@ void initrace(void) {
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 0, 1, NA, NULL); addflag(lastrace->flags, F_HITDICE, 0, 1, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL);
@ -9070,7 +9228,8 @@ void initrace(void) {
lastrace->baseid = R_BANDIT; lastrace->baseid = R_BANDIT;
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL);
addflag(lastrace->flags, F_DEMANDSBRIBE, NA, NA, NA, "Your money or your life!"); addflag(lastrace->flags, F_DEMANDSBRIBE, NA, NA, NA, "Your money or your life!");
addflag(lastrace->flags, F_STARTATT, A_STR, AT_RANDOM, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_RANDOM, NA, NULL);
@ -9103,7 +9262,8 @@ void initrace(void) {
addrace(R_BANDIT, "bandit", 75, '@', C_GREY, MT_FLESH, RC_HUMANOID, "Bandits prey on travellers, demanding cash in exchange for not beating them to a pulp."); addrace(R_BANDIT, "bandit", 75, '@', C_GREY, MT_FLESH, RC_HUMANOID, "Bandits prey on travellers, demanding cash in exchange for not beating them to a pulp.");
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_RANDOM, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_RANDOM, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_RANDOM, NA, NULL);
@ -9312,6 +9472,8 @@ void initrace(void) {
addflag(lastrace->flags, F_TR, 50, NA, NA, NULL); addflag(lastrace->flags, F_TR, 50, NA, NA, NULL);
addflag(lastrace->flags, F_UNIQUE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_UNIQUE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_HASATTACK, OT_FISTS, 8, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_FISTS, 8, NA, NULL);
addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed +5 zweihander");
addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed +5 lightning javelin");
addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed +5 helmet"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed +5 helmet");
addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed bloodstained +5 plate mail"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed bloodstained +5 plate mail");
addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed bloodstained +5 set of greaves"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed bloodstained +5 set of greaves");
@ -9771,6 +9933,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 6, NA, NA, NULL); addflag(lastrace->flags, F_TR, 6, NA, NA, NULL);
@ -10144,6 +10307,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL);
@ -10228,6 +10392,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "stick"); addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "stick");
addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "leaf"); addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "leaf");
@ -10268,6 +10433,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "stick"); addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "stick");
@ -10302,6 +10468,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 13, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 13, NA, NA, NULL);
@ -10342,6 +10509,7 @@ void initrace(void) {
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 15, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 15, NA, NA, NULL);
@ -10385,6 +10553,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "fire giant corpse"); addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "fire giant corpse");
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 15, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 15, NA, NA, NULL);
@ -10439,6 +10608,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 5, NA, NA, NULL); addflag(lastrace->flags, F_TR, 5, NA, NA, NULL);
@ -10610,6 +10780,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, 75, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 75, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 4, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 4, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 5, NA, NA, NULL); addflag(lastrace->flags, F_TR, 5, NA, NA, NULL);
@ -10646,6 +10817,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, 70, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 70, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, 70, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 70, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 3, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 3, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 4, NA, NA, NULL); addflag(lastrace->flags, F_TR, 4, NA, NA, NULL);
@ -10721,6 +10893,7 @@ void initrace(void) {
addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "goblin corpse"); addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "goblin corpse");
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, 50, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 50, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 4, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 4, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 6, NA, NA, NULL); addflag(lastrace->flags, F_TR, 6, NA, NA, NULL);
@ -10790,6 +10963,7 @@ void initrace(void) {
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 7, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 7, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 7, NA, NA, NULL); addflag(lastrace->flags, F_TR, 7, NA, NA, NULL);
addflag(lastrace->flags, F_EVASION, 20, NA, NA, NULL); addflag(lastrace->flags, F_EVASION, 20, NA, NA, NULL);
@ -10832,6 +11006,7 @@ void initrace(void) {
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, ""); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, "");
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, 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_AGI, AT_AVERAGE, NA, NULL);
@ -10909,6 +11084,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, 60, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 60, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, 60, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 60, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 7, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 7, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 7, NA, NA, NULL); addflag(lastrace->flags, F_TR, 7, NA, NA, NULL);
@ -10951,6 +11127,7 @@ void initrace(void) {
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 11, NA, NA, NULL); addflag(lastrace->flags, F_TR, 11, NA, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL);
@ -11125,6 +11302,7 @@ void initrace(void) {
addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, 72, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 72, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, 72, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 72, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 6, NA, NA, NULL); addflag(lastrace->flags, F_TR, 6, NA, NA, NULL);
@ -11154,6 +11332,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne"); addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne");
addflag(lastrace->flags, F_STARTJOB, 15, J_WARRIOR, NA, NULL); addflag(lastrace->flags, F_STARTJOB, 15, J_WARRIOR, NA, NULL);
addflag(lastrace->flags, F_STARTJOB, 15, J_DRUID, NA, NULL); addflag(lastrace->flags, F_STARTJOB, 15, J_DRUID, NA, NULL);
addflag(lastrace->flags, F_STARTJOB, 15, J_GUARD, NA, NULL);
addrace(R_MALIK, "malik", 5, 'n', C_YELLOW, MT_FLESH, RC_MAGIC, "An evil fairy who thrives on murder. They delight in teleporting behind their victims for a quick backstab."); addrace(R_MALIK, "malik", 5, 'n', C_YELLOW, MT_FLESH, RC_MAGIC, "An evil fairy who thrives on murder. They delight in teleporting behind their victims for a quick backstab.");
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
@ -11199,6 +11378,7 @@ void initrace(void) {
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 6, NA, NA, NULL); addflag(lastrace->flags, F_TR, 6, NA, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL);
@ -11275,6 +11455,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_CAVE, 60, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, 60, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, 66, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 66, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, 66, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 66, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 4, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 4, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 5, NA, NA, NULL); addflag(lastrace->flags, F_TR, 5, NA, NA, NULL);
addflag(lastrace->flags, F_EVASION, -5, NA, NA, NULL); addflag(lastrace->flags, F_EVASION, -5, NA, NA, NULL);
@ -11393,6 +11574,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_CAVE, 45, NA, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, 45, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, 50, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 50, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, 50, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 50, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 10, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 10, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 10, NA, NA, NULL); addflag(lastrace->flags, F_TR, 10, NA, NA, NULL);
addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL);
@ -11645,6 +11827,7 @@ void initrace(void) {
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_GTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 5, NA, NA, NULL); addflag(lastrace->flags, F_TR, 5, NA, NA, NULL);
@ -11790,6 +11973,8 @@ void initrace(void) {
addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, 72, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUGE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 6, NA, NA, NULL); addflag(lastrace->flags, F_TR, 6, NA, NA, NULL);
@ -11820,6 +12005,8 @@ void initrace(void) {
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, 72, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 3, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 3, NA, NA, NULL);
@ -11844,13 +12031,14 @@ void initrace(void) {
addrace(R_PRIMALSTONE, "stone primality", 200, 'E', C_GREY, MT_STONE, RC_MAGIC, "A living mass of stone, animated by powerful magic."); addrace(R_PRIMALSTONE, "stone primality", 200, 'E', C_GREY, MT_STONE, RC_MAGIC, "A living mass of stone, animated by powerful magic.");
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, 72, RR_RARE, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_WIS, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_EXHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_EXHIGH, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, 72, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 10, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 10, NA, NA, NULL);
@ -11870,13 +12058,14 @@ void initrace(void) {
addrace(R_PRIMALSTONEL, "lesser stone primality", 120, 'E', C_GREY, MT_STONE, RC_MAGIC, "A living mass of stone, animated by powerful magic."); addrace(R_PRIMALSTONEL, "lesser stone primality", 120, 'E', C_GREY, MT_STONE, RC_MAGIC, "A living mass of stone, animated by powerful magic.");
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, 72, RR_RARE, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_WIS, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_EXHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_EXHIGH, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, 72, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
@ -11905,6 +12094,10 @@ void initrace(void) {
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 6, NA, NA, NULL);
@ -11939,6 +12132,10 @@ void initrace(void) {
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXLOW, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
@ -11997,32 +12194,6 @@ void initrace(void) {
addflag(lastrace->flags, F_NOSLEEP, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSLEEP, B_TRUE, NA, NA, NULL);
addrace(R_LAVAX, "lavax", 90, 'h', C_RED, MT_FLESH, RC_HUMANOID, "The Lavax are a race of humanoid creatures who dwell in volcanic regions. Their skin has hardened into a clay-like substance, and is completely immune to the effects of heat or fire.");
setbodytype(lastrace, BT_HUMANOID);
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne");
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 5, NA, NA, NULL);
addflag(lastrace->flags, F_ARMOURRATING, 6, NA, NA, NULL);
addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_WIS, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_HASATTACK, OT_FISTS, 9, NA, NULL);
addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_WEAPON, RANDOM, NULL);
addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_WANTSBETTERARM, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout");
addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL);
addflag(lastrace->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL);
addrace(R_SASQUATCH, "sasquatch", 90, 'h', C_CYAN, MT_FLESH, RC_HUMANOID, "Over the years, humans dwelling in cold climates have evolved into sasquatches, their skin now covered with fur to protect against the elements."); addrace(R_SASQUATCH, "sasquatch", 90, 'h', C_CYAN, MT_FLESH, RC_HUMANOID, "Over the years, humans dwelling in cold climates have evolved into sasquatches, their skin now covered with fur to protect against the elements.");
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne"); addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne");
@ -12385,6 +12556,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALINGMIN, NA, NA, NULL); addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALINGMIN, NA, NA, NULL);
addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALING, NA, NA, NULL); addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALING, NA, NA, NULL);
@ -12422,6 +12594,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 5, NA, NA, NULL); addflag(lastrace->flags, F_TR, 5, NA, NA, NULL);
addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL);
@ -12445,6 +12618,7 @@ void initrace(void) {
addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_CANEATRAW, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_CANEATRAW, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_STARTJOB, 25, J_WARRIOR, NA, NULL); addflag(lastrace->flags, F_STARTJOB, 25, J_WARRIOR, NA, NULL);
addflag(lastrace->flags, F_STARTJOB, 25, J_GUARD, NA, NULL);
addrace(R_TROLLSNOW, "snow troll", 100, 't', C_WHITE, MT_FLESH, RC_HUMANOID, "A savage, hairy monster covered with white fur. Trolls are extremely muscular, move abnormally quickly and regenerate."); addrace(R_TROLLSNOW, "snow troll", 100, 't', C_WHITE, MT_FLESH, RC_HUMANOID, "A savage, hairy monster covered with white fur. Trolls are extremely muscular, move abnormally quickly and regenerate.");
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
@ -12620,34 +12794,6 @@ void initrace(void) {
addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 8, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 8, NA, NULL);
addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL);
addrace(R_FISHFOLK, "fishfolk", 75, 'h', C_BOLDBLUE, MT_FLESH, RC_HUMANOID, "Water-dwelling humanoids capable of breathing normally in both water and air.");
setbodytype(lastrace, BT_HUMANOID);
addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 2, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 3, NA, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_IQ, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_WIS, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, 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_HASATTACK, OT_FISTS, 2, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout");
addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "trident");
addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "spear");
addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL);
addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_WANTSBETTERARM, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, "gne");
addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, "");
addflag(lastrace->flags, F_BREATHWATER, B_TRUE, NA, NA, "");
addrace(R_MERLOCH, "merloch", 250, 'm', C_ORANGE, MT_FLESH, RC_AQUATIC, "Merlochs are bipedal, fishlike beings. Equally at home in the water or on land, they use their sonic scream to disable foes."); addrace(R_MERLOCH, "merloch", 250, 'm', C_ORANGE, MT_FLESH, RC_AQUATIC, "Merlochs are bipedal, fishlike beings. Equally at home in the water or on land, they use their sonic scream to disable foes.");
setbodytype(lastrace, BT_HUMANOID); setbodytype(lastrace, BT_HUMANOID);
@ -15059,6 +15205,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15094,6 +15241,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15144,6 +15292,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15195,6 +15344,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15254,6 +15404,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15305,6 +15456,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15352,6 +15504,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15406,6 +15559,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15456,6 +15610,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15501,6 +15656,7 @@ void initrace(void) {
addbodypart(lastrace, BP_TAIL, NULL); addbodypart(lastrace, BP_TAIL, NULL);
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); 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_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, 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_SIZE, SZ_HUGE, NA, NA, NULL);
addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_NATURALFLIGHT, B_TRUE, NA, NA, "");
@ -15834,6 +15990,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_HEAVEN, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_HEAVEN, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 13, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 13, NA, NA, NULL);
@ -15875,6 +16032,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_HEAVEN, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_HEAVEN, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL);
@ -15944,6 +16102,7 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_HEAVEN, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_HEAVEN, NA, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_UNCOMMON, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL);
@ -15978,6 +16137,7 @@ void initrace(void) {
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_ALL, NA, RR_VERYRARE, NULL);
addflag(lastrace->flags, F_RARITY, H_MASTERVAULTS, NA, RR_RARE, NULL);
addflag(lastrace->flags, F_HITDICE, 3, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, 3, NA, NA, NULL);
addflag(lastrace->flags, F_TR, 5, NA, NA, NULL); addflag(lastrace->flags, F_TR, 5, NA, NA, NULL);
addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL);

Binary file not shown.

View File

@ -14,7 +14,15 @@
#:cell:metal wall #:cell:metal wall
+:ob:locked iron door +:ob:locked iron door
+:exit +:exit
g:ob:Godstone of Purity g:ob:Horn of Battle
g:ob:Skull of Death
g:ob:Hammer of Destruction
g:ob:Heart of Life
g:ob:Crown of Knowledge
g:ob:Teardrop of Mercy
g:ob:Seed of Nature
g:ob:Orb of Purity
g:ob:Dagger of Revenge
^:ob:gas trap ^:ob:gas trap
c:ob:candelabrum c:ob:candelabrum
m:ob:landmine trap m:ob:landmine trap

View File

@ -8,7 +8,7 @@
@end @end
@legend @legend
#:cell:metal wall #:cell:duranite wall
$:ob:25-200 gold $:ob:25-200 gold
! 30% chance of a door on each side ! 30% chance of a door on each side
+:ob:secret locked iron door:30 +:ob:secret locked iron door:30

19
defs.h
View File

@ -220,8 +220,11 @@
#define MINROOMS_WOODS -1 #define MINROOMS_WOODS -1
#define MAXROOMS_WOODS 3 #define MAXROOMS_WOODS 3
#define MINROOMS_DUN 5
#define MAXROOMS_DUN 10
#define MINROOMS 5 #define MINROOMS 5
#define MAXROOMS 10 #define MAXROOMS 20
#define MIN_ROOMH 4 #define MIN_ROOMH 4
#define MIN_ROOMW 4 #define MIN_ROOMW 4
#define MAX_ROOMW (MAX_MAPW / 3) #define MAX_ROOMW (MAX_MAPW / 3)
@ -809,6 +812,7 @@ enum CELLTYPE {
CT_WALLTREE, CT_WALLTREE,
CT_WALLWOOD, CT_WALLWOOD,
CT_WALLDWOOD, CT_WALLDWOOD,
CT_WALLDURANITE,
// empty // empty
CT_CORRIDOR, CT_CORRIDOR,
CT_DIRT, CT_DIRT,
@ -816,6 +820,7 @@ enum CELLTYPE {
CT_FAKE, CT_FAKE,
CT_FLOORFLESH, CT_FLOORFLESH,
CT_FLOORCARPET, CT_FLOORCARPET,
CT_FLOORDURANITE,
CT_FLOORSHOP, CT_FLOORSHOP,
CT_FLOORTILE, CT_FLOORTILE,
CT_FLOORWOOD, CT_FLOORWOOD,
@ -1324,6 +1329,7 @@ enum MATERIAL {
MT_DRAGONWOOD = 29, MT_DRAGONWOOD = 29,
MT_DIRT = 30, MT_DIRT = 30,
MT_CRYSTAL = 31, MT_CRYSTAL = 31,
MT_DURANITE = 32,
}; };
// Object Types // Object Types
@ -1351,6 +1357,8 @@ enum OBTYPE {
OT_HOLEINROOF, OT_HOLEINROOF,
OT_STAIRSDOWN, OT_STAIRSDOWN,
OT_STAIRSUP, OT_STAIRSUP,
OT_VSTAIRSDOWN,
OT_VSTAIRSUP,
OT_TREEDOWN, OT_TREEDOWN,
OT_TREEUP, OT_TREEUP,
OT_TUNNELDOWN, OT_TUNNELDOWN,
@ -1409,9 +1417,13 @@ enum OBTYPE {
// money // money
OT_GOLD, OT_GOLD,
// godstones // godstones
OT_GODSTONE_BATTLE,
OT_GODSTONE_DEATH,
OT_GODSTONE_DESTRUCTION, OT_GODSTONE_DESTRUCTION,
OT_GODSTONE_LIFE, OT_GODSTONE_LIFE,
OT_GODSTONE_MAGIC,
OT_GODSTONE_MERCY, OT_GODSTONE_MERCY,
OT_GODSTONE_NATURE,
OT_GODSTONE_PURITY, OT_GODSTONE_PURITY,
OT_GODSTONE_REVENGE, OT_GODSTONE_REVENGE,
// flora // flora
@ -2400,6 +2412,8 @@ enum FLAG {
// object flags // object flags
F_GODSTONE, // this is a godstone. F_GODSTONE, // this is a godstone.
// if v2 = TRUE, means we need to warn when we walk onto it. // if v2 = TRUE, means we need to warn when we walk onto it.
F_VAULTKEY, // this object is a vault key - it unlocks vault
// stair objects.
F_BADOBJECT, // this object is dangerous. ie. potion of poison, F_BADOBJECT, // this object is dangerous. ie. potion of poison,
// potion of sleep, etc. // potion of sleep, etc.
F_BATTLESPOILS, // this obejct was dropped by a monster which the F_BATTLESPOILS, // this obejct was dropped by a monster which the
@ -2693,6 +2707,7 @@ enum FLAG {
F_OPEN, // is this door open? F_OPEN, // is this door open?
F_LOCKED,// door is locked F_LOCKED,// door is locked
// v1 is difficulty to disarm // v1 is difficulty to disarm
// if v2 is set, this objcet can't be magically unlocked.
F_JAMMED, // is this door jammed? v0 is # turns it'll take to open it. F_JAMMED, // is this door jammed? v0 is # turns it'll take to open it.
// v1 = have we tried this door yet? // v1 = have we tried this door yet?
F_SECRET, // this object is secret. v0 is sc_search difficulty F_SECRET, // this object is secret. v0 is sc_search difficulty
@ -4021,6 +4036,7 @@ enum REGIONTYPE {
RG_STOMACH, RG_STOMACH,
RG_WOODS, RG_WOODS,
RG_BABAYAGAHUT, RG_BABAYAGAHUT,
RG_MASTERVAULTS,
}; };
enum HABITAT { enum HABITAT {
@ -4035,6 +4051,7 @@ enum HABITAT {
H_SWAMP = 9, H_SWAMP = 9,
H_BYHUT = 10, H_BYHUT = 10,
H_ANTNEST = 11, H_ANTNEST = 11,
H_MASTERVAULTS = 12,
H_ALL = 999 H_ALL = 999
}; };

View File

@ -3,7 +3,7 @@ defs.h:
map.c: map.c:
initmap(): define via new "addregiontype()" call initmap(): define via new "addregiontype()" call
OPTIONAL: initmap(): define at least one regionoutline OPTIONAL: initmaplayout(): define at least one regionoutline
finalisemap(): finalisemap():
define up/down stair types for this map define up/down stair types for this map

8
god.c
View File

@ -421,7 +421,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
rollagain = B_TRUE; rollagain = B_TRUE;
} else { } else {
msg("\"Maybe this will teach you some humility!\""); msg("\"Maybe this will teach you some humility!\"");
setrace(player, R_NEWT, B_TRUE); // ie. don't set origrace! polymorphto(player, R_NEWT, 20);
} }
break; break;
} }
@ -1206,7 +1206,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple) {
if (getskill(player, SK_RANGED)) { if (getskill(player, SK_RANGED)) {
char obname[BUFLEN]; char obname[BUFLEN];
if (real_getrandomob(NULL, obname, 25, NA, getlfsize(player), if (real_getrandomob(NULL, obname, 25, NA, getlfsize(player),
SK_RANGED, B_TRUE, OC_WEAPON, OC_NONE, DT_NONE)) { SK_RANGED, B_TRUE, OC_WEAPON, OC_NONE, DT_NONE, F_NONE)) {
snprintf(obtogive, BUFLEN, "excellent %s", obname); snprintf(obtogive, BUFLEN, "excellent %s", obname);
} else { } else {
rollagain = B_TRUE; rollagain = B_TRUE;
@ -1418,6 +1418,7 @@ void godsay(enum RACE rid, int says, char *format, ...) {
void godstone_pickup_effects(lifeform_t *god, lifeform_t *opposegod, object_t *o) { void godstone_pickup_effects(lifeform_t *god, lifeform_t *opposegod, object_t *o) {
int x,y; int x,y;
// opposing god appears // opposing god appears
godappears(opposegod->race->id, NULL); godappears(opposegod->race->id, NULL);
@ -1467,7 +1468,7 @@ void godstone_pickup_effects(lifeform_t *god, lifeform_t *opposegod, object_t *o
wprintw(mainwin, "OR... STONE KILL EKRUB. YES! YOU WILL USE. YOU FIND\n"); wprintw(mainwin, "OR... STONE KILL EKRUB. YES! YOU WILL USE. YOU FIND\n");
wprintw(mainwin, "HER. YOU USE STONE. STONE HELP BURN NATURE GODDESS!\n\n"); wprintw(mainwin, "HER. YOU USE STONE. STONE HELP BURN NATURE GODDESS!\n\n");
wprintw(mainwin, "YOU GO UPWARD. UPWARD GOES TO FOREST. PORTAL IN FOREST.\n"); wprintw(mainwin, "YOU GO UPWARD. UPWARD GOES TO FOREST. PORTAL IN FOREST.\n");
wprintw(mainwin, "PORTAL TO TREE WOMAN. YOU KILL TREE WOMAN. OR YOU FIND KLIKIRAK,"); wprintw(mainwin, "PORTAL TO TREE WOMAN. YOU KILL TREE WOMAN. OR YOU FIND KLIKIRAK,\n");
wprintw(mainwin, "YOU GIVE STONE TO KLIKIRAK.\n\n"); wprintw(mainwin, "YOU GIVE STONE TO KLIKIRAK.\n\n");
wprintw(mainwin, "YES. YES. YYYEESSS!!\"\n"); wprintw(mainwin, "YES. YES. YYYEESSS!!\"\n");
break; break;
@ -1593,6 +1594,7 @@ void godstone_pickup_effects(lifeform_t *god, lifeform_t *opposegod, object_t *o
killflagsofid(god->flags, F_PRAYEDTO); killflagsofid(god->flags, F_PRAYEDTO);
addflag(god->flags, F_GODBLOCKED, B_TRUE, NA, NA, NULL); addflag(god->flags, F_GODBLOCKED, B_TRUE, NA, NA, NULL);
} }
void modpiety(enum RACE rid, int amt) { void modpiety(enum RACE rid, int amt) {

38
io.c
View File

@ -1240,6 +1240,11 @@ void announcearrival(lifeform_t *lf, map_t *newmap) {
case H_HEAVEN: case H_HEAVEN:
msg("You arrive in the Realm of the Gods!"); msg("You arrive in the Realm of the Gods!");
break; break;
case H_MASTERVAULTS:
if ((newmap->lastplayervisit == -1) && (newmap->depth == 1)) {
msg("You have found the master vaults!");
}
break;
case H_SWAMP: case H_SWAMP:
msg("You arrive %sat a swamp.", msg("You arrive %sat a swamp.",
(newmap->lastplayervisit == -1) ? "" : "back "); (newmap->lastplayervisit == -1) ? "" : "back ");
@ -4632,7 +4637,7 @@ void docomms(lifeform_t *lf) {
} }
return; return;
case 't': case 't':
if (lfhasflag(lf, F_PHANTASM)) { if (lfhasflag(lf, F_PHANTASM) || lfhasflag(lf, F_SUMMONEDBY)) {
msg("%s doesn't respond.", lfname); msg("%s doesn't respond.", lfname);
break; break;
} }
@ -10972,6 +10977,33 @@ int screenglyphmatches(int x, int y, glyph_t *g) {
return B_TRUE; return B_TRUE;
} }
// prompts the player to learn a new spell from school 'ss' (ss_none means any)
void select_new_spell(enum SPELLSCHOOL ss) {
int done = B_FALSE;
flag_t *f;
char qbuf[BUFLEN];
sprintf(qbuf, "Learn which new spell (maxmp=%d):", getmaxmp(player));
while (!done) {
makespellchoicelist(&prompt, player, qbuf, "Describe which spell:", f->val[1], B_TRUE, B_FALSE, B_FALSE, player->maxmp);
if (prompt.nchoices > 0) {
objecttype_t *ot;
getchoicestr(&prompt, B_TRUE, B_TRUE);
ot = prompt.result;
if (ot) {
if (prompt.whichq == 0) { // learn the spell
addtempflag(player->flags, F_CANCAST, ot->id, NA, NA, NULL, FROMJOB);
done = B_TRUE;
} else {
describespell(ot);
}
}
} else {
msg("There are no new spells for you to learn at this time.");
done = B_TRUE;
}
}
}
void setcol(WINDOW *win, enum COLOUR col) { void setcol(WINDOW *win, enum COLOUR col) {
if (needsbold(col)) { if (needsbold(col)) {
wattron(win, A_BOLD); wattron(win, A_BOLD);
@ -13874,8 +13906,8 @@ void wingame(void) {
msg("^%c\"ALL HAIL THE NEW GOD OF %s!!\"", getlfcol(player, CC_VGOOD), buf); msg("^%c\"ALL HAIL THE NEW GOD OF %s!!\"", getlfcol(player, CC_VGOOD), buf);
more(); more();
free(buf); free(buf);
killflag(tempflag[0]); //killflag(tempflag[0]);
killflag(tempflag[1]); //killflag(tempflag[1]);
} }
} }

1
io.h
View File

@ -130,6 +130,7 @@ void redrawpause(void);
void redrawresume(void); void redrawresume(void);
void restoregamewindows(void); void restoregamewindows(void);
int screenglyphmatches(int x, int y, glyph_t *g); int screenglyphmatches(int x, int y, glyph_t *g);
void select_new_spell(enum SPELLSCHOOL ss);
void setcol(WINDOW *win, enum COLOUR col); void setcol(WINDOW *win, enum COLOUR col);
void unsetcol(WINDOW *win, enum COLOUR col); void unsetcol(WINDOW *win, enum COLOUR col);
void setobcolour(WINDOW *win, object_t *o, int set); void setobcolour(WINDOW *win, object_t *o, int set);

118
lf.c
View File

@ -1110,9 +1110,11 @@ int canquaff(lifeform_t *lf, object_t *o) {
// can lf reach victim to attack them? // can lf reach victim to attack them?
int canreach(lifeform_t *lf, lifeform_t *victim, int *reachpenalty) { int canreach(lifeform_t *lf, lifeform_t *victim, int *reachpenalty) {
enum LFSIZE sizetoreach = SZ_ANY; enum LFSIZE sizetoreach = SZ_ANY;
int pen = 0;
// harder to hit flying/levitating enemies, unless you are // harder to hit flying/levitating enemies, unless you are
// large (ie. tall) enough to reach them. // large (ie. tall) enough to reach them.
// if you are smaller than "sizetoreach", you get a penalty // if you are smaller than "sizetoreach", you get a penalty
if (reachpenalty) *reachpenalty = 0;
if (!isairborne(lf)) { if (!isairborne(lf)) {
switch (isairborne(victim)) { switch (isairborne(victim)) {
case F_FLYING: case F_FLYING:
@ -1139,9 +1141,13 @@ int canreach(lifeform_t *lf, lifeform_t *victim, int *reachpenalty) {
if (sizetoreach == SZ_ANY) { if (sizetoreach == SZ_ANY) {
if (reachpenalty) *reachpenalty = 0; if (reachpenalty) *reachpenalty = 0;
return B_TRUE; return B_TRUE;
}
pen = sizetoreach - getlfsize(lf);
if (pen > 0) {
if (reachpenalty) *reachpenalty = (sizetoreach - getlfsize(lf));
return B_FALSE;
} }
if (reachpenalty) *reachpenalty = (sizetoreach - getlfsize(lf)); return B_TRUE;
return B_FALSE;
} }
// can lf reach victim's bodypart bp? // can lf reach victim's bodypart bp?
@ -2924,7 +2930,7 @@ void die(lifeform_t *lf) {
} }
// a god died? // a god died?
if (getraceclass(lf) == RC_GOD) { if ((getraceclass(lf) == RC_GOD) && !isplayer(lf)) {
flag_t *f; flag_t *f;
// update godlf pointer // update godlf pointer
for (i = 0; i < ngodlfs; i++) { for (i = 0; i < ngodlfs; i++) {
@ -2940,13 +2946,15 @@ void die(lifeform_t *lf) {
if (!willbecomeghost) { if (!willbecomeghost) {
if (thisisplayer && hasjob(lf, J_GOD)) { if (thisisplayer && hasjob(lf, J_GOD)) {
char ch; if (!lfhasflag(lf, F_WINNER)) {
msg("^BYou are about to die..."); more(); char ch;
ch = askchar("Die", "yn", "n", B_TRUE, B_FALSE); msg("^BYou are about to die..."); more();
if (ch == 'n') { ch = askchar("Die", "yn", "n", B_TRUE, B_FALSE);
lf->hp = lf->maxhp; if (ch == 'n') {
msg("Not dying."); lf->hp = lf->maxhp;
return; msg("Not dying.");
return;
}
} }
} }
} }
@ -5134,28 +5142,7 @@ void enhanceskills(lifeform_t *lf) {
addtempflag(lf->flags, F_CANCAST, f->val[1], NA, NA, NULL, FROMJOB); addtempflag(lf->flags, F_CANCAST, f->val[1], NA, NA, NULL, FROMJOB);
} else if ((f->id == F_LEVSPELLSCHOOL) && !lfhasflag(lf, F_NOSPELLS)) { // select a spell from school } else if ((f->id == F_LEVSPELLSCHOOL) && !lfhasflag(lf, F_NOSPELLS)) { // select a spell from school
if (isplayer(lf)) { if (isplayer(lf)) {
int done = B_FALSE; select_new_spell(f->val[1]);
char qbuf[BUFLEN];
sprintf(qbuf, "Learn which new spell (maxmp=%d):", getmaxmp(player));
while (!done) {
makespellchoicelist(&prompt, player, qbuf, "Describe which spell:", f->val[1], B_TRUE, B_FALSE, B_FALSE, player->maxmp);
if (prompt.nchoices > 0) {
objecttype_t *ot;
getchoicestr(&prompt, B_TRUE, B_TRUE);
ot = prompt.result;
if (ot) {
if (prompt.whichq == 0) { // learn the spell
addtempflag(lf->flags, F_CANCAST, ot->id, NA, NA, NULL, FROMJOB);
done = B_TRUE;
} else {
describespell(ot);
}
}
} else {
msg("There are no new spells for you to learn at this time.");
done = B_TRUE;
}
}
} else { } else {
// monster gets random spell // monster gets random spell
makespellchoicelist(&prompt, lf, "xx","xx:", f->val[1], B_TRUE, B_FALSE, B_FALSE, lf->maxmp); makespellchoicelist(&prompt, lf, "xx","xx:", f->val[1], B_TRUE, B_FALSE, B_FALSE, lf->maxmp);
@ -6241,11 +6228,13 @@ void gainxp(lifeform_t *lf, long amt) {
amtneeded = getspforpoint(lf); amtneeded = getspforpoint(lf);
assert(amtneeded > 0); assert(amtneeded > 0);
/*
// would you gain more than 5 levels? probably a bug! // would you gain more than 5 levels? probably a bug!
if (((lf->skillxp + amt) / amtneeded) >= 3) { if (((lf->skillxp + amt) / amtneeded) >= 3) {
raise(SIGINT); raise(SIGINT);
} }
lf->skillxp += amt; lf->skillxp += amt;
*/
assert(lf->skillxp >= 0); assert(lf->skillxp >= 0);
while (lf->skillxp >= amtneeded) { while (lf->skillxp >= amtneeded) {
@ -11356,7 +11345,7 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp) {
case RANDOM: depthmod = rnd(0,MAXDEPTH); break; case RANDOM: depthmod = rnd(0,MAXDEPTH); break;
default: break; default: break;
} }
if (real_getrandomob(targmap, buf, targmap->depth + depthmod, NA, maxobsize, SK_NONE, B_TRUE, OC_NONE, DT_NONE)) { if (real_getrandomob(targmap, buf, targmap->depth + depthmod, NA, maxobsize, SK_NONE, B_TRUE, OC_NONE, DT_NONE, F_NONE)) {
if (isshop) apply_shopob_restrictions(buf); if (isshop) apply_shopob_restrictions(buf);
o = addob(op, buf); o = addob(op, buf);
} }
@ -11374,7 +11363,7 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp) {
case RANDOM: depthmod = rnd(0,MAXDEPTH); break; case RANDOM: depthmod = rnd(0,MAXDEPTH); break;
default: break; default: break;
} }
if (real_getrandomob(targmap, buf, targmap->depth + depthmod, NA, maxobsize, SK_NONE, B_TRUE, OC_NONE, val[1], DT_NONE)) { if (real_getrandomob(targmap, buf, targmap->depth + depthmod, NA, maxobsize, SK_NONE, B_TRUE, OC_NONE, val[1], DT_NONE, F_NONE)) {
if (db) snprintf(buf2, BUFLEN, "finished startobdt successfuly."); if (db) snprintf(buf2, BUFLEN, "finished startobdt successfuly.");
if (isshop) apply_shopob_restrictions(buf); if (isshop) apply_shopob_restrictions(buf);
o = addob(op, buf); o = addob(op, buf);
@ -11396,7 +11385,7 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp) {
case RANDOM: depthmod = rnd(0,MAXDEPTH); break; case RANDOM: depthmod = rnd(0,MAXDEPTH); break;
default: break; default: break;
} }
if (real_getrandomob(targmap, buf, targmap->depth + depthmod, NA, maxobsize, val[1], B_TRUE, OC_NONE, DT_NONE)) { if (real_getrandomob(targmap, buf, targmap->depth + depthmod, NA, maxobsize, val[1], B_TRUE, OC_NONE, DT_NONE, F_NONE)) {
char buf3[BUFLEN]; char buf3[BUFLEN];
if (db) snprintf(buf2, BUFLEN, "finished startobwepsk successfuly."); if (db) snprintf(buf2, BUFLEN, "finished startobwepsk successfuly.");
sprintf(buf3, "%s%s%s",text,strlen(text) ? " " : "",buf); sprintf(buf3, "%s%s%s",text,strlen(text) ? " " : "",buf);
@ -11421,7 +11410,7 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp) {
//obdb = B_TRUE; //obdb = B_TRUE;
if (real_getrandomob(targmap, buf, getmapdifficulty(targmap) + depthmod, NA, maxobsize, SK_NONE, B_TRUE, if (real_getrandomob(targmap, buf, getmapdifficulty(targmap) + depthmod, NA, maxobsize, SK_NONE, B_TRUE,
val[1], OC_NONE, DT_NONE)) { val[1], OC_NONE, DT_NONE, F_NONE)) {
if (db) snprintf(buf2, BUFLEN, "finished startobclass, success."); if (db) snprintf(buf2, BUFLEN, "finished startobclass, success.");
if (isshop) apply_shopob_restrictions(buf); if (isshop) apply_shopob_restrictions(buf);
o = addob(op, buf); o = addob(op, buf);
@ -13139,6 +13128,7 @@ int isgod(lifeform_t *lf) {
} }
int ishelplessvictim(lifeform_t *victim, lifeform_t *attacker, enum HELPLESSTYPE *how) { int ishelplessvictim(lifeform_t *victim, lifeform_t *attacker, enum HELPLESSTYPE *how) {
if (!cansee(attacker, victim)) return B_FALSE;
if (isfleeing(victim)) { if (isfleeing(victim)) {
if (how) *how = HL_FLEEING; if (how) *how = HL_FLEEING;
return B_TRUE; return B_TRUE;
@ -18428,14 +18418,22 @@ void setrace(lifeform_t *lf, enum RACE rid, int frompolymorph) {
// inherit most flags from race // inherit most flags from race
for (f = lf->race->flags->first ; f ; f = f->next) { for (f = lf->race->flags->first ; f ; f = f->next) {
int ignorethis = B_FALSE;
switch (f->id) { switch (f->id) {
case F_RARITY: case F_RARITY:
case F_MPDICE: case F_MPDICE:
break; break;
default: default:
//if (gamemode == GM_GAMESTARTED) checkmapflags(player->cell->map); // debugging if ((f->condition == FC_IFMONSTER) && isplayer(lf)) {
addflag_real(lf->flags, f->id, f->val[0], f->val[1], f->val[2], f->text, FROMRACE, f->known, -1); ignorethis = B_TRUE;
//if (gamemode == GM_GAMESTARTED) checkmapflags(player->cell->map); // debugging } else if ((f->condition == FC_IFPLAYER) && !isplayer(lf)) {
ignorethis = B_TRUE;
}
if (!ignorethis) {
//if (gamemode == GM_GAMESTARTED) checkmapflags(player->cell->map); // debugging
addflag_real(lf->flags, f->id, f->val[0], f->val[1], f->val[2], f->text, FROMRACE, f->known, -1);
//if (gamemode == GM_GAMESTARTED) checkmapflags(player->cell->map); // debugging
}
break; break;
} }
} }
@ -19835,17 +19833,19 @@ void startlfturn(lifeform_t *lf) {
f = lfhasflag(lf, F_AUTOCREATEOB); f = lfhasflag(lf, F_AUTOCREATEOB);
if (f) { if (f) {
int radius; if (lf->cell->habitat->id != H_HEAVEN) {
radius = f->val[0]; int radius;
if (radius == -1) { radius = f->val[0];
cell_t *c; if (radius == -1) {
// add object in front. cell_t *c;
c = getcellindir(lf->cell, lf->facing); // add object in front.
if (c && !c->type->solid) { c = getcellindir(lf->cell, lf->facing);
addob(c->obpile, f->text); if (c && !c->type->solid) {
addob(c->obpile, f->text);
}
} else {
addobsinradius(lf->cell, f->val[0], DT_COMPASS, f->text, B_FALSE, lf);
} }
} else {
addobsinradius(lf->cell, f->val[0], DT_COMPASS, f->text, B_FALSE, lf);
} }
} }
@ -20386,6 +20386,7 @@ void startlfturn(lifeform_t *lf) {
continue; continue;
} }
/*
f = hasflag(o->flags, F_GODSTONE); f = hasflag(o->flags, F_GODSTONE);
if (f && (f->val[2] == B_TRUE)) { if (f && (f->val[2] == B_TRUE)) {
flag_t *f2; flag_t *f2;
@ -20396,6 +20397,7 @@ void startlfturn(lifeform_t *lf) {
godsay(god->id, B_TRUE, "Mortal! Do not touch that!"); more(); godsay(god->id, B_TRUE, "Mortal! Do not touch that!"); more();
f->val[2] = B_FALSE; f->val[2] = B_FALSE;
} }
*/
f = hasflag(o->flags, F_WALKDAM); f = hasflag(o->flags, F_WALKDAM);
if (f) { if (f) {
@ -21887,7 +21889,23 @@ int usestairs(lifeform_t *lf, object_t *o, int onpurpose, int climb) {
// locked? // locked?
if (hasflag(o->flags, F_LOCKED)) { if (hasflag(o->flags, F_LOCKED)) {
if (isplayer(lf)) msg("The %s seems to be locked.", noprefix(obname)); if (isplayer(lf)) {
msg("The %s seems to be locked.", noprefix(obname));
if (o->type->id == OT_VSTAIRSDOWN) {
object_t *key;
key = hasobwithflag(lf->pack, F_VAULTKEY);
if (key) {
char ques[BUFLEN],obname[BUFLEN],ch;
getobname(key, obname, 1);
sprintf(ques,"Use your %s to open it?", noprefix(obname));
ch = askchar(ques,"yn","n", B_TRUE, B_FALSE);
if (ch == 'y') {
operate(lf, key, lf->cell);
}
}
}
}
if (onpurpose) taketime(lf, getmovespeed(lf)); if (onpurpose) taketime(lf, getmovespeed(lf));
return B_TRUE; return B_TRUE;
} }

394
map.c
View File

@ -301,6 +301,13 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int randomjobok
if (db) dbtime("checking for job"); if (db) dbtime("checking for job");
lf->born = B_FALSE; lf->born = B_FALSE;
// special case for vaults
if (c->map->habitat->id == H_MASTERVAULTS) {
if (hasflagval(lf->flags, F_STARTJOB, NA, J_GUARD, NA, NULL)) {
wantjob = J_GUARD;
}
}
if (wantjob == J_NONE) { if (wantjob == J_NONE) {
if (randomjobok) { if (randomjobok) {
int nretflags,i; int nretflags,i;
@ -594,7 +601,7 @@ object_t *addrandomob(cell_t *c) {
return NULL; return NULL;
} }
if (real_getrandomob(c->map, buf, NA, c->habitat->id, SZ_MAX, SK_NONE, B_FALSE, OC_NONE, DT_NONE)) { if (real_getrandomob(c->map, buf, NA, c->habitat->id, SZ_MAX, SK_NONE, B_FALSE, OC_NONE, DT_NONE, F_NONE)) {
if (db) dblog("adding rand obj %s to cell %d,%d",buf,c->x,c->y); if (db) dblog("adding rand obj %s to cell %d,%d",buf,c->x,c->y);
o = addob(c->obpile, buf); o = addob(c->obpile, buf);
} }
@ -732,7 +739,8 @@ int getroomid(cell_t *c) {
// whichside should be D_ORTH // whichside should be D_ORTH
// for now, this function will NOT include room corners // for now, this function will NOT include room corners
void getroomedge(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, int whichside, cell_t **retcell, int *ncells, int onlywantsolid) { // if 'includefixed' is passed then walls in vaults with maintainedge ARE included.
void getroomedge(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, int whichside, cell_t **retcell, int *ncells, int onlywantsolid, int includefixed) {
int x,y; int x,y;
cell_t *c; cell_t *c;
*ncells = 0; *ncells = 0;
@ -740,6 +748,7 @@ void getroomedge(map_t *map, int roomid, int minx, int miny, int maxx, int maxy,
y = miny; y = miny;
for (x = minx+1; x <= maxx-1; x++) { for (x = minx+1; x <= maxx-1; x++) {
c = getcellat(map, x, y); c = getcellat(map, x, y);
if (!includefixed && cellisfixedvaultwall(c)) continue;
if (!onlywantsolid || c->type->solid) { if (!onlywantsolid || c->type->solid) {
retcell[*ncells] = getcellat(map, x, y); retcell[*ncells] = getcellat(map, x, y);
(*ncells)++; (*ncells)++;
@ -749,6 +758,7 @@ void getroomedge(map_t *map, int roomid, int minx, int miny, int maxx, int maxy,
y = maxy; y = maxy;
for (x = minx+1; x <= maxx-1; x++) { for (x = minx+1; x <= maxx-1; x++) {
c = getcellat(map, x, y); c = getcellat(map, x, y);
if (!includefixed && cellisfixedvaultwall(c)) continue;
if (!onlywantsolid || c->type->solid) { if (!onlywantsolid || c->type->solid) {
retcell[*ncells] = getcellat(map, x, y); retcell[*ncells] = getcellat(map, x, y);
(*ncells)++; (*ncells)++;
@ -758,6 +768,7 @@ void getroomedge(map_t *map, int roomid, int minx, int miny, int maxx, int maxy,
x = minx; x = minx;
for (y = miny+1; y <= maxy-1; y++) { for (y = miny+1; y <= maxy-1; y++) {
c = getcellat(map, x, y); c = getcellat(map, x, y);
if (!includefixed && cellisfixedvaultwall(c)) continue;
if (!onlywantsolid || c->type->solid) { if (!onlywantsolid || c->type->solid) {
retcell[*ncells] = getcellat(map, x, y); retcell[*ncells] = getcellat(map, x, y);
(*ncells)++; (*ncells)++;
@ -767,6 +778,7 @@ void getroomedge(map_t *map, int roomid, int minx, int miny, int maxx, int maxy,
x = maxx; x = maxx;
for (y = miny+1; y <= maxy-1; y++) { for (y = miny+1; y <= maxy-1; y++) {
c = getcellat(map, x, y); c = getcellat(map, x, y);
if (!includefixed && cellisfixedvaultwall(c)) continue;
if (!onlywantsolid || c->type->solid) { if (!onlywantsolid || c->type->solid) {
retcell[*ncells] = getcellat(map, x, y); retcell[*ncells] = getcellat(map, x, y);
(*ncells)++; (*ncells)++;
@ -969,11 +981,11 @@ int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, in
// place a door. // place a door.
for (d = D_N; d <= D_W; d++) { for (d = D_N; d <= D_W; d++) {
npossible = 0; npossible = 0;
getroomedge(map, roomid, minx, miny, maxx, maxy, d, cell, &ncells, B_TRUE); getroomedge(map, roomid, minx, miny, maxx, maxy, d, cell, &ncells, B_TRUE, B_FALSE);
for (i = 0; i < ncells; i++) { for (i = 0; i < ncells; i++) {
cell_t *newcell; cell_t *newcell;
if (cellisfixedvaultwall(cell[i])) continue; //if (cellisfixedvaultwall(cell[i])) continue;
// is there empty space on the other side of this wall segment? // is there empty space on the other side of this wall segment?
newcell = getcellindir(cell[i], d); newcell = getcellindir(cell[i], d);
@ -1024,18 +1036,17 @@ int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, in
if (doorsadded == 0) { if (doorsadded == 0) {
int i,d,used[MAXDIR_ORTH],poss[MAXDIR_ORTH]; int i,d,used[MAXDIR_ORTH],poss[MAXDIR_ORTH];
int dodoor[MAXDIR_ORTH]; int dodoor[MAXDIR_ORTH];
int ndodoors = 0; int ndoors,maxdoors,nposs = 0;
int ndoors,nposs = 0;
int sel; int sel;
// //
for (d = D_N; d <= D_W; d++) { for (d = D_N; d <= D_W; d++) {
used[d] = B_FALSE; used[d] = B_FALSE;
} }
// no possible door locations - add a random number // no possible door locations - add a random number
ndoors = rnd(1,4); maxdoors = rnd(1,4);
ndoors = 0;
for (i = 0; i < ndoors; i++) { for (i = 0; i < maxdoors; i++) {
// find a dir we haven't already used // find a dir we haven't already used
nposs = 0; nposs = 0;
for (d = D_N; d <= D_W; d++) { for (d = D_N; d <= D_W; d++) {
@ -1046,14 +1057,14 @@ int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, in
} }
sel = rnd(0,nposs-1); sel = rnd(0,nposs-1);
used[poss[sel]] = B_TRUE; used[poss[sel]] = B_TRUE;
dodoor[ndodoors] = poss[sel]; dodoor[ndoors++] = poss[sel];
} }
// actually make the doors // actually make the doors
for (i = 0; i < ndodoors; i++) { for (i = 0; i < ndoors; i++) {
int sel; int sel;
d = dodoor[i]; d = dodoor[i];
getroomedge(map, roomid, minx, miny, maxx, maxy, d, cell, &ncells, B_TRUE); getroomedge(map, roomid, minx, miny, maxx, maxy, d, cell, &ncells, B_TRUE, B_FALSE);
if (ncells) { if (ncells) {
sel = rnd(0,ncells-1); sel = rnd(0,ncells-1);
if (rnd(1,100) <= doorpct) { if (rnd(1,100) <= doorpct) {
@ -2516,7 +2527,8 @@ void calclight(map_t *map) {
} }
int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int *by, int force) { // if "stayclose" is non-zero, then room must be within 'stayclose' cells of another room.
int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int *by, int force, int stayclose) {
int x,y,i; int x,y,i;
int bestscore = 9888; int bestscore = 9888;
coord_t coord[MAX_MAPW*MAX_MAPH]; coord_t coord[MAX_MAPW*MAX_MAPH];
@ -2549,76 +2561,128 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int
int valid = B_TRUE; int valid = B_TRUE;
int rx,ry; int rx,ry;
score = 0; score = 0;
// calculate score if we placed the room with its top left corner here. if (stayclose) {
for (ry = y; (ry < y+h) && valid; ry++) { int disttoroom = 999;
for (rx = x; (rx < x+w) && valid; rx++) { int n;
int includethiscell = B_FALSE; for (n = 1; n <= stayclose; n++) {
cell = getcellat(map, rx,ry); int startx,starty,endx,endy;
startx = x - n;
// NEVER create a room whcih will: starty = y - n;
// - be on top of the player (normally this can't happen, endx = x+w + (n-1);
// but debugging via 'create vault' could do it) endy = y+h + (n-1);
if (cell->lf && isplayer(cell->lf)) { limit(&startx, 0, map->w-1);
valid = B_FALSE; limit(&starty, 0, map->h-1);
} limit(&endx, 0, map->w-1);
// - be on top of an existing staircase limit(&endy, 0, map->h-1);
if (hasobwithflag(cell->obpile, F_CLIMBABLE)) { for (ry = starty; ry <= endy; ry++) {
valid = B_FALSE; // check all x vals for top / bottom
} if ((ry == starty) || (ry == endy)) {
/* for (rx = startx; rx <= endx; rx++) {
// - overlap the inside of an existing room cell = getcellat(map, rx,ry);
if (cellwalkable(NULL, cell, NULL) && isroom(cell)) { // near a room?
valid = B_FALSE; if (cell && isroom(cell)) {
} disttoroom = n;
// - overlap any part of an existing vault break;
if (cell->room && cell->room->vault) { }
valid = B_FALSE; }
}
*/
// - overlap any part of an existing room/vault
if (cell->room) {
valid = B_FALSE;
}
// - overlap a 'locked' cell
if (cell->locked) {
valid = B_FALSE;
}
// is this cell adjacent to an empty cell and not a
// corner (ie. a valid door location)
if (countcellexits(cell, DT_ORTH)) {
score++;
if ( ((ry == y) && (rx == x)) ||
((ry == y) && (rx == (x+w-1))) ||
((ry == y+h-1) && (rx == x)) ||
((ry == y+h-1) && (rx == (x+w-1))) ) {
// corner. don't check this cell for scores.
} else { } else {
// otherwise just check l/r
cell = getcellat(map, startx,ry);
if (cell && isroom(cell)) {
disttoroom = n;
} else {
cell = getcellat(map, endx,ry);
if (cell && isroom(cell)) {
disttoroom = n;
}
}
}
if (disttoroom != 999) break;
}
if (disttoroom != 999) break;
}
if (disttoroom > stayclose) {
// can't do this one.
valid = B_FALSE;
}
}
if (valid) {
// calculate score if we placed the room with its top left corner here.
for (ry = y; (ry < y+h) && valid; ry++) {
for (rx = x; (rx < x+w) && valid; rx++) {
int includethiscell = B_FALSE;
cell = getcellat(map, rx,ry);
// NEVER create a room whcih will:
// - be on top of the player (normally this can't happen,
// but debugging via 'create vault' could do it)
if (cell->lf && isplayer(cell->lf)) {
valid = B_FALSE;
}
// - be on top of an existing staircase
if (hasobwithflag(cell->obpile, F_CLIMBABLE)) {
valid = B_FALSE;
}
/*
// - overlap the inside of an existing room
if (cellwalkable(NULL, cell, NULL) && isroom(cell)) {
valid = B_FALSE;
}
// - overlap any part of an existing vault
if (cell->room && cell->room->vault) {
valid = B_FALSE;
}
*/
// - overlap any part of an existing room/vault
if (cell->room) {
valid = B_FALSE;
}
// - overlap a 'locked' cell
if (cell->locked) {
valid = B_FALSE;
}
// is this cell adjacent to an empty cell and not a
// corner (ie. a valid door location)
if (countcellexits(cell, DT_ORTH)) {
score++;
if ( ((ry == y) && (rx == x)) ||
((ry == y) && (rx == (x+w-1))) ||
((ry == y+h-1) && (rx == x)) ||
((ry == y+h-1) && (rx == (x+w-1))) ) {
// corner. don't check this cell for scores.
} else {
includethiscell = B_TRUE;
}
} else {
// not adjacent to any empty cells. ok.
includethiscell = B_TRUE; includethiscell = B_TRUE;
} }
} else { if (includethiscell) {
// not adjacent to any empty cells. ok. // is this cell empty itself?
includethiscell = B_TRUE; if (!cell->type->solid) score += 3;
} // avoid being adjacent to other room walls
if (includethiscell) { if (countcellexits(cell, DT_ORTH)) score++;
// is this cell empty itself?
if (!cell->type->solid) score += 3;
// avoid being adjacent to other room walls
if (countcellexits(cell, DT_ORTH)) score++;
score += (countadjrooms(cell)*3); score += (countadjrooms(cell, DT_ORTH)*3);
// overlapping another room? // overlapping another room?
if (isroom(cell)) { if (isroom(cell)) {
if (force) { if (force) {
score += 10; score += 10;
} else { } else {
valid = B_FALSE; valid = B_FALSE;
}
} }
} }
} }
} }
} }
if (valid) { if (valid) {
if (score < bestscore) { if (score < bestscore) {
if (db) dblog("new best score: %d (topleft at %d,%d)",score,x,y); if (db) dblog("new best score: %d (topleft at %d,%d)",score,x,y);
@ -2707,11 +2771,17 @@ int countadjcellsoftype(cell_t *cell, enum CELLTYPE id, int dirtype) {
return count; return count;
} }
int countadjrooms(cell_t *cell) { int countadjrooms(cell_t *cell, int dirtype) {
int d; int d;
int count = 0; int count = 0;
cell_t *newcell; cell_t *newcell;
for (d = D_N; d < MAXDIR_ORTH; d++) { int start, end;
if (dirtype == DT_COMPASS) {
start = DC_N; end = DC_NW;
} else {
start = D_N; end = D_W;
}
for (d = start; d <= end; d++) {
newcell = getcellindir(cell, d); newcell = getcellindir(cell, d);
if (newcell && isroom(newcell)) { if (newcell && isroom(newcell)) {
count++; count++;
@ -2850,19 +2920,23 @@ void createantnest(map_t *map, int depth, map_t *parentmap, int exitdir, object_
cell_t *c; cell_t *c;
enum CELLTYPE emptycell,solidcell; enum CELLTYPE emptycell,solidcell;
int ndug = 0; int ndug = 0;
// what kind of cells will 'empty' ones be?
emptycell = getmapempty(map);
solidcell = getmapsolid(map);
// fill entire maze with walls // fill entire maze with walls
for (y = 0; y < map->h; y++) { for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) { for (x = 0; x < map->w; x++) {
addcell(map, x, y); c = getcellat(map, x, y);
if (!c->locked) {
setcelltype(c, solidcell);
}
} }
} }
map->illumination = IL_FULLLIT; map->illumination = IL_FULLLIT;
// what kind of cells will 'empty' ones be?
emptycell = getmapempty(map);
solidcell = getmapsolid(map);
// pick initial random point // pick initial random point
c = getrandomcell(map); c = getrandomcell(map);
@ -2877,6 +2951,7 @@ void createantnest(map_t *map, int depth, map_t *parentmap, int exitdir, object_
} }
void createborder(map_t *map, enum CELLTYPE solidtype) { void createborder(map_t *map, enum CELLTYPE solidtype) {
int x,y; int x,y;
cell_t *c; cell_t *c;
@ -2921,8 +2996,8 @@ void createbyhut(map_t *map, int depth, map_t *parentmap, int exitdir, object_t
// fill entire maze with walls // fill entire maze with walls
for (y = 0; y < map->h; y++) { for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) { for (x = 0; x < map->w; x++) {
c = addcell(map, x, y); c = getcellat(map, x, y);
setcelltype(c, solidcell); if (!c->locked) setcelltype(c, solidcell);
} }
} }
// add a random babayaga's hut vault // add a random babayaga's hut vault
@ -2977,7 +3052,7 @@ void createcave(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *
for (y = 0; y < map->h; y++) { for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) { for (x = 0; x < map->w; x++) {
c = getcellat(map, x, y); c = getcellat(map, x, y);
setcelltype(c, solidcell); if (!c->locked) setcelltype(c, solidcell);
} }
} }
@ -3013,7 +3088,7 @@ void createcave(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *
} }
} }
// just do a normal room // just do a normal room
calcposandmakeroom(map, map->nrooms, NA, NA, DEF_VAULTMARGIN, DEF_VAULTMARGIN, NULL, NULL, NULL, NULL, 50, B_FALSE); calcposandmakeroom(map, map->nrooms, NA, NA, NA, NA, DEF_VAULTMARGIN, DEF_VAULTMARGIN, NULL, NULL, NULL, NULL, 50, 25, B_FALSE, 0);
//roomvault[i] = B_FALSE; //roomvault[i] = B_FALSE;
} }
} }
@ -3057,8 +3132,8 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_
int turnpct = DEF_TURNPCT; int turnpct = DEF_TURNPCT;
int sparseness = DEF_SPARSENESS; int sparseness = DEF_SPARSENESS;
int looppct = DEF_LOOPPCT; int looppct = DEF_LOOPPCT;
int minrooms = MINROOMS; int minrooms = MINROOMS_DUN;
int maxrooms = MAXROOMS; int maxrooms = MAXROOMS_DUN;
enum CORRIDORTYPE corridortype = CDT_NORMAL; enum CORRIDORTYPE corridortype = CDT_NORMAL;
int moved = 0; int moved = 0;
@ -3380,7 +3455,7 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_
} }
} }
// just do a normal room // just do a normal room
calcposandmakeroom(map, map->nrooms, NA, NA, DEF_VAULTMARGIN, DEF_VAULTMARGIN, NULL, NULL, NULL, NULL, 50, B_FALSE); calcposandmakeroom(map, map->nrooms, NA, NA, NA, NA, DEF_VAULTMARGIN, DEF_VAULTMARGIN, NULL, NULL, NULL, NULL, 50, 25, B_FALSE, 0);
//roomvault[i] = B_FALSE; //roomvault[i] = B_FALSE;
} }
} }
@ -3525,7 +3600,7 @@ void createforest(map_t *map, int depth, map_t *parentmap, int exitdir, object_t
for (y = 0; y < map->h; y++) { for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) { for (x = 0; x < map->w; x++) {
c = getcellat(map, x, y); c = getcellat(map, x, y);
setcelltype(c, onein(4) ? CT_DIRT : emptycell ); if (!c->locked) setcelltype(c, onein(4) ? CT_DIRT : emptycell );
} }
} }
@ -3630,6 +3705,9 @@ void createhabitat(map_t *map, int depth, map_t *parentmap, int exitdir, object_
case H_HEAVEN: case H_HEAVEN:
createheaven(map, depth, parentmap, exitdir, entryob); createheaven(map, depth, parentmap, exitdir, entryob);
break; break;
case H_MASTERVAULTS:
createmastervaults(map, depth, parentmap, exitdir, entryob);
break;
case H_PIT: case H_PIT:
createpit(map, depth, parentmap, exitdir, entryob); createpit(map, depth, parentmap, exitdir, entryob);
break; break;
@ -3669,8 +3747,8 @@ void createheaven(map_t *map, int depth, map_t *parentmap, int exitdir, object_t
// fill entire maze with walls // fill entire maze with walls
for (y = 0; y < map->h; y++) { for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) { for (x = 0; x < map->w; x++) {
c = addcell(map, x, y); c = getcellat(map, x, y);
setcelltype(c, solidcell); if (!c->locked) setcelltype(c, solidcell);
} }
} }
// add a random heaven vault // add a random heaven vault
@ -4020,6 +4098,7 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex
c->locked = B_TRUE; c->locked = B_TRUE;
} }
} }
nprevaults++;
} }
} // for each remembered thing } // for each remembered thing
@ -4294,9 +4373,11 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex
c = getcellat(map, x, y); c = getcellat(map, x, y);
if (c) { if (c) {
// add random obs, but not in vaults // add random obs, but not in vaults
if (isempty(c) && !getcellvault(c)) { if (isempty(c)) {
if (rnd(1,100) <= c->habitat->randthingpct) { if (!getcellvault(c) || (c->habitat->id == H_HEAVEN)) {
addrandomthing(c, c->habitat->randobpct, NULL); if (rnd(1,100) <= c->habitat->randthingpct) {
addrandomthing(c, c->habitat->randobpct, NULL);
}
} }
} }
// remove bad objects // remove bad objects
@ -4403,7 +4484,9 @@ void createsewer(map_t *map, int depth, map_t *parentmap, int exitdir, object_t
for (y = 0; y < map->h; y++) { for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) { for (x = 0; x < map->w; x++) {
c = getcellat(map, x, y); c = getcellat(map, x, y);
setcelltype(c, getcellempty(c)); if (!c->locked) {
setcelltype(c, getcellempty(c));
}
} }
} }
roomon = malloc((roomcountx * roomcounty) * sizeof(int)); roomon = malloc((roomcountx * roomcounty) * sizeof(int));
@ -4594,11 +4677,13 @@ void createsewer(map_t *map, int depth, map_t *parentmap, int exitdir, object_t
void createstomach(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob) { void createstomach(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob) {
vault_t *v; vault_t *v;
int x,y; int x,y;
cell_t *c;
// fill entire maze with walls // fill entire maze with walls
for (y = 0; y < map->h; y++) { for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) { for (x = 0; x < map->w; x++) {
addcell(map, x, y); c = getcellat(map, x, y);
if (!c->locked) setcelltype(c, getcellsolid(c));
} }
} }
// add a random worm vault // add a random worm vault
@ -4698,7 +4783,7 @@ int createvault(map_t *map, int roomid, vault_t *v, int *retw, int *reth, int *r
// - we don't do autodoors (will handle this further down) ------------- // - we don't do autodoors (will handle this further down) -------------
minw = f->val[0]; minw = f->val[0];
minh = f->val[1]; minh = f->val[1];
if (calcposandmakeroom(map, roomid, minw, minh, xmargin, ymargin, &minx, &miny, &w, &h, B_NODOORS, B_TRUE)) { if (calcposandmakeroom(map, roomid, minw, minh, NA, NA, xmargin, ymargin, &minx, &miny, &w, &h, B_NODOORS, 0, B_TRUE, 0)) {
return B_TRUE; return B_TRUE;
} }
if (db) dblog("made random vault %s at pos %d,%d on map %s", v->id, minx, miny, map->name); if (db) dblog("made random vault %s at pos %d,%d on map %s", v->id, minx, miny, map->name);
@ -4710,7 +4795,7 @@ int createvault(map_t *map, int roomid, vault_t *v, int *retw, int *reth, int *r
//h = v->h; //h = v->h;
getvaultwh(v, &w, &h, rotation); getvaultwh(v, &w, &h, rotation);
// find vault position // find vault position
if (calcroompos(map, w, h, xmargin, ymargin, &minx, &miny, B_TRUE)) { if (calcroompos(map, w, h, xmargin, ymargin, &minx, &miny, B_TRUE, 0)) {
// forced calcroompos should never fail since it's // forced calcroompos should never fail since it's
// allowed to overlap other rooms. // allowed to overlap other rooms.
dblog("** couldn't find position for vault %s (roomid %d)!\n", v->id, roomid); dblog("** couldn't find position for vault %s (roomid %d)!\n", v->id, roomid);
@ -5359,6 +5444,81 @@ int linkexits(map_t *m, int roomid) {
return nadded; return nadded;
} }
void createmastervaults(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob) {
int x,y,i;
cell_t *c;
enum CELLTYPE emptycell,solidcell;
int nextrarooms;
int minw,minh,maxw,maxh;
int xmarg,ymarg;
int db = B_TRUE,rv;
minw = 5;
minh = 5;
maxw = 10;
maxh = 10;
xmarg = 3;
ymarg = 3;
// what kind of cells will 'empty' ones be?
emptycell = getmapempty(map);
solidcell = getmapsolid(map);
// fill entire maze with walls
for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) {
c = getcellat(map, x, y);
if (!c->locked) setcelltype(c, solidcell);
}
}
map->illumination = IL_FULLLIT;
// place initial random room. make sure it works!
rv = B_TRUE;
while (rv) {
rv = calcposandmakeroom(map, map->nrooms, minw,minh,maxw,maxh, xmarg,ymarg, NULL, NULL, NULL, NULL, 100, 0, B_TRUE, 0);
}
// place more rooms, but they must be within 3 cells of each other.
nextrarooms = rnd(4,8);
for (i = 0; i < nextrarooms; i++) {
if (calcposandmakeroom(map, map->nrooms, minw,minh,maxw,maxh, xmarg,ymarg, NULL, NULL, NULL, NULL, 100, 0, B_TRUE, 3)) {
// failed.
break;
}
}
// clear all solid cells with adjacent rooms
for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) {
c = getcellat(map, x, y);
if (issolid(c) && !isroom(c) && countadjrooms(c, DT_COMPASS)) {
setcelltype(c, emptycell);
}
}
}
// place chests
for (i = 0; i < map->nrooms; i++) {
int nchests;
nchests = rnd(1,5);
c = getrandomroomcell(map, i, WE_WALKABLE);
if (c) {
addob(c->obpile, "random container");
}
}
// now do a border, just in case.
createborder(map, solidcell);
if (db) dblog("linkexits complete (%d rooms added).", map->nrooms);
}
void createpit(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob) { void createpit(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob) {
object_t *o; object_t *o;
cell_t *c; cell_t *c;
@ -5366,7 +5526,8 @@ void createpit(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *e
// fill entire maze with walls // fill entire maze with walls
for (y = 0; y < map->h; y++) { for (y = 0; y < map->h; y++) {
for (x = 0; x < map->w; x++) { for (x = 0; x < map->w; x++) {
addcell(map, x, y); c = getcellat(map, x, y);
if (!c->locked) setcelltype(c, getcellsolid(c));
} }
} }
// select random spot // select random spot
@ -5518,7 +5679,7 @@ void createroom(map_t *map, int roomid, int x1, int y1, int x2, int y2, int forc
} }
// room w/h are returned in *w and *h if given. // room w/h are returned in *w and *h if given.
int calcposandmakeroom(map_t *map, int roomid, int overrideminw, int overrideminh, int xmargin, int ymargin, int *retx, int *rety, int *retw, int *reth, int doorpct, int forcewalls) { int calcposandmakeroom(map_t *map, int roomid, int overrideminw, int overrideminh, int overridemaxw, int overridemaxh, int xmargin, int ymargin, int *retx, int *rety, int *retw, int *reth, int doorpct, int dooropenchance, int forcewalls, int stayclose) {
int minx,miny; int minx,miny;
int maxx,maxy; int maxx,maxy;
int w,h; int w,h;
@ -5533,6 +5694,12 @@ int calcposandmakeroom(map_t *map, int roomid, int overrideminw, int overridemin
if (overrideminh != NA) { if (overrideminh != NA) {
minroomh = overrideminh; minroomh = overrideminh;
} }
if (overridemaxw != NA) {
maxroomw = overridemaxw;
}
if (overridemaxh != NA) {
maxroomh = overridemaxh;
}
// select random width/height // select random width/height
w = rnd(minroomw, maxroomw); w = rnd(minroomw, maxroomw);
@ -5542,7 +5709,7 @@ int calcposandmakeroom(map_t *map, int roomid, int overrideminw, int overridemin
if (reth) *reth = h; if (reth) *reth = h;
// find room position // find room position
if (calcroompos(map, w, h, xmargin, ymargin, &minx, &miny, B_FALSE)) { if (calcroompos(map, w, h, xmargin, ymargin, &minx, &miny, B_FALSE, stayclose)) {
dblog("** couldn't make room!\n"); dblog("** couldn't make room!\n");
return B_TRUE; return B_TRUE;
} }
@ -5562,7 +5729,7 @@ int calcposandmakeroom(map_t *map, int roomid, int overrideminw, int overridemin
// add doors // add doors
if (doorpct) { if (doorpct) {
autodoors(map, roomid, minx, miny, maxx, maxy, doorpct, 25); autodoors(map, roomid, minx, miny, maxx, maxy, doorpct, dooropenchance);
} }
return B_FALSE; return B_FALSE;
@ -7082,12 +7249,14 @@ void initmap(void) {
addhabitat(H_SWAMP, "swamp", CT_CORRIDOR, CT_WALL, 3, 50, 0, MAXVISRANGE, OT_STAIRSUP, OT_STAIRSDOWN); addhabitat(H_SWAMP, "swamp", CT_CORRIDOR, CT_WALL, 3, 50, 0, MAXVISRANGE, OT_STAIRSUP, OT_STAIRSDOWN);
addhabitat(H_BYHUT, "babayaga's hut", CT_FLOORWOOD, CT_WALLDWOOD, 0, 0, 0, MAXVISRANGE, OT_BYHUTDOOR, OT_NONE); addhabitat(H_BYHUT, "babayaga's hut", CT_FLOORWOOD, CT_WALLDWOOD, 0, 0, 0, MAXVISRANGE, OT_BYHUTDOOR, OT_NONE);
addhabitat(H_ANTNEST, "ant nest", CT_DIRT, CT_WALLDIRT, 5, 40, 0, MAXVISRANGE, OT_STAIRSUP, OT_STAIRSDOWN); addhabitat(H_ANTNEST, "ant nest", CT_DIRT, CT_WALLDIRT, 5, 40, 0, MAXVISRANGE, OT_STAIRSUP, OT_STAIRSDOWN);
addhabitat(H_MASTERVAULTS, "master vaults", CT_FLOORDURANITE, CT_WALLDURANITE, 5, 0, 0, MAXVISRANGE, OT_VSTAIRSUP, OT_VSTAIRSDOWN);
// cell types - solid // cell types - solid
// floorheight, hp // floorheight, hp
addcelltype(CT_WALL, "rock wall", UNI_SHADEDARK, C_GREY, B_SOLID, B_OPAQUE, MT_STONE, 0, 50); addcelltype(CT_WALL, "rock wall", UNI_SHADEDARK, C_GREY, B_SOLID, B_OPAQUE, MT_STONE, 0, 50);
addcelltype(CT_WALLBRICK, "brick wall", UNI_SHADEDARK, C_ORANGE, B_SOLID, B_OPAQUE, MT_STONE, 0, 40); addcelltype(CT_WALLBRICK, "brick wall", UNI_SHADEDARK, C_ORANGE, B_SOLID, B_OPAQUE, MT_STONE, 0, 40);
addcelltype(CT_WALLDIRT, "dirt wall", UNI_SHADEMED, C_BROWN, B_SOLID, B_OPAQUE, MT_STONE, 0, 20); addcelltype(CT_WALLDIRT, "dirt wall", UNI_SHADEMED, C_BROWN, B_SOLID, B_OPAQUE, MT_STONE, 0, 20);
addcelltype(CT_WALLDURANITE, "duranite wall", UNI_SHADEDARK, C_MAGENTA, B_SOLID, B_OPAQUE, MT_DURANITE, 0, 20000);
addcelltype(CT_WALLWOOD, "wooden wall", UNI_SOLID, C_BROWN, B_SOLID, B_OPAQUE, MT_WOOD, 0, 30); addcelltype(CT_WALLWOOD, "wooden wall", UNI_SOLID, C_BROWN, B_SOLID, B_OPAQUE, MT_WOOD, 0, 30);
addcelltype(CT_WALLDWOOD, "wyrmwood wall", UNI_SOLID, C_BROWN, B_SOLID, B_OPAQUE, MT_DRAGONWOOD, 0, 100); addcelltype(CT_WALLDWOOD, "wyrmwood wall", UNI_SOLID, C_BROWN, B_SOLID, B_OPAQUE, MT_DRAGONWOOD, 0, 100);
addcelltype(CT_WALLFLESH, "flesh wall", UNI_SOLID, C_RED, B_SOLID, B_OPAQUE, MT_FLESH, 0, 25); addcelltype(CT_WALLFLESH, "flesh wall", UNI_SOLID, C_RED, B_SOLID, B_OPAQUE, MT_FLESH, 0, 25);
@ -7100,6 +7269,7 @@ void initmap(void) {
addcelltype(CT_CORRIDOR, "rock floor", '.', C_GREY, B_EMPTY, B_TRANS, MT_STONE, 0, -1); addcelltype(CT_CORRIDOR, "rock floor", '.', C_GREY, B_EMPTY, B_TRANS, MT_STONE, 0, -1);
addcelltype(CT_LOOPCORRIDOR, "rock floor", 'L', C_GREY, B_EMPTY, B_TRANS, MT_STONE, 0, -1); addcelltype(CT_LOOPCORRIDOR, "rock floor", 'L', C_GREY, B_EMPTY, B_TRANS, MT_STONE, 0, -1);
addcelltype(CT_FLOORCARPET, "carpetted floor", '.', C_RED, B_EMPTY, B_TRANS, MT_CLOTH, 0, -1); addcelltype(CT_FLOORCARPET, "carpetted floor", '.', C_RED, B_EMPTY, B_TRANS, MT_CLOTH, 0, -1);
addcelltype(CT_FLOORDURANITE, "duranite floor", '.', C_MAGENTA, B_EMPTY, B_TRANS, MT_DURANITE, 0, -1);
addcelltype(CT_FLOORWOOD, "wood floor", '.', C_BROWN, B_EMPTY, B_TRANS, MT_WOOD, 0, -1); addcelltype(CT_FLOORWOOD, "wood floor", '.', C_BROWN, B_EMPTY, B_TRANS, MT_WOOD, 0, -1);
addcelltype(CT_FLOORFLESH, "flesh floor", '.', C_RED, B_EMPTY, B_TRANS, MT_FLESH, 0, -1); addcelltype(CT_FLOORFLESH, "flesh floor", '.', C_RED, B_EMPTY, B_TRANS, MT_FLESH, 0, -1);
addcelltype(CT_FLOORSHOP, "shop floor", '.', C_BROWN, B_EMPTY, B_TRANS, MT_WOOD, 0, -1); addcelltype(CT_FLOORSHOP, "shop floor", '.', C_BROWN, B_EMPTY, B_TRANS, MT_WOOD, 0, -1);
@ -7121,6 +7291,7 @@ void initmap(void) {
addregiontype(RG_MAINDUNGEON, "The Main Dungeon", B_FALSE, H_DUNGEON, 25, 3, D_DOWN, B_TRUE, 0, B_FALSE); addregiontype(RG_MAINDUNGEON, "The Main Dungeon", B_FALSE, H_DUNGEON, 25, 3, D_DOWN, B_TRUE, 0, B_FALSE);
addregiontype(RG_CAVE, "The Goblin Caves", B_TRUE, H_CAVE, 5, 1, D_DOWN, B_TRUE, 2, B_FALSE); addregiontype(RG_CAVE, "The Goblin Caves", B_TRUE, H_CAVE, 5, 1, D_DOWN, B_TRUE, 2, B_FALSE);
addregiontype(RG_WOODS, "The Sylvan Woods", B_TRUE, H_FOREST, 5, 3, D_DOWN, B_TRUE, 1, B_FALSE); addregiontype(RG_WOODS, "The Sylvan Woods", B_TRUE, H_FOREST, 5, 3, D_DOWN, B_TRUE, 1, B_FALSE);
addregiontype(RG_MASTERVAULTS, "The Master Vaults", B_TRUE, H_MASTERVAULTS, 3, 1, D_DOWN, B_TRUE, 5, B_TRUE);
// minor branches // minor branches
addregiontype(RG_PIT, "A Pit", B_FALSE, H_PIT, 1, 1, D_DOWN, B_FALSE, 0, B_TRUE); addregiontype(RG_PIT, "A Pit", B_FALSE, H_PIT, 1, 1, D_DOWN, B_FALSE, 0, B_TRUE);
addregiontype(RG_SEWER, "A Sewer", B_FALSE, H_SEWER, 1, 0, D_NONE, B_FALSE, 2, B_TRUE); addregiontype(RG_SEWER, "A Sewer", B_FALSE, H_SEWER, 1, 0, D_NONE, B_FALSE, 2, B_TRUE);
@ -7133,7 +7304,12 @@ void initmap(void) {
void initmaplayout(void) { void initmaplayout(void) {
//int vx[4],vy[4]; //int vx[4],vy[4];
int i; int i;
int lastlevel;
regiontype_t *rt;
// MAPMAPMAPMAP // MAPMAPMAPMAP
rt = findregiontype(RG_MAINDUNGEON);
lastlevel = rt->maxdepth;
// region definitions (outlines) // region definitions (outlines)
addregionoutline(RG_WORLDMAP); addregionoutline(RG_WORLDMAP);
// link to first dungeon // link to first dungeon
@ -7179,8 +7355,9 @@ void initmaplayout(void) {
addregionthing(lastregionoutline, i, NA, NA, RT_LF, NA, "queen ant"); addregionthing(lastregionoutline, i, NA, NA, RT_LF, NA, "queen ant");
// l11 - 14: swamp // l11 - 14: swamp
addregionthing(lastregionoutline, rnd(11,14), NA, NA, RT_HABITAT, H_SWAMP, NULL); addregionthing(lastregionoutline, rnd(11,14), NA, NA, RT_HABITAT, H_SWAMP, NULL);
// l25: last level // l25: last level
addregionthing(lastregionoutline, 25, NA, NA, RT_RNDVAULTWITHTAG, NA, "shrine"); // godstone on last floor addregionthing(lastregionoutline, lastlevel, NA, NA, RT_REGIONLINK, RG_MASTERVAULTS, "metal hatch leading down");
// 1-3 fixed sewers // 1-3 fixed sewers
addregionthing(lastregionoutline, rnd(1,25), NA, NA, RT_REGIONLINK, RG_SEWER, "drainage grate"); addregionthing(lastregionoutline, rnd(1,25), NA, NA, RT_REGIONLINK, RG_SEWER, "drainage grate");
@ -7207,6 +7384,10 @@ void initmaplayout(void) {
addregionoutline(RG_WOODS); addregionoutline(RG_WOODS);
addregionthing(lastregionoutline, 5, NA, NA, RT_RNDVAULTWITHTAG, NA, "forestboss"); addregionthing(lastregionoutline, 5, NA, NA, RT_RNDVAULTWITHTAG, NA, "forestboss");
addregionoutline(RG_MASTERVAULTS);
rt = findregiontype(RG_MASTERVAULTS);
addregionthing(lastregionoutline, rt->maxdepth, NA, NA, RT_RNDVAULTWITHTAG, NA, "shrine"); // godstone on last floor of master vaults.
// add initial regions // add initial regions
addregion(RG_WORLDMAP, NULL, -1, 0, -1); addregion(RG_WORLDMAP, NULL, -1, 0, -1);
addregion(RG_HEAVEN, NULL, -1, 0, -1); addregion(RG_HEAVEN, NULL, -1, 0, -1);
@ -7735,10 +7916,17 @@ void makedoor(cell_t *cell, int openchance) {
setcelltype(cell, getcellempty(cell)); setcelltype(cell, getcellempty(cell));
strcpy(doorbuf, "");
// in master vaults, doors are always locked.
if (m->habitat->id == H_MASTERVAULTS) {
strcpy(doorbuf, "locked ");
}
if ((rnd(1,100) + m->depth) >= 66) { if ((rnd(1,100) + m->depth) >= 66) {
strcpy(doorbuf, "iron door"); strcat(doorbuf, "iron door");
} else { } else {
strcpy(doorbuf, "wooden door"); strcat(doorbuf, "wooden door");
} }
// addob will determine whether the door is locked. if so, // addob will determine whether the door is locked. if so,

10
map.h
View File

@ -55,13 +55,13 @@ map_t *getmapindir(map_t *src, int dir);
int getmapmaxvisrange(map_t *m); int getmapmaxvisrange(map_t *m);
void getradiuscells(cell_t *centre, int radius, int dirtype, int outsideonly, enum LOFTYPE needlof, int wantcentre, cell_t **retcell, int *ncells, int scatterdensity); void getradiuscells(cell_t *centre, int radius, int dirtype, int outsideonly, enum LOFTYPE needlof, int wantcentre, cell_t **retcell, int *ncells, int scatterdensity);
int getroomid(cell_t *c); int getroomid(cell_t *c);
void getroomedge(map_t *m, int roomid, int minx, int miny, int maxx, int maxy, int whichside, cell_t **retcell, int *ncells, int onlywantsolid); void getroomedge(map_t *m, int roomid, int minx, int miny, int maxx, int maxy, int whichside, cell_t **retcell, int *ncells, int onlywantsolid, int includefixed);
object_t *gettopobject(cell_t *where, int forglyph); object_t *gettopobject(cell_t *where, int forglyph);
void calclight(map_t *map); void calclight(map_t *map);
int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int *by, int force); int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int *by, int force, int stayclose);
int compassdir(int orthdir); int compassdir(int orthdir);
int countadjcellsoftype(cell_t *cell, enum CELLTYPE id, int dirtype); int countadjcellsoftype(cell_t *cell, enum CELLTYPE id, int dirtype);
int countadjrooms(cell_t *cell); int countadjrooms(cell_t *cell, int dirtype);
int countadjcellswithflag(cell_t *cell, enum FLAG fid, int dirtype); int countadjcellswithflag(cell_t *cell, enum FLAG fid, int dirtype);
int countadjdoors(cell_t *cell); int countadjdoors(cell_t *cell);
int countadjwalls(cell_t *cell); int countadjwalls(cell_t *cell);
@ -71,6 +71,7 @@ int countmapobs(map_t *m, enum OBTYPE oid);
int countmapobswithflag(map_t *m, enum FLAG flagid); int countmapobswithflag(map_t *m, enum FLAG flagid);
int countmapobswithflagval(map_t *m, enum FLAG flagid, int val0, int val1, int val2, char *text); int countmapobswithflagval(map_t *m, enum FLAG flagid, int val0, int val1, int val2, char *text);
int countstairs(map_t *m, int dir); int countstairs(map_t *m, int dir);
void createantnest(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
void createborder(map_t *map, enum CELLTYPE solidtype); void createborder(map_t *map, enum CELLTYPE solidtype);
void createbyhut(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createbyhut(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
void createcave(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createcave(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
@ -80,12 +81,13 @@ void createforest(map_t *map, int depth, map_t *parentmap, int exitdir, object_t
void createhabitat(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createhabitat(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
void createheaven(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createheaven(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int exitdir, object_t *entryob); void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int exitdir, object_t *entryob);
void createmastervaults(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
void createpit(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createpit(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
void createregionlink(map_t *m, cell_t *c, object_t *o, char *obname, enum REGIONTYPE newregiontype, region_t *parent); void createregionlink(map_t *m, cell_t *c, object_t *o, char *obname, enum REGIONTYPE newregiontype, region_t *parent);
void createregionthing(map_t *map, regionthing_t *rt); void createregionthing(map_t *map, regionthing_t *rt);
void createriver(map_t *m); void createriver(map_t *m);
void createroom(map_t *map, int roomid, int x1, int y1, int x2, int y2, int forcewalls); void createroom(map_t *map, int roomid, int x1, int y1, int x2, int y2, int forcewalls);
int calcposandmakeroom(map_t *map, int roomid, int overrideminw, int overrideminh, int xmargin, int ymargin, int *retx, int *rety, int *retw, int *reth, int doorpct, int forcewalls); int calcposandmakeroom(map_t *map, int roomid, int overrideminw, int overrideminh, int overridemaxw, int overridemaxh, int xmargin, int ymargin, int *retx, int *rety, int *retw, int *reth, int doorpct, int dooropenchance, int forcewalls, int stayclose);
void createsewer(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createsewer(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
void createstomach(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createstomach(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);
void createswamp(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createswamp(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob);

10
move.c
View File

@ -884,10 +884,12 @@ int knockback(lifeform_t *lf, int dir, int howfar, lifeform_t *pusher, int fallc
preventchance += ((lfsize - SZ_HUMAN) * 15); preventchance += ((lfsize - SZ_HUMAN) * 15);
} }
if (pctchance(preventchance)) { if (pctchance(preventchance)) {
msg("%s stagger%s %s but hold%s %s %s.",lfname,isplayer(lf) ? "" : "s", if (cansee(player, lf)) {
getreldirname(getrelativedir(lf, dir)), msg("%s stagger%s %s but hold%s %s %s.",lfname,isplayer(lf) ? "" : "s",
isplayer(lf) ? "" : "s", isplayer(lf) ? "your" : "its", getreldirname(getrelativedir(lf, dir)),
isairborne(lf) ? "position" : "ground"); isplayer(lf) ? "" : "s", isplayer(lf) ? "your" : "its",
isairborne(lf) ? "position" : "ground");
}
return B_TRUE; return B_TRUE;
} }

11
nexus.c
View File

@ -1039,8 +1039,14 @@ void gettrrange(int depth, int *min, int *max, int range, int oodok) {
//mid = (depth/2); //mid = (depth/2);
mid = (depth); mid = (depth);
*min = mid - range - 10; limit(min, 0, maxmonhitdice); *min = mid - range - 10;
*max = mid + range; limit(max, *min, maxmonhitdice); //limit(min, 0, maxmonhitdice);
limit(min, 0, 8);
*max = mid + range;
limit(max, *min, maxmonhitdice);
} }
int getoption(enum OPTION id) { int getoption(enum OPTION id) {
@ -1175,6 +1181,7 @@ int init(void) {
return B_FALSE; return B_FALSE;
} }
// retcell[0] will be initial location
void calcbresnham(map_t *m, int x1, int y1, int x2, int y2, cell_t **retcell, int *numpixels) { void calcbresnham(map_t *m, int x1, int y1, int x2, int y2, cell_t **retcell, int *numpixels) {
int xinc1,xinc2,yinc1,yinc2,dinc1,dinc2,d; int xinc1,xinc2,yinc1,yinc2,dinc1,dinc2,d;
int xinc,yinc,dinc; int xinc,yinc,dinc;

247
objects.c
View File

@ -27,6 +27,7 @@ extern objectclass_t *objectclass,*lastobjectclass;
extern brand_t *firstbrand,*lastbrand; extern brand_t *firstbrand,*lastbrand;
extern obmod_t *firstobmod,*lastobmod; extern obmod_t *firstobmod,*lastobmod;
extern material_t *material,*lastmaterial; extern material_t *material,*lastmaterial;
extern race_t *firstrace, *lastrace;
extern recipe_t *firstrecipe,*lastrecipe; extern recipe_t *firstrecipe,*lastrecipe;
extern skill_t *firstskill, *lastskill; extern skill_t *firstskill, *lastskill;
extern region_t *firstregion; extern region_t *firstregion;
@ -1059,7 +1060,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
} }
if (found) break; if (found) break;
} }
// cope with "random gem" // cope with "random _otherstuff_"
if (!found) { if (!found) {
if (strstarts(p, "random gem")) { if (strstarts(p, "random gem")) {
int minrarity,maxrarity; int minrarity,maxrarity;
@ -1075,6 +1076,15 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
found = B_TRUE; found = B_TRUE;
} }
} }
if (strstarts(p, "random container")) {
char buf[BUFLEN];
cell_t *cc;
cc = getobpilelocation(where);
ot = getrandomobwithflag(cc->map, F_CONTAINER, buf);
if (ot) {
found = B_TRUE;
}
}
} }
if (!found) { if (!found) {
@ -4720,6 +4730,8 @@ int getmaterialvalue(enum MATERIAL mat) {
case MT_GOLD: case MT_GOLD:
case MT_DRAGONWOOD: case MT_DRAGONWOOD:
return 7; return 7;
case MT_DURANITE:
return 10;
} }
// default // default
return 1; return 1;
@ -6058,10 +6070,10 @@ objecttype_t *getoppositestairs(objecttype_t *ot) {
} }
// varargs are: // varargs are:
// OC_CLASS1, OC_CLAS2, OC_NONE, ..., DT_DAMTYPE1, DT_DAMTYPE2, .., DT_NONE // OC_CLASS1, OC_CLAS2, OC_NONE, ..., DT_DAMTYPE1, DT_DAMTYPE2, .., DT_NONE, F_WANTFLAG1, F_WANTFLAG2, ..., F_NONE
// //
// if no objectclass given then it will be picked randomly, or (if wepsk isn't sk_none) set to oc_weapon. // if no objectclass given then it will be picked randomly, or (if wepsk isn't sk_none) set to oc_weapon.
char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat, enum LFSIZE maxsize, enum SKILL wepsk, int forpickup, ... ) { objecttype_t *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat, enum LFSIZE maxsize, enum SKILL wepsk, int forpickup, ... ) {
va_list args; va_list args;
objecttype_t *ot; objecttype_t *ot;
objecttype_t *poss[MAXRANDOMOBCANDIDATES]; objecttype_t *poss[MAXRANDOMOBCANDIDATES];
@ -6069,6 +6081,8 @@ char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat,
int nwantclass = 0; int nwantclass = 0;
enum DAMTYPE wantdt[MAXCANDIDATES]; enum DAMTYPE wantdt[MAXCANDIDATES];
int nwantdt = 0; int nwantdt = 0;
enum FLAG wantflag[MAXCANDIDATES];
int nwantflag = 0;
int nposs = 0; int nposs = 0;
int selidx; int selidx;
int amt; int amt;
@ -6105,6 +6119,12 @@ char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat,
nwantdt++; nwantdt++;
wantdt[nwantdt] = va_arg(args, enum DAMTYPE); wantdt[nwantdt] = va_arg(args, enum DAMTYPE);
} }
wantflag[nwantflag] = va_arg(args, enum FLAG);
while (wantflag[nwantflag] != F_NONE) {
nwantflag++;
wantflag[nwantflag] = va_arg(args, enum FLAG);
}
va_end(args); va_end(args);
if (wepsk) { if (wepsk) {
@ -6140,16 +6160,18 @@ char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat,
// no obclass given? pick one randomly. // no obclass given? pick one randomly.
if (!nwantclass) { if (!nwantclass) {
if (wantsk) { if (wantsk || nwantdt) {
wantclass[0] = OC_WEAPON; wantclass[0] = OC_WEAPON;
} else { nwantclass = 1;
} else if (!nwantflag) {
wantclass[0] = getrandomobclass(hab->id); wantclass[0] = getrandomobclass(hab->id);
nwantclass = 1;
} }
nwantclass = 1;
} }
if ((nwantclass == 1) && (wantclass[0] == OC_BUILDING)) { if ((nwantclass == 1) && (wantclass[0] == OC_BUILDING)) {
int minused = 9999; int minused = 9999;
objecttype_t *selot = NULL;
// find least used building // find least used building
for (i = 0; i < nbuildingusage; i++) { for (i = 0; i < nbuildingusage; i++) {
if (buildingusage[i].count < minused) { if (buildingusage[i].count < minused) {
@ -6168,8 +6190,9 @@ char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat,
} }
} }
assert(nposs > 0); assert(nposs > 0);
sprintf(buf, "%s", poss[rnd(0,nposs-1)]->name); selot = poss[rnd(0,nposs-1)];
return buf; sprintf(buf, "%s", selot->name);
return selot;
} }
while (!done) { while (!done) {
@ -6280,6 +6303,21 @@ char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat,
} }
} }
// matches wanted flags?
if (nwantflag) {
found = B_TRUE;
for (i = 0; i < nwantflag; i++) {
if (!hasflag(ot->flags, wantflag[i])) {
found = B_FALSE;
break;
}
}
if (!found) {
condok = B_FALSE;
if (db) dblog(" %s fails wantflag check.", ot->name);
}
}
// matches wanted weapon skill? // matches wanted weapon skill?
if (wantsk) { if (wantsk) {
if (!hasflagval(ot->flags, F_USESSKILL, wantsk->id, NA, NA, NULL)) { if (!hasflagval(ot->flags, F_USESSKILL, wantsk->id, NA, NA, NULL)) {
@ -6448,25 +6486,29 @@ char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat,
if (db || partdb) dblog("random ob for %s: %d x %s ('%s')", habname, amt, ot->name,pluralname); if (db || partdb) dblog("random ob for %s: %d x %s ('%s')", habname, amt, ot->name,pluralname);
free(pluralname); free(pluralname);
return buf; return ot;
} }
char *getrandomob(map_t *map, char *buf) { objecttype_t *getrandomob(map_t *map, char *buf) {
return real_getrandomob(map, buf, NA, NA, SZ_MAX, SK_NONE, B_FALSE, OC_NONE, DT_NONE); return real_getrandomob(map, buf, NA, NA, SZ_MAX, SK_NONE, B_FALSE, OC_NONE, DT_NONE, F_NONE);
} }
char *getrandomobofsize(map_t *map, char *buf, enum LFSIZE maxsize) { objecttype_t *getrandomobofsize(map_t *map, char *buf, enum LFSIZE maxsize) {
return real_getrandomob(map, buf, NA, NA, maxsize, SK_NONE, B_FALSE, OC_NONE, DT_NONE); return real_getrandomob(map, buf, NA, NA, maxsize, SK_NONE, B_FALSE, OC_NONE, DT_NONE, F_NONE);
} }
char *getrandomobwithdt(map_t *map, enum DAMTYPE damtype, char *buf) { objecttype_t *getrandomobwithdt(map_t *map, enum DAMTYPE damtype, char *buf) {
return real_getrandomob(map, buf, NA, NA, SZ_MAX, SK_NONE, B_TRUE, OC_NONE, damtype, DT_NONE); return real_getrandomob(map, buf, NA, NA, SZ_MAX, SK_NONE, B_TRUE, OC_NONE, damtype, DT_NONE, F_NONE);
} }
char *getrandomobwithclass(map_t *map, enum OBCLASS cid, char *buf, int depthmod) { objecttype_t *getrandomobwithflag(map_t *map, enum FLAG fid, char *buf) {
return real_getrandomob(map, buf, NA, NA, SZ_MAX, SK_NONE, B_TRUE, OC_NONE, DT_NONE, fid, F_NONE);
}
objecttype_t *getrandomobwithclass(map_t *map, enum OBCLASS cid, char *buf, int depthmod) {
//return real_getrandomob(map, buf, RO_OBCLASS, cid, map->depth + depthmod); //return real_getrandomob(map, buf, RO_OBCLASS, cid, map->depth + depthmod);
//if (depthmod == NA) depthmod = 0; //if (depthmod == NA) depthmod = 0;
return real_getrandomob(map, buf, getmapdifficulty(map) + depthmod, NA, SZ_MAX, SK_NONE, B_FALSE, cid, OC_NONE, DT_NONE); return real_getrandomob(map, buf, getmapdifficulty(map) + depthmod, NA, SZ_MAX, SK_NONE, B_FALSE, cid, OC_NONE, DT_NONE, F_NONE);
} }
enum OBCLASS getrandomobclass(enum HABITAT hab) { enum OBCLASS getrandomobclass(enum HABITAT hab) {
@ -8291,6 +8333,17 @@ object_t *real_moveob(object_t *src, obpile_t *dst, int howmany, int stackok) {
} }
} }
// is it a godstone moving? if so, all other godstones will now vanish
if (src->type->obclass->id == OC_GODSTONE) {
object_t *oo,*nextoo;
for (oo = src->pile->first ; oo ; oo = nextoo) {
nextoo = oo->next;
if ((oo != src) && (oo->type->obclass->id == OC_GODSTONE)) {
removeob(oo, ALL);
}
}
}
if (db) dblog("DB: moveob() - moving %d x %s",howmany, src->type->name); if (db) dblog("DB: moveob() - moving %d x %s",howmany, src->type->name);
if (stackok) { if (stackok) {
@ -9088,12 +9141,26 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
if (isplayer(lf)) { if (isplayer(lf)) {
char subprompt[BUFLEN]; char subprompt[BUFLEN];
enum LOFTYPE ltype;
if (!isknown(o)) {
// default to needing lof
ltype = LOF_NEED;
} else {
f = hasflag(o->flags, F_LINKSPELL);
if (f) {
ltype = getspellloftype(f->val[0]);
} else {
ltype = LOF_NEED;
}
}
snprintf(subprompt, BUFLEN, "%s->Aim->", obname); snprintf(subprompt, BUFLEN, "%s->Aim->", obname);
if (strlen(f->text) > 0) { if (strlen(f->text) > 0) {
where = askcoords(f->text, subprompt, ttype, lf, range, LOF_NEED, B_TRUE); where = askcoords(f->text, subprompt, ttype, lf, range, ltype, B_TRUE);
} else { } else {
snprintf(buf, BUFLEN, "Where will you aim %s?",obname); snprintf(buf, BUFLEN, "Where will you aim %s?",obname);
where = askcoords(buf, subprompt, ttype, lf, range, LOF_NEED, B_TRUE); where = askcoords(buf, subprompt, ttype, lf, range, ltype, B_TRUE);
if (!haslos(lf, where)) { if (!haslos(lf, where)) {
msg("You can't see there!"); msg("You can't see there!");
return B_TRUE; return B_TRUE;
@ -9360,7 +9427,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
default: default:
break; break;
} }
dospelleffects(lf, spelltocast, power, where ? where->lf : NULL, NULL, where, B_UNCURSED, &willid, B_FALSE, NULL); dospelleffects(lf, spelltocast, power, where ? where->lf : NULL, NULL, where, B_UNCURSED, &willid, B_FALSE, o);
// special wands // special wands
} else if (o->type->id == OT_WAND_WONDER) { } else if (o->type->id == OT_WAND_WONDER) {
int power; int power;
@ -9473,6 +9540,25 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
// lumara does. // lumara does.
pleasegodmaybe(R_GODMAGIC, 2); pleasegodmaybe(R_GODMAGIC, 2);
} else if (hasflag(o->flags, F_VAULTKEY)) {
if (isplayer(lf)) {
object_t *stairs;
// vault stairs here?
stairs = hasob(lf->cell->obpile, OT_VSTAIRSDOWN);
if (stairs && hasflag(stairs->flags, F_LOCKED)) {
char stairsname[BUFLEN];
getobname(stairs, stairsname, 1);
msg("You unlock %s with your %s.", stairsname, noprefix(obname));
more();
killflagsofid(stairs->flags, F_LOCKED);
msg("Your %s vanishes!", noprefix(obname));
removeob(o, ALL);
} else {
msg("Your %s doesn't fit anything here.", noprefix(obname));
}
} else {
return B_TRUE;
}
// FROM HERE ON ARE INDIVIDUAL ONES // FROM HERE ON ARE INDIVIDUAL ONES
} else if (o->type->id == OT_BUTANETORCH) { } else if (o->type->id == OT_BUTANETORCH) {
int seen = B_FALSE; int seen = B_FALSE;
@ -9485,6 +9571,8 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
} else if (o->type->obclass->id == OC_GODSTONE) { } else if (o->type->obclass->id == OC_GODSTONE) {
if (isfullycharged(o)) { if (isfullycharged(o)) {
int i; int i;
object_t *oo;
cell_t *c;
// announce // announce
if (isplayer(lf)){ if (isplayer(lf)){
msg("Your %s unleashes a blast of power!", noprefix(obname)); msg("Your %s unleashes a blast of power!", noprefix(obname));
@ -9495,6 +9583,54 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
} }
noise(lf->cell, NULL, NC_OTHER, 10, "an ear-splitting crack", NULL); noise(lf->cell, NULL, NC_OTHER, 10, "an ear-splitting crack", NULL);
switch (o->type->id) { switch (o->type->id) {
case OT_GODSTONE_BATTLE:
// bless weapon
oo = getweapon(lf);
if (oo && (oo->blessed == B_UNCURSED)) {
blessob(oo);
}
// uncurse wep/arm
for (oo = lf->pack->first ; oo ; oo = oo->next) {
if (isequipped(oo) && iscursed(oo)) {
if (isweapon(oo) || isarmour(oo)) {
uncurseob(oo, NULL);
}
}
}
// haste
dospelleffects(NULL, OT_S_HASTE, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_FALSE, o);
// everyone in lof...
for (i = 0; i < lf->cell->map->w * lf->cell->map->h; i++) {
cell_t *c;
c = lf->cell->map->cell[i];
if (c->lf && (c->lf != lf) && haslof(lf->cell, c, LOF_WALLSTOP, NULL)) {
// nullify
dospelleffects(NULL, OT_S_NULLIFY, 10, c->lf, NULL, c->lf->cell, B_BLESSED, NULL, B_TRUE, o);
}
}
// summon 3 warriors
for (i = 0;i < 3; i++) {
// find a race which can be a warrior
race_t *poss[MAXCANDIDATES],*r;
int nposs = 0;
for (r = firstrace ; r ; r = r->next) {
if (hasflagval(r->flags, F_STARTJOB, NA, J_WARRIOR, NA, NULL)) {
poss[nposs++] = r;
}
}
if (nposs) {
cell_t *c;
char wname[BUFLEN];
r = poss[rnd(0,nposs-1)];
sprintf(wname, "%s warrior", r->name);
c = real_getrandomadjcell(lf->cell, WE_WALKABLE, B_ALLOWEXPAND, LOF_WALLSTOP, NULL, NULL, lf);
if (c) {
summonmonster(lf, c, R_SPECIFIED, wname, rnd(50,90), B_TRUE);
}
}
}
break;
case OT_GODSTONE_PURITY: case OT_GODSTONE_PURITY:
// everyone in lof drops to same hp as user // everyone in lof drops to same hp as user
/* /*
@ -9530,7 +9666,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
// revert polymorphs // revert polymorphs
if (lfhasflag(c->lf, F_ORIGRACE)) { if (lfhasflag(c->lf, F_ORIGRACE)) {
dospelleffects(NULL, OT_A_POLYREVERT, 1, dospelleffects(NULL, OT_A_POLYREVERT, 1,
c->lf, NULL, c->lf->cell, B_BLESSED, NULL, B_TRUE, NULL); c->lf, NULL, c->lf->cell, B_BLESSED, NULL, B_TRUE, o);
} }
// fix injuries ("deformities") // fix injuries ("deformities")
killflagsofid(c->lf->flags, F_INJURY); killflagsofid(c->lf->flags, F_INJURY);
@ -9541,6 +9677,9 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
} }
} }
break; break;
case OT_GODSTONE_DEATH:
dospelleffects(lf, OT_S_INFINITEDEATH, 10, lf, NULL, lf->cell, B_BLESSED, NULL, B_TRUE, o);
break;
case OT_GODSTONE_DESTRUCTION: // rage case OT_GODSTONE_DESTRUCTION: // rage
// everyone in lof gets f_rage, and hates everything // everyone in lof gets f_rage, and hates everything
for (i = 0; i < lf->cell->map->w * lf->cell->map->h; i++) { for (i = 0; i < lf->cell->map->w * lf->cell->map->h; i++) {
@ -9570,7 +9709,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
if (c->lf) { if (c->lf) {
// restore // restore
dospelleffects(NULL, OT_S_RESTORATION, 1, dospelleffects(NULL, OT_S_RESTORATION, 1,
c->lf, NULL, c->lf->cell, B_BLESSED, NULL, B_TRUE, NULL); c->lf, NULL, c->lf->cell, B_BLESSED, NULL, B_TRUE, o);
} else { } else {
object_t *oo, *nextoo; object_t *oo, *nextoo;
// revive corpses // revive corpses
@ -9578,13 +9717,64 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
nextoo = oo->next; nextoo = oo->next;
if (oo->type->id == OT_CORPSE) { if (oo->type->id == OT_CORPSE) {
dospelleffects(NULL, OT_S_RESSURECTION, 1, dospelleffects(NULL, OT_S_RESSURECTION, 1,
NULL, oo, c, B_BLESSED, NULL, B_TRUE, NULL); NULL, oo, c, B_BLESSED, NULL, B_TRUE, o);
} }
} }
} }
} }
} }
break; break;
case OT_GODSTONE_MAGIC:
// restore all mp
gainmp(lf, lf->maxmp);
// identify all objects
for (oo = lf->pack->first ; oo ; oo = oo->next) {
if (!isidentified(oo)) {
dospelleffects(lf, OT_S_IDENTIFY, 10, NULL, oo, NULL, B_BLESSED, NULL, B_FALSE, o);
}
}
// learn any spell
select_new_spell(SS_NONE);
break;
case OT_GODSTONE_NATURE:
// cure diseases
dospelleffects(NULL, OT_S_CUREPOISON, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_FALSE, o);
// everyone in lof...
for (i = 0; i < lf->cell->map->w * lf->cell->map->h; i++) {
cell_t *c;
c = lf->cell->map->cell[i];
if (c->lf && (c->lf != lf) && haslof(lf->cell, c, LOF_WALLSTOP, NULL)) {
// plants/animals become peaceful
if ((getraceclass(c->lf) == RC_PLANT) || (getraceclass(c->lf) == RC_ANIMAL)) {
makepeaceful(c->lf, lf);
}
}
}
// all in LOS
for (i = 0; i < lf->nlos; i++) {
object_t *oo,*nextoo;
cell_t *c;
c = lf->los[i];
if (!issolid(c)) {
// destroy fires
for (oo = c->obpile->first ; oo ; oo = nextoo) {
nextoo = oo->next;
if (oo->material->id == MT_FIRE) {
removeob(oo, ALL);
}
}
// ground turns to dirt
setcelltype(c, CT_DIRT);
// flower grows here.
addobfast(c->obpile, OT_FLOWER);
}
}
// summon treant
c = real_getrandomadjcell(lf->cell, WE_WALKABLE, B_ALLOWEXPAND, LOF_WALLSTOP, NULL, NULL, lf);
if (c) {
summonmonster(lf, c, R_TREANT, NULL, rnd(50,90), B_TRUE);
}
break;
case OT_GODSTONE_REVENGE: case OT_GODSTONE_REVENGE:
// everyone's objects appear underneath you // everyone's objects appear underneath you
// everyone else attacks themself // everyone else attacks themself
@ -9597,7 +9787,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
object_t *oo, *nextoo; object_t *oo, *nextoo;
// they get an injury // they get an injury
dospelleffects(NULL, OT_S_FLAYFLESH, 1, c->lf, NULL, c, B_BLESSED, NULL, B_TRUE, NULL); dospelleffects(NULL, OT_S_FLAYFLESH, 1, c->lf, NULL, c, B_BLESSED, NULL, B_TRUE, o);
// they attack themself. // they attack themself.
attackcell(c->lf, c, B_TRUE); attackcell(c->lf, c, B_TRUE);
@ -13527,6 +13717,15 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp
angergodmaybe(R_GODMAGIC, 10, GA_HERESY); angergodmaybe(R_GODMAGIC, 10, GA_HERESY);
} }
// if you sa something miss you, stop eating/training/digging/etc
//
// we use 'announcedmiss' here because we shouldn't wake up we were
// asleep (ie. couldn't see the missile missing us)
// If it hit us, losehp() will have taken care of the interruption.
if (target && isplayer(target) && announcedmiss) {
interrupt(target);
}
if (newobptr) *newobptr = newob; if (newobptr) *newobptr = newob;
return B_FALSE; return B_FALSE;
} }

View File

@ -140,11 +140,12 @@ char *getobhurtname(object_t *o, enum DAMTYPE damtype);
float getobweight(object_t *o); float getobweight(object_t *o);
float getobunitweight(object_t *o); float getobunitweight(object_t *o);
objecttype_t *getoppositestairs(objecttype_t *ot); objecttype_t *getoppositestairs(objecttype_t *ot);
char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat, enum LFSIZE maxsize, enum SKILL wepsk, int forpickup, ... ); objecttype_t *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat, enum LFSIZE maxsize, enum SKILL wepsk, int forpickup, ... );
char *getrandomob(map_t *map, char *buf); objecttype_t *getrandomob(map_t *map, char *buf);
char *getrandomobofsize(map_t *map, char *buf, enum LFSIZE maxsize); objecttype_t *getrandomobofsize(map_t *map, char *buf, enum LFSIZE maxsize);
char *getrandomobwithdt(map_t *map, enum DAMTYPE damtype, char *buf); objecttype_t *getrandomobwithdt(map_t *map, enum DAMTYPE damtype, char *buf);
char *getrandomobwithclass(map_t *map, enum OBCLASS cid, char *buf, int depthmod); objecttype_t *getrandomobwithflag(map_t *map, enum FLAG fid, char *buf);
objecttype_t *getrandomobwithclass(map_t *map, enum OBCLASS cid, char *buf, int depthmod);
enum OBCLASS getrandomobclass(enum HABITAT hab); enum OBCLASS getrandomobclass(enum HABITAT hab);
int getobrarity(object_t *o, enum RARITY *rr); int getobrarity(object_t *o, enum RARITY *rr);
enum SPELLSCHOOL getschool(enum OBTYPE sid); enum SPELLSCHOOL getschool(enum OBTYPE sid);

65
spell.c
View File

@ -3501,9 +3501,35 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
// default to unseen // default to unseen
if (seenbyplayer) *seenbyplayer = B_FALSE; if (seenbyplayer) *seenbyplayer = B_FALSE;
// adjust destination/range for wands, since you might inadvertantly
// target an invalid cell if you don't know what it is yet.
if (fromob && caster) {
enum LOFTYPE loft;
int maxr;
// reduce range if required
maxr = getspellrange(caster, spellid, power, NULL);
if (targcell && (maxr != UNLIMITED) && (getcelldist(caster->cell, targcell) > maxr)) {
cell_t *retcell[MAXCANDIDATES];
int nretcells;
calcbresnham(caster->cell->map, caster->cell->x, caster->cell->y, targcell->x, targcell->y, retcell, &nretcells);
if (maxr > (nretcells-1)) {
maxr = nretcells-1;
}
targcell = retcell[maxr];
}
// adjust for LOF
loft = getspellloftype(spellid);
if (loft != LOF_DONTNEED) {
cell_t *newtarg;
haslof(caster->cell, targcell, loft, &newtarg);
targcell = newtarg;
}
}
if (caster) { if (caster) {
if (hasflag(sp->flags, F_ONGOING)) { if (hasflag(sp->flags, F_ONGOING)) {
if (lfhasflagval(caster, F_BOOSTSPELL, spellid, NA, NA, NULL)) { if (lfhasflagval(caster, F_BOOSTSPELL, spellid, NA, NA, NULL)) {
// cancel it. // cancel it.
@ -9041,15 +9067,21 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
addflag(o->flags, F_DEAD, B_TRUE, NA, NA, NULL); addflag(o->flags, F_DEAD, B_TRUE, NA, NA, NULL);
donesomething = B_TRUE; donesomething = B_TRUE;
} }
} else if (hasflag(o->flags, F_LOCKED)) { } else {
// unlock it flag_t *f;
if (haslos(player, targcell)) { f = hasflag(o->flags, F_LOCKED);
getobname(o, buf, 1); if (f) {
msg("%s unlocks.", buf); if (f->val[2] == NA) {
if (seenbyplayer) *seenbyplayer = B_TRUE; // unlock it
if (haslos(player, targcell)) {
getobname(o, buf, 1);
msg("%s unlocks.", buf);
if (seenbyplayer) *seenbyplayer = B_TRUE;
}
killflagsofid(o->flags, F_LOCKED);
donesomething = B_TRUE;
}
} }
killflagsofid(o->flags, F_LOCKED);
donesomething = B_TRUE;
} }
} }
@ -12991,6 +13023,20 @@ int getspelllevel(enum OBTYPE spellid) {
return level; return level;
} }
enum LOFTYPE getspellloftype(enum OBTYPE spellid) {
objecttype_t *ot;
flag_t *f;
ot = findot(spellid);
if (!ot) {
return LOF_DONTNEED;
}
f = hasflag(ot->flags, F_LOSLOF);
if (f) {
return f->val[1];
}
return LOF_DONTNEED;
}
int getspellmaxpower(enum OBTYPE spellid) { int getspellmaxpower(enum OBTYPE spellid) {
flag_t *f; flag_t *f;
objecttype_t *ot; objecttype_t *ot;
@ -13865,6 +13911,9 @@ int summonlfs(lifeform_t *caster, cell_t *where, enum RACE wantrace, enum RACECL
if (hasflag(r->flags, F_GODOF)) { if (hasflag(r->flags, F_GODOF)) {
ok = B_FALSE; ok = B_FALSE;
} }
if (hasflag(r->flags, F_UNIQUE)) {
ok = B_FALSE;
}
if ((wantrc != RC_ANY) && (r->raceclass->id != wantrc)) { if ((wantrc != RC_ANY) && (r->raceclass->id != wantrc)) {
ok = B_FALSE; ok = B_FALSE;
} }

View File

@ -20,6 +20,7 @@ enum SPELLSCHOOL getskillschool(enum SKILL skid);
char *getspellcosttext(lifeform_t *lf, enum OBTYPE spellid, int power, char *buf); char *getspellcosttext(lifeform_t *lf, enum OBTYPE spellid, int power, char *buf);
int getspellduration(int min,int max,int blessed); int getspellduration(int min,int max,int blessed);
int getspelllevel(enum OBTYPE spellid); int getspelllevel(enum OBTYPE spellid);
enum LOFTYPE getspellloftype(enum OBTYPE spellid);
int getspellmaxpower(enum OBTYPE spellid); int getspellmaxpower(enum OBTYPE spellid);
char *getspellname(enum OBTYPE spellid, lifeform_t *lf, char *buf, int forcepower); char *getspellname(enum OBTYPE spellid, lifeform_t *lf, char *buf, int forcepower);
int getspellpower(lifeform_t *lf, enum OBTYPE spellid); int getspellpower(lifeform_t *lf, enum OBTYPE spellid);

25
text.c
View File

@ -1418,6 +1418,15 @@ char *getregionname(char *buf, map_t *m, region_t *r, enum REGIONNAMEFORMAT how)
case RG_MAINDUNGEON: case RG_MAINDUNGEON:
snprintf(buf, BUFLEN, "dungeon L%d", m->depth); snprintf(buf, BUFLEN, "dungeon L%d", m->depth);
break; break;
case RG_MASTERVAULTS:
if (m->depth == 1) {
snprintf(buf, BUFLEN, "outer vault");
} if (m->depth == 2) {
snprintf(buf, BUFLEN, "inner vault");
} else {
snprintf(buf, BUFLEN, "master vault");
}
break;
case RG_HEAVEN: case RG_HEAVEN:
snprintf(buf, BUFLEN, "the realm of gods"); snprintf(buf, BUFLEN, "the realm of gods");
break; break;
@ -1448,6 +1457,15 @@ char *getregionname(char *buf, map_t *m, region_t *r, enum REGIONNAMEFORMAT how)
case RG_MAINDUNGEON: case RG_MAINDUNGEON:
snprintf(buf, BUFLEN, "on level %d of the dungeon", m->depth); snprintf(buf, BUFLEN, "on level %d of the dungeon", m->depth);
break; break;
case RG_MASTERVAULTS:
if (m->depth == 1) {
snprintf(buf, BUFLEN, "in the outer vault");
} if (m->depth == 2) {
snprintf(buf, BUFLEN, "in the inner vault");
} else {
snprintf(buf, BUFLEN, "in the master vault");
}
break;
case RG_HEAVEN: case RG_HEAVEN:
snprintf(buf, BUFLEN, "in the realm of gods"); snprintf(buf, BUFLEN, "in the realm of gods");
break; break;
@ -1478,6 +1496,9 @@ char *getregionname(char *buf, map_t *m, region_t *r, enum REGIONNAMEFORMAT how)
case RG_MAINDUNGEON: case RG_MAINDUNGEON:
strcpy(buf, "the dungeon"); strcpy(buf, "the dungeon");
break; break;
case RG_MASTERVAULTS:
snprintf(buf, BUFLEN, "the master vaults");
break;
case RG_HEAVEN: case RG_HEAVEN:
snprintf(buf, BUFLEN, "the realm of gods"); snprintf(buf, BUFLEN, "the realm of gods");
break; break;
@ -1981,6 +2002,10 @@ char *noprefix(char *obname) {
p = obname; p = obname;
while (donesomething) { while (donesomething) {
donesomething = B_FALSE; donesomething = B_FALSE;
if (strcasestarts(p, "your ")) {
p += strlen("your ");
donesomething = B_TRUE;
}
if (strcasestarts(p, "the ")) { if (strcasestarts(p, "the ")) {
p += strlen("the "); p += strlen("the ");
donesomething = B_TRUE; donesomething = B_TRUE;