- [+] hecta's escaping sacrifices - only trigger this 5 turns AFTER
they get out of sight. - [+] some kind of obstacle which you must CLIMB over - [+] objects - [+] metal barricade (also breakable) - [+] pile of rubble (not breakable) - [+] F_CLIMBOBSTACLE - [+] need a climb check of difficulty v0 to move ON to it. if you fail, you fall off in a random direction. - [+] if you don't ahve the climbing skill, you can't move onto it. - [+] ...and EVERYONE needs to be able to learn swimming & climbing - [+] vaults: - [+] room with heaps of these in rows - "fortified_room" - [+] room with lots of these over a pit - "pit_path" - [+] room with lots of these over fires (or something damaging) - "firepit" - [+] if you're standing on something with "climbobstacle", you count as being higher - [+] tables should have CLIMBOBSTACLE diff 5 - [+] vault - pit with archers on the side - [+] cope with "monster_name with _objectname_" - [+] cope with objects of name "random firearm" - [+] BUG: "Gather up the spoils of battle!" A masterwork weapon store appears!--More-- - [+] rarity on wands seems broken... - [+] god gifts are happening too often when god is just 'pleased' - [+] on levels where floor is carpet, don't create vaults with obs made of MT_FIRE - [+] bjorn prayer's forcesphere radius should depend on piety level - [+] collapsing door trap - need f_doortrap to restict this to just doors
This commit is contained in:
parent
c421529221
commit
57be5448c8
99
data.c
99
data.c
|
@ -389,6 +389,7 @@ void initjobs(void) {
|
|||
addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_SPEECH, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_TWOWEAPON, NA, NA, NULL);
|
||||
// abilities
|
||||
addflag(lastjob->flags, F_LEVABIL, 3, OT_A_RAGE, NA, NULL);
|
||||
|
@ -449,6 +450,7 @@ void initjobs(void) {
|
|||
addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "pair of sandals");
|
||||
addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "2 sprigs of mistletoe");
|
||||
// initial skills
|
||||
addflag(lastjob->flags, F_STARTSKILL, SK_CLIMBING, PR_NOVICE, 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_LORE_NATURE, PR_SKILLED, NA, NULL);
|
||||
|
@ -578,7 +580,7 @@ void initjobs(void) {
|
|||
addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_BEGINNER, NA, NULL);
|
||||
addflag(lastjob->flags, F_STARTSKILL, SK_AXES, PR_NOVICE, NA, NULL);
|
||||
addflag(lastjob->flags, F_STARTSKILL, SK_COOKING, PR_BEGINNER, NA, NULL);
|
||||
addflag(lastjob->flags, F_STARTSKILL, SK_CLIMBING, PR_BEGINNER, NA, NULL);
|
||||
addflag(lastjob->flags, F_STARTSKILL, SK_CLIMBING, PR_ADEPT, NA, NULL);
|
||||
addflag(lastjob->flags, F_STARTSKILL, SK_LISTEN, PR_NOVICE, NA, NULL);
|
||||
addflag(lastjob->flags, F_STARTSKILL, SK_LORE_NATURE, PR_SKILLED, NA, NULL);
|
||||
addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_ADEPT, NA, NULL);
|
||||
|
@ -681,6 +683,7 @@ void initjobs(void) {
|
|||
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_RANGED, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_SEWING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_STAVES, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_WHIPS, NA, NA, NULL);
|
||||
|
@ -726,6 +729,7 @@ void initjobs(void) {
|
|||
// learnable skills
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_ATHLETICS, PR_ADEPT, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_CARTOGRAPHY, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_COOKING, PR_NOVICE, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, PR_EXPERT, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_METALWORK, NA, NA, NULL);
|
||||
|
@ -739,7 +743,6 @@ void initjobs(void) {
|
|||
// abilities
|
||||
addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL);
|
||||
|
||||
|
||||
addjob(J_PIRATE, "Pirate", "Pirates roam the seven seas, their mug of ale in one hand, and... nothing much in the other, since all pirates (in deference to some kind of ancient tale) have had their left hand replaced with a sharp hook. Their lifestyle has made them very wealthy and given them an impressive ability to handle their alcohol. They even start with a pet hawk. On the other hand, they are missing an eye, and not very attractive.");
|
||||
// stats
|
||||
addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 15, NA, NULL);
|
||||
|
@ -936,9 +939,11 @@ void initjobs(void) {
|
|||
// learnable skills
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, PR_ADEPT, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, PR_NOVICE, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_SEWING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_STAVES, PR_ADEPT, NA, NULL); // limit
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_THROWING, NA, NA, NULL);
|
||||
addflag(lastjob->flags, F_CANLEARN, SK_LORE_DEMONS, NA, NA, NULL);
|
||||
|
@ -1447,6 +1452,7 @@ void initobjects(void) {
|
|||
addflag(lastobjectclass->flags, F_GOESON, BP_NECK, NA, NA, NULL);
|
||||
addoc(OC_WEAPON, "Weapons", "An instrument used for the purpose of causing harm or death.", ')', C_GREY, RR_COMMON);
|
||||
addocnoun(lastobjectclass, "weapon");
|
||||
addocnoun(lastobjectclass, "firearm");
|
||||
addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastobjectclass->flags, F_ENCHANTABLE, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastobjectclass->flags, F_CANHAVEOBMOD, OM_MASTERWORK, 17, NA, NULL);
|
||||
|
@ -1730,6 +1736,18 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
|
||||
|
||||
addot(OT_RUBBLE, "pile of rubble", "A massive pile of loose rock and debris. Possible to climb, but difficult.", MT_STONE, 200, OC_DFEATURE, SZ_ENORMOUS);
|
||||
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_GLYPH, C_GREY, '\\', 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_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL);
|
||||
addflag(lastot->flags, F_CLIMBOBSTACLE, 20, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_GROWSTO, OT_BOULDER, VT_OB, NA, NULL);
|
||||
addflag(lastot->flags, F_SHRINKSTO, OT_STONE, VT_OB, NA, NULL);
|
||||
|
||||
|
||||
addot(OT_STAIRSDOWN, "staircase going down", "A stone staircase winding downwards.", MT_STONE, 3000, OC_DFEATURE, SZ_HUGE);
|
||||
addflag(lastot->flags, F_GLYPH, NA, '>', NA, NULL);
|
||||
addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, "staircase");
|
||||
|
@ -2047,7 +2065,7 @@ void initobjects(void) {
|
|||
|
||||
// traps - object only
|
||||
addot(OT_TRAPNEEDLEP, "poison needle trap", "A springed needle coated with poison.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL);
|
||||
addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, "ground");
|
||||
addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_TRAP, 23, B_TRUE, 25, NULL);
|
||||
addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL);
|
||||
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
|
||||
|
@ -2059,6 +2077,14 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
|
||||
|
||||
addot(OT_TRAPDOORFALL, "falling door trap", "A door hinged at the bottom, ready to crush the unwary.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL);
|
||||
addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_DOORTRAPONLY, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_TRAP, 25, B_TRUE, 23, NULL);
|
||||
addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL);
|
||||
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
|
||||
|
||||
// traps - either cell on object
|
||||
addot(OT_TRAPALARM, "alarm trap", "A pressure-triggered trap which sounds a loud siren.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL);
|
||||
addflag(lastot->flags, F_TRAP, 18, B_TRUE, NA, "ground");
|
||||
|
@ -2218,6 +2244,7 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_MISSILEDAM, NA, NA, NA, "1");
|
||||
|
||||
// gems
|
||||
addot(OT_AQUAMARINE, "aquamarine stone", "An aqua-coloured gemstone.", MT_STONE, 0.2, OC_ROCK, SZ_TINY);
|
||||
|
@ -4900,40 +4927,42 @@ void initobjects(void) {
|
|||
|
||||
// wands
|
||||
addot(OT_WAND_CREATEFOOD, "wand of culinary abundance", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_COMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_CREATEFOOD, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_NONE, NA, NA, NULL);
|
||||
addot(OT_WAND_KNOCK, "wand of opening", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_COMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_KNOCK, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_DOOR, NA, NA, NULL);
|
||||
/*
|
||||
addot(OT_WAND_LIGHT, "wand of light", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_COMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_LIGHT, 3, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, TR_NEEDLOF, NA, NULL);
|
||||
*/
|
||||
addot(OT_WAND_NULLIFY, "wand of nullification", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_NULLIFY, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, TR_NEEDLOF, NA, NULL);
|
||||
addot(OT_WAND_REVEALHIDDEN, "wand of reveal hidden", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_COMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_REVEALHIDDEN, NA, NA, NULL);
|
||||
addot(OT_WAND_SLOW, "wand of slowness", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_SLOW, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL);
|
||||
addot(OT_WAND_DIGGING, "wand of digging", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_DIG, NA, NA, NULL);
|
||||
//addflag(lastot->flags, F_OPERNEEDTARGET, TT_NONE, NA, NA, NULL);
|
||||
addot(OT_WAND_COLD, "wand of cold", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_COLDRAY, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL);
|
||||
addot(OT_WAND_FIRE, "wand of fire", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_FIREDART, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL);
|
||||
|
@ -4968,18 +4997,18 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL);
|
||||
addot(OT_WAND_DETONATION, "wand of detonation", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_VERYRARE, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_DETONATE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER|TT_DOOR, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL);
|
||||
addot(OT_WAND_POLYMORPH, "wand of polymorph", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_VERYRARE, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_POLYMORPH, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL);
|
||||
addot(OT_WAND_TURNUNDEAD, "wand of turn undead", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_LINKSPELL, OT_S_TURNUNDEAD, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL);
|
||||
|
||||
|
@ -5823,6 +5852,13 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_EQUIPCONFER, F_DTRESIST, DT_SONIC, NA, NULL);
|
||||
|
||||
addot(OT_METALCHUNK, "chunk of metal", "A small chunk of metal.", MT_METAL, 2, OC_MISC, SZ_TINY);
|
||||
addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, "");
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, NA, RR_UNCOMMON, "");
|
||||
addflag(lastot->flags, F_NUMAPPEAR, 1, 5, NA, "");
|
||||
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
|
||||
|
||||
addot(OT_SOGGYPAPER, "lump of soggy paper", "A useless lump of soggy paper.", MT_WETPAPER, 0.1, OC_MISC, SZ_TINY);
|
||||
addflag(lastot->flags, F_RARITY, H_SEWER, 100, RR_FREQUENT, NULL);
|
||||
addflag(lastot->flags, F_STACKABLE, NA, NA, NA, NULL);
|
||||
|
@ -6076,6 +6112,25 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_PURIFIESTO, OT_PUDDLEWATERL, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_FILLPOT, OT_POT_BLOOD, NA, NA, NULL);
|
||||
|
||||
addot(OT_WOODPLANK, "plank of wood", "A large plank of heavy wood.", MT_WOOD, 150, OC_MISC, SZ_LARGE);
|
||||
addflag(lastot->flags, F_STACKABLE, NA, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_GLYPH, C_BROWN, '_', NA, NULL);
|
||||
addflag(lastot->flags, F_DTCONVERT, DT_FIRE, NA, NA, "pile of ash");
|
||||
addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL);
|
||||
addflag(lastot->flags, F_DTVULN, DT_BASH, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_GROWSTO, OT_DOORWOOD, VT_OB, NA, NULL);
|
||||
addflag(lastot->flags, F_SHRINKSTO, OT_STICK, VT_OB, NA, NULL);
|
||||
|
||||
addot(OT_METALSHEET, "sheet of metal", "A large sheet of thick wood.", MT_WOOD, 150, OC_MISC, SZ_LARGE);
|
||||
addflag(lastot->flags, F_STACKABLE, NA, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_GLYPH, C_GREY, '_', NA, NULL);
|
||||
addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL);
|
||||
addflag(lastot->flags, F_GROWSTO, OT_DOORIRON, VT_OB, NA, NULL);
|
||||
addflag(lastot->flags, F_SHRINKSTO, OT_BULLET, VT_OB, NA, NULL);
|
||||
|
||||
addot(OT_SIGN, "sign", "A marker with something written on it.", MT_WOOD, 25, OC_MISC, SZ_MEDIUM);
|
||||
addflag(lastot->flags, F_GLYPH, C_BROWN, '|', NA, NULL);
|
||||
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
|
||||
|
@ -6146,6 +6201,8 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_PRODUCESLIGHT, 4, NA, NA, NULL);
|
||||
|
||||
|
||||
|
||||
addot(OT_COFFIN, "coffin", "A wooden coffin, made for holding the dead.", MT_WOOD, 100, OC_FURNITURE, SZ_HUMAN);
|
||||
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, NULL);
|
||||
addflag(lastot->flags, F_GLYPH, C_GREY, '|', NA, NULL);
|
||||
|
@ -6211,6 +6268,7 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL);
|
||||
addflag(lastot->flags, F_GLYPH, C_BROWN, '\\', NA, NULL);
|
||||
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_HUMAN, NA, NULL);
|
||||
addflag(lastot->flags, F_CLIMBOBSTACLE, 5, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_CRUSHABLE, SZ_LARGE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL);
|
||||
//addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
|
||||
|
@ -6232,6 +6290,19 @@ void initobjects(void) {
|
|||
addflag(lastot->flags, F_GROWSTO, OT_WOODENTABLE, VT_OB, NA, NULL);
|
||||
addflag(lastot->flags, F_SHRINKSTO, OT_STICK, VT_OB, NA, NULL);
|
||||
|
||||
addot(OT_BARRICADE, "barricade", "A short barricade constructed of metal. Looks like you might able to climb over it.", MT_METAL, 200, OC_DFEATURE, SZ_HUMAN);
|
||||
addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_RARE, NULL);
|
||||
addflag(lastot->flags, F_GLYPH, C_WHITE, '\\', 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_IMPASSABLE, SZ_MIN, SZ_HUMAN, NA, NULL);
|
||||
addflag(lastot->flags, F_CLIMBOBSTACLE, 10, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
|
||||
addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL);
|
||||
addflag(lastot->flags, F_GROWSTO, OT_IRONBARS, VT_OB, NA, NULL);
|
||||
addflag(lastot->flags, F_SHRINKSTO, OT_METALCHUNK, VT_OB, NA, NULL);
|
||||
|
||||
addot(OT_BOULDERGOLD, "gigantic golden boulder", "A massive boulder, seemingly made of solid gold.", MT_STONE, 800, OC_MISC, SZ_HUGE);
|
||||
addflag(lastot->flags, F_GLYPH, C_YELLOW, '\'', NA, NULL);
|
||||
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL);
|
||||
|
|
BIN
data/hiscores.db
BIN
data/hiscores.db
Binary file not shown.
|
@ -4,11 +4,9 @@
|
|||
.^.
|
||||
.^.
|
||||
.^.
|
||||
.^.
|
||||
@end
|
||||
|
||||
@legend
|
||||
#:cell:SOLID
|
||||
^:ob:hole in the ground
|
||||
@end
|
||||
|
||||
|
|
18
defs.h
18
defs.h
|
@ -1379,6 +1379,7 @@ enum MATERIAL {
|
|||
enum OBTYPE {
|
||||
OT_NONE,
|
||||
// dungeon features
|
||||
OT_BARRICADE,
|
||||
OT_BOULDER,
|
||||
OT_BOULDERGOLD,
|
||||
OT_GRATINGFLOOR,
|
||||
|
@ -1399,6 +1400,7 @@ enum OBTYPE {
|
|||
OT_PENTAGRAM,
|
||||
OT_HOLEINGROUND,
|
||||
OT_HOLEINROOF,
|
||||
OT_RUBBLE,
|
||||
OT_STAIRSDOWN,
|
||||
OT_STAIRSUP,
|
||||
OT_VSTAIRSDOWN,
|
||||
|
@ -1429,6 +1431,7 @@ enum OBTYPE {
|
|||
OT_TRAPALARM,
|
||||
OT_TRAPARROW,
|
||||
OT_TRAPARROWP,
|
||||
OT_TRAPDOORFALL,
|
||||
OT_TRAPEBLAST,
|
||||
OT_TRAPFIRE,
|
||||
OT_TRAPGAS,
|
||||
|
@ -2019,10 +2022,13 @@ enum OBTYPE {
|
|||
OT_BLOODSPLASH,
|
||||
OT_BLOODPOOL,
|
||||
OT_BLOODCSPLASH,
|
||||
OT_METALCHUNK,
|
||||
OT_MELTEDWAX,
|
||||
OT_SOGGYPAPER,
|
||||
OT_FLESHCHUNK,
|
||||
OT_TUSK,
|
||||
OT_WOODPLANK,
|
||||
OT_METALSHEET,
|
||||
// trail objects
|
||||
OT_FOOTPRINT,
|
||||
OT_SCENT,
|
||||
|
@ -2632,6 +2638,9 @@ enum FLAG {
|
|||
F_MATVULN, // vulnarable to damage from obs with material 'v0'
|
||||
// v1 = this % of damage is done. ie. 110%
|
||||
F_PURIFIESTO, // v0 = new obid after purify food spell
|
||||
F_CLIMBOBSTACLE, // must pass climb check of difficulty v0 to
|
||||
// walk onto this object. if you fail, you fall
|
||||
// in a random direction
|
||||
F_DAMAGABLE, // this ob can be damaged via takedamage()
|
||||
F_TINTED, // when worn on eyes, protects against bright lights
|
||||
F_HASBRAND, // has the object mod v0 (ie. OM_FLAMESTRIKE)
|
||||
|
@ -2752,9 +2761,10 @@ enum FLAG {
|
|||
// if v1 = true, trap will go off if you fail your 2nd disarm
|
||||
// check.
|
||||
// v2 = sc_dodge difficulty
|
||||
// if text == "groundonly", then this trap only goes off
|
||||
// if text == "ground", then this trap only goes off
|
||||
// if you're on the ground (ie not flying)
|
||||
F_OBJECTTRAP, // this trap can go onto an object (door, chest, etc)
|
||||
F_DOORTRAPONLY, // this trap can only go on to doors
|
||||
F_SMELLY, // lfs with enhacned scent can smell this object
|
||||
F_MAKESNOISE, // object periodically makes noise.
|
||||
// v0 = % chance of noise.
|
||||
|
@ -3332,6 +3342,9 @@ enum FLAG {
|
|||
F_WANTSBETTERARM, // lf will look for better armour, val1=covets
|
||||
F_FLEEONDAM, // lf will run away instead of counterattacking
|
||||
F_FLEEONHPPCT, // lf will run away if its hp drop to v0% or lower
|
||||
F_HECTAESCAPEE, // v0 drops by 1 each turn until the player
|
||||
// can see us. if it gets to 0, anger
|
||||
// hecta by v1.
|
||||
F_NOFLEE, // lf will not run away
|
||||
F_NOPRAY, // lf cannor pray
|
||||
F_ATTACKRANGE, // v0/v1 = min/max celldist to stay away
|
||||
|
@ -3801,6 +3814,9 @@ enum FLAG {
|
|||
F_VAULTISPLAYERSTART, // player can start in this vault
|
||||
//F_VAULTISSHOP, // this vault is a shop, so add f_shopitem to objects
|
||||
// here.
|
||||
F_VAULTHASFIRE, // this vault contains obejcts/lfs made of fire
|
||||
// ... so don't place it on a map where the floor
|
||||
// is flammable!
|
||||
F_VAULTISSHRINE, // this vault is a godstone shrine
|
||||
F_VAULTRARITY, // v0=rr_xxx
|
||||
F_VAULTSCATTER, // v0=thingtype, v1=pctchance
|
||||
|
|
9
god.c
9
god.c
|
@ -875,7 +875,8 @@ int godgiftmaybe(enum RACE rid, int fromtemple) {
|
|||
} else if (plev >= PL_PLEASED) { // ie. >= 200
|
||||
// ie. 200 -> 4%
|
||||
// ie. 500 -> 10%
|
||||
chance = piety / 50;
|
||||
//chance = piety / 50;
|
||||
chance = piety / 100;
|
||||
} else {
|
||||
chance = 0;
|
||||
}
|
||||
|
@ -1797,7 +1798,11 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
|
|||
|
||||
// knock back nearby enemies
|
||||
if (dist == 1) {
|
||||
dospelleffects(god, OT_S_FORCESPHERE, 6, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL);
|
||||
if (plev >= 0) {
|
||||
int power;
|
||||
power = 1+(plev*3);
|
||||
dospelleffects(god, OT_S_FORCESPHERE, power, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (getstamina(player) <= pctof(25, getmaxstamina(player))) {
|
||||
|
|
149
lf.c
149
lf.c
|
@ -752,6 +752,7 @@ int canclimb(lifeform_t *lf, enum ERROR *reason) {
|
|||
} else if (!cc->type->solid) {
|
||||
if (hasobwithflagval(cc->obpile, F_PIT, D_DOWN, NA, NA, NULL)) {
|
||||
// ok
|
||||
} else if (hasobwithflag(cc->obpile, F_CLIMBOBSTACLE)) {
|
||||
} else {
|
||||
if (reason) *reason = E_BADCLIMBDIR;
|
||||
return B_FALSE;
|
||||
|
@ -1126,42 +1127,19 @@ int canquaff(lifeform_t *lf, object_t *o) {
|
|||
|
||||
// can lf reach victim to attack them?
|
||||
int canreach(lifeform_t *lf, lifeform_t *victim, int *reachpenalty) {
|
||||
enum LFSIZE sizetoreach = SZ_ANY;
|
||||
int pen = 0;
|
||||
// harder to hit flying/levitating enemies, unless you are
|
||||
// large (ie. tall) enough to reach them.
|
||||
// if you are smaller than "sizetoreach", you get a penalty
|
||||
int diff,lfheight,victimheight;
|
||||
// default
|
||||
if (reachpenalty) *reachpenalty = 0;
|
||||
if (!isairborne(lf)) {
|
||||
switch (isairborne(victim)) {
|
||||
case F_FLYING:
|
||||
sizetoreach = SZ_HUMAN;
|
||||
break;
|
||||
case F_LEVITATING:
|
||||
sizetoreach = SZ_MEDIUM;
|
||||
break;
|
||||
default: sizetoreach = SZ_ANY; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sizetoreach == SZ_ANY) {
|
||||
// harder to hit something which is climbing above you
|
||||
if (isclimbing(victim) && !isclimbing(lf)) {
|
||||
if (getskill(lf, SK_CLIMBING) != PR_MASTER) {
|
||||
if (!lfhasflag(lf, F_SPIDERCLIMB)) {
|
||||
sizetoreach = SZ_LARGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sizetoreach == SZ_ANY) {
|
||||
if (reachpenalty) *reachpenalty = 0;
|
||||
return B_TRUE;
|
||||
}
|
||||
pen = sizetoreach - getlfsize(lf);
|
||||
if (pen > 0) {
|
||||
if (reachpenalty) *reachpenalty = (sizetoreach - getlfsize(lf));
|
||||
// harder to hit flying/levitating enemies, or ones climbing
|
||||
// (ie they are higher than you)
|
||||
lfheight = getlfheight(lf);
|
||||
victimheight = getlfheight(victim);
|
||||
|
||||
diff = victimheight - lfheight;
|
||||
|
||||
if (diff > 0) {
|
||||
if (reachpenalty) *reachpenalty = diff;
|
||||
return B_FALSE;
|
||||
}
|
||||
return B_TRUE;
|
||||
|
@ -6064,7 +6042,11 @@ int flee(lifeform_t *lf) {
|
|||
if (lf->lastdamlf == player->id) {
|
||||
// ie. only if the player saw them run away, or has already
|
||||
// attacked them.
|
||||
angergodmaybe(R_GODDEATH, 10, GA_MERCY);
|
||||
if (!lfhasflag(lf, F_HECTAESCAPEE)) {
|
||||
// 5 turns until hecta gets angry
|
||||
addflag(lf->flags, F_HECTAESCAPEE, 5, 10, NA, NULL);
|
||||
}
|
||||
//angergodmaybe(R_GODDEATH, 10, GA_MERCY);
|
||||
}
|
||||
}
|
||||
killflag(f);
|
||||
|
@ -6140,7 +6122,11 @@ int flee(lifeform_t *lf) {
|
|||
if ((lf->lastdamlf == player->id) || cansee(player, lf)) {
|
||||
// ie. only if the player saw them run away, or has already
|
||||
// attacked them.
|
||||
angergodmaybe(R_GODDEATH, 10, GA_MERCY);
|
||||
if (!lfhasflag(lf, F_HECTAESCAPEE)) {
|
||||
// 5 turns until hecta gets angry
|
||||
addflag(lf->flags, F_HECTAESCAPEE, 5, 10, NA, NULL);
|
||||
}
|
||||
//angergodmaybe(R_GODDEATH, 10, GA_MERCY);
|
||||
}
|
||||
}
|
||||
return B_TRUE;
|
||||
|
@ -8169,6 +8155,38 @@ enum LFCONDITION getlfcondition(lifeform_t *lf) {
|
|||
return C_DEAD;
|
||||
}
|
||||
|
||||
// returns a value representing 'lf's height off the ground.
|
||||
// higher value means higher
|
||||
int getlfheight(lifeform_t *lf) {
|
||||
int height = 0;
|
||||
switch (isairborne(lf)) {
|
||||
case F_FLYING:
|
||||
height += SZ_HUMAN;
|
||||
break;
|
||||
case F_LEVITATING:
|
||||
height += SZ_MEDIUM;
|
||||
break;
|
||||
default:
|
||||
// climbing a wall?
|
||||
if (isclimbing(lf)) {
|
||||
if (height < SZ_LARGE) height = SZ_LARGE;
|
||||
} else {
|
||||
object_t *o;
|
||||
// is lf climbing on top of something, or on a wall?
|
||||
o = hasobwithflag(lf->cell->obpile, F_CLIMBOBSTACLE);
|
||||
if (o) {
|
||||
flag_t *f;
|
||||
f = hasflag(o->flags, F_IMPASSABLE);
|
||||
if (f && (f->val[0] > 0)) {
|
||||
height += f->val[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return height;
|
||||
}
|
||||
|
||||
int getlistendetectrange(lifeform_t *lf) {
|
||||
switch (getskill(lf, SK_LISTEN)) {
|
||||
default:
|
||||
|
@ -17859,8 +17877,10 @@ void spot_hiding_lf(lifeform_t *lf, lifeform_t *hider) {
|
|||
int startclimbing(lifeform_t *lf) {
|
||||
cell_t *where;
|
||||
char lfname[BUFLEN];
|
||||
object_t *pit = NULL;
|
||||
object_t *pit = NULL,*obstacle = NULL;
|
||||
flag_t *f;
|
||||
char pitname[BUFLEN];
|
||||
char obname[BUFLEN];
|
||||
|
||||
getlfname(lf, lfname);
|
||||
|
||||
|
@ -17872,6 +17892,7 @@ int startclimbing(lifeform_t *lf) {
|
|||
strcpy(pitname, "");
|
||||
}
|
||||
|
||||
|
||||
if (pit && isplayer(lf)) {
|
||||
char ques[BUFLEN], ch;
|
||||
sprintf(ques, "Climb down %s?",pitname);
|
||||
|
@ -17883,6 +17904,14 @@ int startclimbing(lifeform_t *lf) {
|
|||
}
|
||||
}
|
||||
|
||||
obstacle = hasobwithflag(where->obpile, F_CLIMBOBSTACLE);
|
||||
if (obstacle) {
|
||||
getobname(obstacle, obname, 1);
|
||||
} else {
|
||||
strcpy(obname, "");
|
||||
}
|
||||
|
||||
|
||||
taketime(lf, getmovespeed(lf));
|
||||
|
||||
// climbing down a pit?
|
||||
|
@ -17903,6 +17932,36 @@ int startclimbing(lifeform_t *lf) {
|
|||
msg("You lose your footing!");
|
||||
}
|
||||
}
|
||||
} else if (obstacle) {
|
||||
f = hasflag(obstacle->flags, F_CLIMBOBSTACLE);
|
||||
if (skillcheck(lf, SC_CLIMB, f->val[0], 0)) {
|
||||
// announce
|
||||
if (isplayer(lf)) {
|
||||
msg("You climb onto %s.", obname);
|
||||
} else if (cansee(player, lf)) {
|
||||
if (haslos(player, where)) {
|
||||
msg("%s climbs onto %s.", lfname, obname);
|
||||
} else {
|
||||
msg("%s climbs out of view.", lfname);
|
||||
}
|
||||
}
|
||||
movelf(lf, where);
|
||||
practice(lf, SK_CLIMBING, 1);
|
||||
} else {
|
||||
cell_t *c2;
|
||||
if (isplayer(lf)) {
|
||||
msg("You try to climb onto %s, but lose your footing!", obname);
|
||||
} else if (cansee(player, lf)) {
|
||||
msg("%s tries to start climbing, but slips.", lfname);
|
||||
}
|
||||
c2 = getrandomadjcell(where, WE_WALKABLE, B_NOEXPAND);
|
||||
if (c2) {
|
||||
movelf(lf, c2);
|
||||
fall(lf, NULL, B_TRUE);
|
||||
}
|
||||
// fall
|
||||
return B_TRUE;
|
||||
}
|
||||
} else {
|
||||
if (skillcheck(lf, SC_CLIMB, getcellclimbdifficulty(where), 0)) {
|
||||
// announce
|
||||
|
@ -19981,6 +20040,22 @@ void startlfturn(lifeform_t *lf) {
|
|||
} else {
|
||||
// ai start of turn code
|
||||
killflagsofid(lf->flags, F_IGNORECELL);
|
||||
|
||||
// cope with hecta's "sacrifices" escaping from the player
|
||||
f = lfhasflag(lf, F_HECTAESCAPEE);
|
||||
if (f) {
|
||||
if (cansee(player, lf)) {
|
||||
killflag(f);
|
||||
} else {
|
||||
f->val[0]--;
|
||||
if (f->val[0] <= 0) {
|
||||
killflag(f);
|
||||
angergodmaybe(R_GODDEATH, f->val[1], GA_MERCY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if player can se
|
||||
}
|
||||
|
||||
// stuck inside solid cells?
|
||||
|
|
1
lf.h
1
lf.h
|
@ -189,6 +189,7 @@ int getleftrightwalls(lifeform_t *lf);
|
|||
int getlfaccuracy(lifeform_t *lf, object_t *wep);
|
||||
char getlfcol(lifeform_t *lf, enum MSGCHARCOL cc);
|
||||
enum LFCONDITION getlfcondition(lifeform_t *lf);
|
||||
int getlfheight(lifeform_t *lf);
|
||||
int getlistendetectrange(lifeform_t *lf);
|
||||
int getflightsizemod(lifeform_t *lf);
|
||||
enum SKILLLEVEL getmaxskilllevel(lifeform_t *lf, enum SKILL skid);
|
||||
|
|
132
map.c
132
map.c
|
@ -6284,6 +6284,7 @@ void finalisemonster(lifeform_t *lf, lifeform_t *leader, flagpile_t *wantflags,
|
|||
int nnoflags = 0,i;
|
||||
int mapdiff;
|
||||
vault_t *v;
|
||||
object_t *o;
|
||||
|
||||
mapdiff = getmapdifficulty(lf->cell->map)/2;
|
||||
|
||||
|
@ -6331,6 +6332,12 @@ void finalisemonster(lifeform_t *lf, lifeform_t *leader, flagpile_t *wantflags,
|
|||
}
|
||||
|
||||
if (wantflags) {
|
||||
// since we've already called givestartobs(), any new ones
|
||||
// in wantflags need to be handled now.
|
||||
givestartobs(lf, NULL, wantflags);
|
||||
// now remove startob flags from wantflags
|
||||
killflagsofid(wantflags, F_STARTOB);
|
||||
// ...and copy the rest over.
|
||||
copyflags(lf->flags, wantflags, NA);
|
||||
}
|
||||
|
||||
|
@ -6382,6 +6389,19 @@ void finalisemonster(lifeform_t *lf, lifeform_t *leader, flagpile_t *wantflags,
|
|||
}
|
||||
}
|
||||
|
||||
// make sure monster has ammo for their weapon
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
if (isfirearm(o) && !findammoinobpile(o, lf->pack)) {
|
||||
objecttype_t *ot;
|
||||
ot = getrandomammofor(o, B_FALSE);
|
||||
if (ot) {
|
||||
char ammoname[BUFLEN];
|
||||
sprintf(ammoname, "%d %s", rnd(2,6),ot->name);
|
||||
addob(lf->pack, ammoname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
getflags(lf->flags, retflag, &nretflags, F_LIFEOB, F_NONE);
|
||||
for (i = 0; i < nretflags; i++) {
|
||||
|
@ -7296,7 +7316,7 @@ void initmap(void) {
|
|||
// habitats
|
||||
// thingchance, obchance, vaultchance, maxvisrange, upstiartype, downstairtype
|
||||
addhabitat(H_DUNGEON, "dungeon", CT_CORRIDOR, CT_WALL, 3, 50, 30, 6, OT_STAIRSUP, OT_STAIRSDOWN);
|
||||
addhabitat(H_CAVE, "cave", CT_DIRT, CT_WALLDIRT, 5, 65, 10, 6, OT_TUNNELUP, OT_TUNNELDOWN);
|
||||
addhabitat(H_CAVE, "cave", CT_DIRT, CT_WALLDIRT, 5, 45, 20, 6, OT_TUNNELUP, OT_TUNNELDOWN);
|
||||
addhabitat(H_FOREST, "forest", CT_GRASS, CT_WALLTREE, 3, 75, 0, MAXVISRANGE, OT_TREEUP, OT_TREEDOWN);
|
||||
addhabitat(H_HEAVEN, "heaven", CT_CORRIDOR, CT_WALLGLASS, 5, 0, 0, MAXVISRANGE, OT_NONE, OT_NONE);
|
||||
addhabitat(H_PIT, "pit", CT_CORRIDOR, CT_WALL, 0, 0, 0, 5, OT_NONE, OT_NONE);
|
||||
|
@ -8293,7 +8313,7 @@ enum RACE parserace(char *name, flagpile_t *wantflags, enum JOB *wantjob, enum S
|
|||
int donesomething;
|
||||
char *p,*suff;
|
||||
job_t *j;
|
||||
char named[BUFLEN];
|
||||
char named[BUFLEN],with[BUFLEN];
|
||||
char *localname;
|
||||
char *namestart;
|
||||
behaviour_t *b;
|
||||
|
@ -8340,42 +8360,19 @@ enum RACE parserace(char *name, flagpile_t *wantflags, enum JOB *wantjob, enum S
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// try removing suffixes for "named xxx"
|
||||
strcpy(named, "");
|
||||
suff = strends(localname, " named ");
|
||||
if (suff) {
|
||||
char *suffp;
|
||||
char *p2;
|
||||
// extract the name
|
||||
p2 = named;
|
||||
suffp = suff + strlen(" named ");
|
||||
while (*suffp && (*suffp != ' ')) {
|
||||
*p2 = *suffp;
|
||||
suffp++;
|
||||
p2++;
|
||||
}
|
||||
*p2 = '\0'; // nul-terminate name
|
||||
*suff = '\0'; // strip off suffix from main string
|
||||
}
|
||||
if (strlen(named)) {
|
||||
if (wantflags) addflag(wantflags, F_NAMED, NA, NA, NA, named);
|
||||
donesomething = B_TRUE;
|
||||
}
|
||||
|
||||
// try removing suffixes for jobs
|
||||
for (j = firstjob ; j ; j = j->next) {
|
||||
char *ep;
|
||||
char jobname[BUFLEN];
|
||||
snprintf(jobname, BUFLEN, " %s", j->name);
|
||||
jobname[1] = tolower(jobname[1]);
|
||||
ep = strends(localname, jobname);
|
||||
ep = strstr(localname, jobname);
|
||||
if (ep) {
|
||||
// got it
|
||||
if (wantjob) *wantjob = j->id;
|
||||
// now strip the suffix off, starting at the space before it
|
||||
*ep = '\0';
|
||||
//*ep = '\0';
|
||||
strcpy(ep, ep+1+strlen(j->name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -8415,6 +8412,82 @@ enum RACE parserace(char *name, flagpile_t *wantflags, enum JOB *wantjob, enum S
|
|||
|
||||
}
|
||||
|
||||
|
||||
// try removing suffixes for "named xxx"
|
||||
strcpy(named, "");
|
||||
suff = strstr(localname, " named ");
|
||||
if (suff) {
|
||||
char *suffp;
|
||||
char *p2;
|
||||
// extract the name
|
||||
p2 = named;
|
||||
suffp = suff + strlen(" named ");
|
||||
while (*suffp && (*suffp != ' ')) {
|
||||
*p2 = *suffp;
|
||||
suffp++;
|
||||
p2++;
|
||||
}
|
||||
*p2 = '\0'; // nul-terminate name
|
||||
//*suff = '\0'; // strip off suffix from main string
|
||||
|
||||
// strip it off
|
||||
strcpy(suff, suffp);
|
||||
}
|
||||
if (strlen(named)) {
|
||||
if (wantflags) addflag(wantflags, F_NAMED, NA, NA, NA, named);
|
||||
donesomething = B_TRUE;
|
||||
}
|
||||
|
||||
// try removing suffixes for "with 'xxx'"
|
||||
strcpy(with, "");
|
||||
suff = strstr(localname, " with '");
|
||||
if (suff) {
|
||||
char *suffp;
|
||||
char *p2;
|
||||
// extract the name
|
||||
p2 = with;
|
||||
suffp = suff + strlen(" with '");
|
||||
while (*suffp && (*suffp != '\'')) {
|
||||
*p2 = *suffp;
|
||||
suffp++;
|
||||
p2++;
|
||||
}
|
||||
*p2 = '\0'; // nul-terminate name
|
||||
//*suff = '\0'; // strip off suffix from main string
|
||||
// strip it off
|
||||
strcpy(suff, suffp);
|
||||
}
|
||||
if (strlen(with)) {
|
||||
if (wantflags) addflag(wantflags, F_STARTOB, 100, NA, NA, with);
|
||||
donesomething = B_TRUE;
|
||||
}
|
||||
|
||||
// try removing suffixes for "with xxx"
|
||||
strcpy(with, "");
|
||||
suff = strstr(localname, " with ");
|
||||
if (suff) {
|
||||
char *suffp;
|
||||
char *p2;
|
||||
// extract the name
|
||||
p2 = with;
|
||||
suffp = suff + strlen(" with ");
|
||||
while (*suffp && (*suffp != ' ')) {
|
||||
*p2 = *suffp;
|
||||
suffp++;
|
||||
p2++;
|
||||
}
|
||||
*p2 = '\0'; // nul-terminate name
|
||||
//*suff = '\0'; // strip off suffix from main string
|
||||
// strip it off
|
||||
strcpy(suff, suffp);
|
||||
}
|
||||
if (strlen(with)) {
|
||||
if (wantflags) addflag(wantflags, F_STARTOB, 100, NA, NA, with);
|
||||
donesomething = B_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
free(localname);
|
||||
|
||||
// now get raceid
|
||||
|
@ -8577,7 +8650,8 @@ void setcellknown(cell_t *cell, int forcelev) {
|
|||
if (hasflag(player->flags, F_PHOTOMEM)) {
|
||||
cell->knowntime = PERMENANT;
|
||||
} else if (slev == PR_INEPT) {
|
||||
cell->knowntime = getattr(player, A_IQ)*2;
|
||||
//cell->knowntime = getattr(player, A_IQ)*2;
|
||||
cell->knowntime = getattr(player, A_IQ)*3;
|
||||
} else {
|
||||
cell->knowntime = PERMENANT;
|
||||
}
|
||||
|
|
29
move.c
29
move.c
|
@ -2824,7 +2824,7 @@ void triggertrap(lifeform_t *lf, object_t *o, object_t *trapob, cell_t *where) {
|
|||
}
|
||||
|
||||
// NOTE: after trapeffects(), oo might be killed.
|
||||
trapeffects(trapob, trapob->type->id, where);
|
||||
trapeffects(trapob, trapob->type->id, where, NULL);
|
||||
if (lf) interrupt(lf);
|
||||
}
|
||||
|
||||
|
@ -3265,14 +3265,39 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) {
|
|||
if (moveclear(lf, dir, &errcode)) {
|
||||
moveto(lf, cell, B_TRUE, B_TRUE);
|
||||
}
|
||||
} else if (getskill(lf, SK_CLIMBING) && hasflag(inway->flags, F_CLIMBOBSTACLE)
|
||||
&& haslos(lf, cell)) {
|
||||
int doclimb = B_TRUE;
|
||||
if (isplayer(lf)) {
|
||||
char ch;
|
||||
char obname[BUFLEN];
|
||||
getobname(inway, obname, 1);
|
||||
snprintf(buf, BUFLEN,"Attempt to climb onto %s?", obname);
|
||||
ch = askchar(buf,"yn","n", B_TRUE, B_FALSE);
|
||||
if (ch != 'y') {
|
||||
msg("Cancelled.");
|
||||
doclimb = B_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (doclimb) {
|
||||
turntoface(lf, cell);
|
||||
startclimbing(lf);
|
||||
}
|
||||
} else {
|
||||
if (isplayer(lf)) {
|
||||
char obname[BUFLEN];
|
||||
char obname[BUFLEN],text[BUFLEN];
|
||||
if (haslos(lf, cell)) {
|
||||
getobname(inway, obname, 1);
|
||||
} else {
|
||||
strcpy(obname, "something");
|
||||
}
|
||||
sprintf(text, "There is %s in your way",obname);
|
||||
if (hasflag(inway->flags, F_CLIMBOBSTACLE)) {
|
||||
strcat(text, ", and you are inept at climbing.");
|
||||
} else {
|
||||
strcat(text, ".");
|
||||
}
|
||||
msg("There is %s in your way.",obname);
|
||||
}
|
||||
}
|
||||
|
|
172
objects.c
172
objects.c
|
@ -886,6 +886,10 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
|||
trapchance = 100;
|
||||
p += strlen("trapped ");
|
||||
donesomething = B_TRUE;
|
||||
} else if (strstarts(p, "untrapped ")) {
|
||||
trapchance = 1;
|
||||
p += strlen("untrapped ");
|
||||
donesomething = B_TRUE;
|
||||
// food
|
||||
} else if (strstarts(p, "tainted ")) {
|
||||
wantfoodtaint = B_TRUE;
|
||||
|
@ -1065,15 +1069,20 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
|||
|
||||
if (matched) {
|
||||
int minrarity,maxrarity;
|
||||
enum FLAG musthaveflag = F_NONE;
|
||||
// want a specific rarity?
|
||||
rrtorarity(wantrarity, &minrarity, &maxrarity);
|
||||
|
||||
if (strstr(p, "firearm")) {
|
||||
musthaveflag = F_FIREARM;
|
||||
}
|
||||
|
||||
// want actual armour as opposed to clothing?
|
||||
if ((oc->id == OC_ARMOUR) && strstr(p, "armour")) {
|
||||
limit(&minar, 1, NA);
|
||||
}
|
||||
|
||||
ot = getrandomobofclass(oc->id, minrarity, maxrarity, matchlfskills, minar);
|
||||
ot = getrandomobofclass(oc->id, minrarity, maxrarity, matchlfskills, minar, musthaveflag);
|
||||
if (ot) {
|
||||
found = B_TRUE;
|
||||
break;
|
||||
|
@ -1089,12 +1098,8 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
|||
// want a specific rarity?
|
||||
rrtorarity(wantrarity, &minrarity, &maxrarity);
|
||||
|
||||
ot = getrandomobofclass(OC_ROCK, minrarity, maxrarity, NULL, B_FALSE);
|
||||
ot = getrandomobofclass(OC_ROCK, minrarity, maxrarity, NULL, B_FALSE, F_GEM);
|
||||
if (ot) {
|
||||
// make sure it's not just a rock.
|
||||
while (!hasflag(ot->flags, F_GEM)) {
|
||||
ot = getrandomobofclass(OC_ROCK, minrarity, maxrarity, NULL, B_FALSE);
|
||||
}
|
||||
found = B_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -1518,7 +1523,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
|||
|
||||
getrarityrange(where->where->map->depth, &min, &max, RARITYVARIANCEOB, B_FALSE);
|
||||
// random potion type
|
||||
ot = getrandomobofclass(OC_POTION, min, max, NULL, B_FALSE);
|
||||
ot = getrandomobofclass(OC_POTION, min, max, NULL, B_FALSE, F_NONE);
|
||||
if (ot) {
|
||||
f->val[0] = ot->id;
|
||||
}
|
||||
|
@ -2149,7 +2154,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
|||
enum OBTYPE traptype;
|
||||
// get a random trap
|
||||
//
|
||||
traptype = getrandomtrapforob();
|
||||
traptype = getrandomtrapforob(o);
|
||||
addflag(o->flags, F_TRAPPED, traptype, NA, NA, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -3458,12 +3463,16 @@ int doobtraps(object_t *o, lifeform_t *lf) {
|
|||
}
|
||||
|
||||
trapid = f->val[0];
|
||||
trapeffects(NULL, trapid, lf->cell);
|
||||
trapeffects(NULL, trapid, lf->cell, o);
|
||||
killflag(f); // now the trap gets removed
|
||||
|
||||
// explosion traps kill the object
|
||||
if (trapid == OT_TRAPMINE) {
|
||||
killob(o);
|
||||
// some traps kill the object
|
||||
switch (trapid) {
|
||||
case OT_TRAPMINE:
|
||||
case OT_TRAPDOORFALL:
|
||||
killob(o);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
return B_TRUE;
|
||||
|
@ -3635,6 +3644,7 @@ objecttype_t *findotn(char *name) {
|
|||
modname = strrep(modname, "pieces ", "piece ", NULL);
|
||||
modname = strrep(modname, "piles ", "pile ", NULL);
|
||||
modname = strrep(modname, "pinches ", "pinch ", NULL);
|
||||
modname = strrep(modname, "planks ", "plank ", NULL);
|
||||
modname = strrep(modname, "pools ", "pool ", NULL);
|
||||
modname = strrep(modname, "potions ", "potion ", NULL);
|
||||
modname = strrep(modname, "puddles ", "puddle ", NULL);
|
||||
|
@ -4404,24 +4414,23 @@ objecttype_t *getbasicweaponforskill(enum SKILL skid) {
|
|||
|
||||
object_t *getrandomammo(lifeform_t *lf) {
|
||||
object_t *gun;
|
||||
object_t *o;
|
||||
flag_t *f;
|
||||
int i;
|
||||
flag_t *retflag[MAXCANDIDATES];
|
||||
int nretflags = 0;
|
||||
gun = getfirearm(lf);
|
||||
if (!gun) {
|
||||
return NULL;
|
||||
}
|
||||
// TODO: at the moment we are jsut picking the first
|
||||
// possible ammo. Need to allow the player to
|
||||
// pick a specific ammo to use. USe a flag on wep
|
||||
// to do this? Or a flag on the player?
|
||||
return findammoinobpile(gun, lf->pack);
|
||||
}
|
||||
|
||||
object_t *findammoinobpile(object_t *gun, obpile_t *op) {
|
||||
flag_t *retflag[MAXCANDIDATES];
|
||||
int nretflags = 0, i;
|
||||
flag_t *f;
|
||||
object_t *o;
|
||||
|
||||
getflags(gun->flags, retflag, &nretflags, F_AMMOOB, F_NONE);
|
||||
for (i = 0; i < nretflags; i++) {
|
||||
f = retflag[i];
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
for (o = op->first ; o ; o = o->next) {
|
||||
if (o->type->id == f->val[0]) {
|
||||
return o;
|
||||
}
|
||||
|
@ -4504,16 +4513,26 @@ int getrandomgrimoirelev(void) {
|
|||
return wantlev;
|
||||
}
|
||||
|
||||
objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity, lifeform_t *forlf, int minar) {
|
||||
objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity, lifeform_t *forlf, int minar, enum FLAG musthaveflag) {
|
||||
objecttype_t *ot;
|
||||
int count = 0,sel,n;
|
||||
int totcount = 0, count = 0;
|
||||
flag_t *f;
|
||||
objecttype_t **poss;
|
||||
int nposs = 0;
|
||||
|
||||
// count total # of objecttypes
|
||||
for (ot = objecttype ; ot ; ot = ot->next) {
|
||||
totcount++;
|
||||
}
|
||||
poss = malloc(totcount*sizeof(objecttype_t *));
|
||||
|
||||
|
||||
for (ot = objecttype ; ot ; ot = ot->next) {
|
||||
if ((ot->obclass->id == ocid) && !hasflag(ot->flags, F_UNIQUE)) {
|
||||
int rarityok = B_FALSE;
|
||||
int skillok = B_FALSE;
|
||||
int armourok = B_FALSE;
|
||||
int flagok = B_FALSE;
|
||||
// does rarity match?
|
||||
f = hasflag(ot->flags, F_RARITY);
|
||||
if (f) {
|
||||
|
@ -4524,7 +4543,7 @@ objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity
|
|||
rarityok = B_TRUE;
|
||||
}
|
||||
}
|
||||
// if we're randomly selecting an objcet for a lf, make sure it matches their
|
||||
// if we're randomly selecting an object for a lf, make sure it matches their
|
||||
// skillset
|
||||
if (forlf) {
|
||||
skill_t *sk;
|
||||
|
@ -4534,7 +4553,6 @@ objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity
|
|||
}
|
||||
} else skillok = B_TRUE;
|
||||
|
||||
|
||||
// minar only applies if we're asking for armour
|
||||
if (minar && (ocid == OC_ARMOUR)) {
|
||||
flag_t *f;
|
||||
|
@ -4543,15 +4561,28 @@ objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity
|
|||
armourok = B_TRUE;
|
||||
}
|
||||
} else armourok = B_TRUE;
|
||||
|
||||
if (musthaveflag != F_NONE) {
|
||||
if (hasflag(ot->flags, musthaveflag)) {
|
||||
flagok = B_TRUE;
|
||||
}
|
||||
} else flagok = B_TRUE;
|
||||
|
||||
if (skillok && rarityok && armourok) {
|
||||
if (skillok && rarityok && armourok && flagok) {
|
||||
poss[nposs++] = ot;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count <= 0) {
|
||||
free(poss);
|
||||
return NULL;
|
||||
}
|
||||
ot = poss[rnd(0,nposs-1)];
|
||||
free(poss);
|
||||
return ot;
|
||||
|
||||
/*
|
||||
sel = rnd(1,count);
|
||||
n = 0;
|
||||
for (ot = objecttype ; ot ; ot = ot->next) {
|
||||
|
@ -4561,6 +4592,7 @@ objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity
|
|||
int rarityok = B_FALSE;
|
||||
int skillok = B_FALSE;
|
||||
int armourok = B_FALSE;
|
||||
int flagok = B_FALSE;
|
||||
// does rarity match?
|
||||
f = hasflag(ot->flags, F_RARITY);
|
||||
if (f) {
|
||||
|
@ -4588,8 +4620,14 @@ objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity
|
|||
armourok = B_TRUE;
|
||||
}
|
||||
} else armourok = B_TRUE;
|
||||
|
||||
if (musthaveflag != F_NONE) {
|
||||
if (hasflag(ot->flags, musthaveflag)) {
|
||||
flagok = B_TRUE;
|
||||
}
|
||||
} else flagok = B_TRUE;
|
||||
|
||||
if (skillok && rarityok && armourok) {
|
||||
if (skillok && rarityok && armourok && flagok) {
|
||||
n++;
|
||||
if (n == sel) {
|
||||
return ot;
|
||||
|
@ -4600,15 +4638,24 @@ objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity
|
|||
}
|
||||
|
||||
return NULL;
|
||||
*/
|
||||
}
|
||||
|
||||
enum OBTYPE getrandomtrapforob(void) {
|
||||
enum OBTYPE getrandomtrapforob(object_t *o) {
|
||||
objecttype_t *ot;
|
||||
enum OBTYPE poss[MAXCANDIDATES];
|
||||
int nposs = 0;
|
||||
for (ot = objecttype ; ot ;ot = ot->next) {
|
||||
if ((ot->obclass->id == OC_TRAP) && hasflag(ot->flags, F_OBJECTTRAP)) {
|
||||
poss[nposs++] = ot->id;
|
||||
int ok = B_TRUE;
|
||||
if (o && !isdoor(o, NULL)) {
|
||||
if (hasflag(ot->flags, F_DOORTRAPONLY)) {
|
||||
ok = B_FALSE;
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
poss[nposs++] = ot->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
return poss[rnd(0,nposs-1)];
|
||||
|
@ -7374,12 +7421,19 @@ int isimpassableob(object_t *o, lifeform_t *lf, enum LFSIZE forcesize) {
|
|||
blockmax = f->val[1];
|
||||
|
||||
if ((lfsize >= blockmin) && (lfsize <= blockmax)) {
|
||||
return B_TRUE;
|
||||
// exception - if you're flying over it
|
||||
if (getlfheight(lf) >= blockmax) {
|
||||
} else {
|
||||
return B_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lf && (lf->race->raceclass->id == RC_UNDEAD)) {
|
||||
if (hasflagval(o->flags, F_REPELBLESSED, B_CURSED, NA, NA, NULL)) {
|
||||
return B_TRUE;
|
||||
|
||||
if (lf) {
|
||||
if ((lf->race->raceclass->id == RC_UNDEAD)) {
|
||||
if (hasflagval(o->flags, F_REPELBLESSED, B_CURSED, NA, NA, NULL)) {
|
||||
return B_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14747,7 +14801,7 @@ int touch_battle_spoils(object_t *o) {
|
|||
|
||||
// both trapob and oid are passed, because trapob might be NULL if
|
||||
// coming from a door/chest trap.
|
||||
void trapeffects(object_t *trapob, enum OBTYPE oid, cell_t *c) {
|
||||
void trapeffects(object_t *trapob, enum OBTYPE oid, cell_t *c, object_t *trappedob) {
|
||||
lifeform_t *lf = NULL;
|
||||
char lfname[BUFLEN];
|
||||
int avoided = B_FALSE;
|
||||
|
@ -14794,6 +14848,54 @@ void trapeffects(object_t *trapob, enum OBTYPE oid, cell_t *c) {
|
|||
// can't be dodged
|
||||
dospelleffects(NULL, OT_S_GUSTOFWIND, 10, NULL, NULL, c, B_UNCURSED, NULL, B_TRUE, NULL);
|
||||
if (trapob) removeob(trapob, trapob->amt); // trap dies afterwards
|
||||
} else if (oid == OT_TRAPDOORFALL) {
|
||||
if (lf) {
|
||||
if (isplayer(lf)) {
|
||||
msg("The door falls inwards%s", avoided ? " but misses you." : " and lands on top of you!");
|
||||
} else if (cansee(player, lf)) {
|
||||
if (avoided) {
|
||||
msg("A door falls inwards!");
|
||||
} else {
|
||||
msg("A door falls inwards onto %s!",lfname);
|
||||
}
|
||||
}
|
||||
if (!avoided) {
|
||||
losehp(lf, roll("2d4"), DT_CRUSH, NULL, "a falling door trap");
|
||||
}
|
||||
} else {
|
||||
if (haslos(player, c)) {
|
||||
msg("A door falls inwards!");
|
||||
}
|
||||
}
|
||||
if (trappedob) {
|
||||
enum OBTYPE oid = OT_NONE;
|
||||
switch (trappedob->material->id) {
|
||||
case MT_WOOD: oid = OT_WOODPLANK; break;
|
||||
case MT_METAL: oid = OT_METALSHEET ; break;
|
||||
default: break;
|
||||
}
|
||||
if (oid != OT_NONE) {
|
||||
object_t *newob;
|
||||
newob = addobfast(c->obpile, oid);
|
||||
if (newob) {
|
||||
flag_t *f, *f2;
|
||||
// inherit weight
|
||||
newob->weight = trappedob->weight;
|
||||
// inherit hp from original ob
|
||||
f = hasflag(trappedob->flags, F_OBHP);
|
||||
if (f) {
|
||||
f2 = hasflag(newob->flags, F_OBHP);
|
||||
if (f2) {
|
||||
f2->val[0] = f->val[0];
|
||||
f2->val[1] = f->val[1];
|
||||
} else {
|
||||
addflag(newob->flags, F_OBHP, f->val[0], f->val[1], NA, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trapob) removeob(trapob, trapob->amt); // trap dies afterwards
|
||||
} else if (oid == OT_TRAPNEEDLEP) {
|
||||
if (lf) {
|
||||
if (isplayer(lf)) {
|
||||
|
|
|
@ -56,6 +56,7 @@ int doobtraps(object_t *o, lifeform_t *lf);
|
|||
void dumpobrarity(void);
|
||||
void explodeob(object_t *o, flag_t *f, int bigness);
|
||||
void extinguish(object_t *o);
|
||||
object_t *findammoinobpile(object_t *gun, obpile_t *op);
|
||||
material_t *findmaterial(int id);
|
||||
objectclass_t *findoc(int id);
|
||||
object_t *findobbyid(obpile_t *op, long oid);
|
||||
|
@ -103,8 +104,8 @@ object_t *getrandomammo(lifeform_t *lf);
|
|||
objecttype_t *getrandomammofor(object_t *o, int usefirst);
|
||||
brand_t *getrandombrandfor(objecttype_t *ot);
|
||||
int getrandomgrimoirelev(void);
|
||||
objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity, lifeform_t *forlf, int minar);
|
||||
enum OBTYPE getrandomtrapforob(void);
|
||||
objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity, lifeform_t *forlf, int minar, enum FLAG musthaveflag);
|
||||
enum OBTYPE getrandomtrapforob(object_t *o);
|
||||
int getrustdampct(object_t *o);
|
||||
int getfirearmrange(object_t *o);
|
||||
int getfirearmspeed(object_t *o);
|
||||
|
@ -287,7 +288,7 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed,
|
|||
int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, object_t *firearm, int announcethrow, enum OBTYPE fromspell, object_t **newobptr);
|
||||
void timeeffectsob(object_t *o);
|
||||
int touch_battle_spoils(object_t *o);
|
||||
void trapeffects(object_t *trapob, enum OBTYPE oid, cell_t *c);
|
||||
void trapeffects(object_t *trapob, enum OBTYPE oid, cell_t *c, object_t *trappedob);
|
||||
void turnoff(lifeform_t *lf, object_t *o);
|
||||
void turnon(lifeform_t *lf, object_t *o);
|
||||
int uncurseob(object_t *o, int *seen);
|
||||
|
|
8
spell.c
8
spell.c
|
@ -889,9 +889,11 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
|||
}
|
||||
|
||||
if (trapflag->id == F_TRAP) {
|
||||
trapeffects(trapob, trapob->type->id, user->cell);
|
||||
trapeffects(trapob, trapob->type->id, user->cell,
|
||||
(trapflag->id == F_TRAPPED) ? trapob : NULL);
|
||||
} else {
|
||||
trapeffects(NULL, trapflag->val[0], user->cell);
|
||||
trapeffects(NULL, trapflag->val[0], user->cell,
|
||||
(trapflag->id == F_TRAPPED) ? trapob : NULL);
|
||||
}
|
||||
} else {
|
||||
getobname(trapob, buf, 1);
|
||||
|
@ -5248,7 +5250,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
return B_TRUE;
|
||||
}
|
||||
for (i = 0; i < power; i++) {
|
||||
ot = getrandomobofclass(OC_FOOD, NA, NA, NULL, B_FALSE);
|
||||
ot = getrandomobofclass(OC_FOOD, NA, NA, NULL, B_FALSE, F_NONE);
|
||||
o = addobfast(targcell->obpile, ot->id);
|
||||
if (i == 0) {
|
||||
getobname(o, obname, o->amt);
|
||||
|
|
2
text.c
2
text.c
|
@ -1912,6 +1912,8 @@ char *makeplural(char *text) {
|
|||
if (rv) return newtext;
|
||||
newtext = strrep(newtext, "pinch ", "pinches ", &rv);
|
||||
if (rv) return newtext;
|
||||
newtext = strrep(newtext, "plank ", "planks ", &rv);
|
||||
if (rv) return newtext;
|
||||
newtext = strrep(newtext, "pool ", "pools ", &rv);
|
||||
if (rv) return newtext;
|
||||
newtext = strrep(newtext, "potion ", "potions ", &rv);
|
||||
|
|
59
vault.c
59
vault.c
|
@ -786,7 +786,6 @@ vault_t *getvaulttype(map_t *m) {
|
|||
if (hasflag(v->flags, F_NORANDOM)) continue;
|
||||
if (getvaultrarity(v) != rr) continue;
|
||||
|
||||
|
||||
// can this vault go in this map?
|
||||
if (vaultokformap(v, m)) {
|
||||
poss[nposs++] = v;
|
||||
|
@ -814,6 +813,7 @@ int handleline(vault_t *v, char *line) {
|
|||
char *arg[MAXVAULTARGS];
|
||||
int nargs = 0;
|
||||
int i;
|
||||
int hasfire = B_FALSE;
|
||||
|
||||
if (!strlen(line)) return B_FALSE;
|
||||
if (line[0] == '!') return B_FALSE;
|
||||
|
@ -955,11 +955,11 @@ int handleline(vault_t *v, char *line) {
|
|||
dblog("invalid type in legend definition");
|
||||
} else {
|
||||
int error = B_FALSE;
|
||||
if (!vaultthingok(tt, what)) {
|
||||
if (!real_vaultthingok(tt, what, &hasfire)) {
|
||||
dblog("invalid legend definition: '%s'", line);
|
||||
error = B_TRUE;
|
||||
}
|
||||
if ((tt2 != VT_NONE) && !vaultthingok(tt2,what2)) {
|
||||
if ((tt2 != VT_NONE) && !real_vaultthingok(tt2,what2, &hasfire)) {
|
||||
dblog("invalid legend alternative definition: '%s'", line);
|
||||
error = B_TRUE;
|
||||
}
|
||||
|
@ -1026,7 +1026,7 @@ int handleline(vault_t *v, char *line) {
|
|||
pct = 100;
|
||||
}
|
||||
|
||||
if (vaultthingok(vt, thingname)) {
|
||||
if (real_vaultthingok(vt, thingname, &hasfire)) {
|
||||
addflag(v->flags, flagtype, x, y, pct, thingname);
|
||||
ok = B_TRUE;
|
||||
} else {
|
||||
|
@ -1079,7 +1079,7 @@ int handleline(vault_t *v, char *line) {
|
|||
}
|
||||
|
||||
if (nposs) {
|
||||
if (vaultthingok(vt, thingname)) {
|
||||
if (real_vaultthingok(vt, thingname, &hasfire)) {
|
||||
int i;
|
||||
char locbuf[BUFLEN];
|
||||
|
||||
|
@ -1157,8 +1157,7 @@ int handleline(vault_t *v, char *line) {
|
|||
pct = 100;
|
||||
}
|
||||
|
||||
|
||||
if (vaultthingok(thingtype, thingname)) {
|
||||
if (real_vaultthingok(thingtype, thingname, &hasfire)) {
|
||||
snprintf(buf, BUFLEN, "%d,%d,%d,%d,%s",x1,y1,x2,y2,thingname);
|
||||
addflag(v->flags, F_VAULTBOX, thingtype, pct, B_FALSE, buf);
|
||||
ok = B_TRUE;
|
||||
|
@ -1209,7 +1208,7 @@ int handleline(vault_t *v, char *line) {
|
|||
pct = 100;
|
||||
}
|
||||
|
||||
if (vaultthingok(thingtype, thingname)) {
|
||||
if (real_vaultthingok(thingtype, thingname, &hasfire)) {
|
||||
snprintf(buf, BUFLEN, "%d,%d,%d,%d,%s",x1,y1,x2,y2,thingname);
|
||||
addflag(v->flags, F_VAULTBOX, thingtype, pct, B_TRUE, buf);
|
||||
ok = B_TRUE;
|
||||
|
@ -1283,7 +1282,7 @@ int handleline(vault_t *v, char *line) {
|
|||
pct = 100;
|
||||
}
|
||||
|
||||
if (vaultthingok(thingtype, thingname)) {
|
||||
if (real_vaultthingok(thingtype, thingname, &hasfire)) {
|
||||
snprintf(buf, BUFLEN, "%d,%d,%d,%d,%d-%d,%s",x1,y1,x2,y2,countmin,countmax,thingname);
|
||||
addflag(v->flags, F_VAULTSCATTER, thingtype, pct, NA, buf);
|
||||
ok = B_TRUE;
|
||||
|
@ -1531,7 +1530,12 @@ int handleline(vault_t *v, char *line) {
|
|||
free(arg[i]);
|
||||
}
|
||||
|
||||
if (!ok) {
|
||||
if (ok) {
|
||||
// remember if the vault has objects made of fire
|
||||
if (hasfire && !hasflag(v->flags, F_VAULTHASFIRE)) {
|
||||
addflag(v->flags, F_VAULTHASFIRE, B_TRUE, NA, NA, NULL);
|
||||
}
|
||||
} else {
|
||||
dblog("[vault:%s/%s] Invalid line: [%s]",
|
||||
(v->state == VS_NOID) ? "no_id" : v->id,
|
||||
getvstatename(v->state), line);
|
||||
|
@ -1731,11 +1735,18 @@ void rotatecoords(int *x, int *y, vault_t *v, int rotation, int *retoffset) {
|
|||
}
|
||||
|
||||
int vaultthingok(enum VAULTTHING vt, char *what) {
|
||||
return real_vaultthingok(vt, what, NULL);
|
||||
}
|
||||
|
||||
int real_vaultthingok(enum VAULTTHING vt, char *what, int *hasfire) {
|
||||
celltype_t *ct;
|
||||
object_t *o;
|
||||
race_t *r;
|
||||
obpile_t *op;
|
||||
|
||||
// default
|
||||
if (hasfire) *hasfire = B_FALSE;
|
||||
|
||||
switch (vt) {
|
||||
case VT_LF:
|
||||
if (streq(what, "random")) {
|
||||
|
@ -1743,9 +1754,20 @@ int vaultthingok(enum VAULTTHING vt, char *what) {
|
|||
} else {
|
||||
r = findracebyname(what);
|
||||
if (r) {
|
||||
if (r->material->id == MT_FIRE) {
|
||||
*hasfire = B_TRUE;
|
||||
}
|
||||
return B_TRUE;
|
||||
} else {
|
||||
if (parserace(what, NULL, NULL, NULL, NULL)) {
|
||||
enum RACE rid;
|
||||
rid = parserace(what, NULL, NULL, NULL, NULL);
|
||||
if (rid) {
|
||||
if (hasfire) {
|
||||
r = findrace(rid);
|
||||
if (r && (r->material->id == MT_FIRE)) {
|
||||
*hasfire = B_TRUE;
|
||||
}
|
||||
}
|
||||
return B_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -1759,6 +1781,9 @@ int vaultthingok(enum VAULTTHING vt, char *what) {
|
|||
// disable linking of holes
|
||||
o = addobject(op, what, B_TRUE, B_FALSE, OT_NONE);
|
||||
if (o) {
|
||||
if (o->material->id == MT_FIRE) {
|
||||
*hasfire = B_TRUE;
|
||||
}
|
||||
killobpile(op);
|
||||
return B_TRUE;
|
||||
}
|
||||
|
@ -1781,6 +1806,7 @@ int vaultthingok(enum VAULTTHING vt, char *what) {
|
|||
|
||||
int vaultokformap(vault_t *v, map_t *m) {
|
||||
flag_t *f;
|
||||
celltype_t *floortype;
|
||||
// check HABITAT
|
||||
if (hasflag(v->flags, F_VAULTGOESIN)) {
|
||||
int ok = B_FALSE;
|
||||
|
@ -1804,7 +1830,16 @@ int vaultokformap(vault_t *v, map_t *m) {
|
|||
if (f && (getmapdifficulty(m) > f->val[0])) {
|
||||
return B_FALSE;
|
||||
}
|
||||
// dont make bones files while debugging.
|
||||
|
||||
// if the map's floor is flammable don't make vaults which have objects made of fire
|
||||
floortype = findcelltype(getmapempty(m));
|
||||
if (hasflag(floortype->material->flags, F_FLAMMABLE)) {
|
||||
if (hasflag(v->flags, F_VAULTHASFIRE)) {
|
||||
return B_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// dont make bones vaults while debugging.
|
||||
if ((gamemode == GM_GAMESTARTED) && hasjob(player, J_GOD)) {
|
||||
if (hasflagval(v->flags, F_VAULTTAG, NA, NA, NA, "bones")) {
|
||||
return B_FALSE;
|
||||
|
|
1
vault.h
1
vault.h
|
@ -27,4 +27,5 @@ vault_t *loadvault(char *dir, char *filename);
|
|||
void loadvaults(void);
|
||||
void rotatecoords(int *x, int *y, vault_t *v, int rotation, int *retoffset);
|
||||
int vaultthingok(enum VAULTTHING vt, char *what);
|
||||
int real_vaultthingok(enum VAULTTHING vt, char *what, int *hasfire);
|
||||
int vaultokformap(vault_t *v, map_t *m);
|
||||
|
|
Loading…
Reference in New Issue