From 7f33b6351cbb1dcb14856c3a9a8797ce2d2cfc6f Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Mon, 19 Sep 2011 01:47:35 +0000 Subject: [PATCH] - move all definitions into data.c / data.h - [+] monsters should start sprinting if targetlf is sprinting && we can sprint && we aren't sprinting * [+] The kobold throws a potion of sleep at you. A potion of sleep hits you. A potion of sleep shatters! You are showered in glass shards! * [+] in getchoicestr, when there is only one valid choice, show its description below! - [+] in getchoicestr: - [+] remember desc_end_y - [+] if our typed text doesn't match, and desc_end_y is set - [+] blank out those lines - [+] in ], show letters and let you view amrour - [+] Still occasionally have bugs where no up stairs are placed in the first level!!!!! - [+] put in debugging to show if we ever destroy a staircase - [+] test when it happens again..... - [+] for "pentagram pulses black", if you can't see the estination, still say "your xxx flies away" - [+] change listen code: you can only hear one _footstep_ noise per turn, but any number of other things. - [+] instead of jobs replaceing hitdice, make them _modify_ maxhp by a certain %age. ie. f_modmaxhp 80% to get lower. - [+] jobs can no longer have F_HITDICE - [+] instead, they have F_MAXHPMOD - [+] why am i getting wet and drowning while flying?? - [+] show f_canwill SPELLS under abilities, not spells?? - More playable races - [+] need f_playablerace - [+] can pick when you start the game (before you pick job) - [+] human - [+] implement f_jobattrmod - [+] MOST JOBS SHOULD USE F_JOBATTRMOD instead of F_STARTATT. - [+] ALL PLAYABLE RACES must have FULL sets of STARTATT * [+] elf * [+] dwarf - [+] aviad (birdfolk) - [+] can fly - [+] vuln to electric attacks - [+] vuln++ to fire - [+] ---str - [+] cyborg - [+] +str, +int, +dex, +con - [+] ---cha - [+] -wis - [+] vulnerable to lightning, water,cold - [+] cannot use any magic, or med-high chance of spell failure - [+] bleeds oil rather than water - [+] see exact hp damage (f_extrainfo) - [+] tech usage. - [+] remember race in highscores. --- ai.c | 6 + data.c | 8489 ++++++++++++++++++++++++++++++++++++++++++++++ data.h | 9 + data/hiscores.db | Bin 5120 -> 6144 bytes defs.h | 27 +- doc/glyphs.txt | 2 + io.c | 2655 ++++++++------- io.h | 6 +- lf.c | 431 +-- map.c | 19 +- nexus.c | 52 +- objects.c | 188 +- save.c | 5 +- spell.c | 53 +- 14 files changed, 10131 insertions(+), 1811 deletions(-) create mode 100644 data.c create mode 100644 data.h diff --git a/ai.c b/ai.c index 59f2789..098ec79 100644 --- a/ai.c +++ b/ai.c @@ -677,6 +677,12 @@ int aimovetolf(lifeform_t *lf, lifeform_t *target, int wantattack) { if (db) { dblog(".oO { moving towards target. }"); } + + // do we need to sprint got catch up? + if (lfhasflag(target, F_SPRINTING) && !lfhasflag(lf, F_SPRINTING) && cancast(lf, OT_A_SPRINT, NULL)) { + useability(lf, OT_A_SPRINT, NULL,NULL); // doesn't matter if it fails + } + if (!movetowards(lf, target->cell, DT_ORTH, B_FALSE)) { turntoface(lf, target->cell); // success diff --git a/data.c b/data.c new file mode 100644 index 0000000..04a41cf --- /dev/null +++ b/data.c @@ -0,0 +1,8489 @@ +#include +#include +#include +#include "data.h" +#include "defs.h" +#include "flag.h" +#include "lf.h" +#include "nexus.h" +#include "objects.h" +#include "spell.h" + +extern command_t *firstcommand,*lastcommand; +extern map_t *firstmap; +extern race_t *firstrace, *lastrace; +extern raceclass_t *firstraceclass, *lastraceclass; +extern job_t *firstjob, *lastjob; +extern skill_t *firstskill, *lastskill; +extern objecttype_t *objecttype; +extern objectclass_t *objectclass,*lastobjectclass; +extern brand_t *firstbrand,*lastbrand; +extern obmod_t *firstobmod,*lastobmod; +extern material_t *material,*lastmaterial; +extern lifeform_t *player; + +extern hiddennamewithcol_t colour[]; +extern char *bookadjective[]; +extern char *potadjective[]; +extern hiddennamewithcol_t gemtype[]; +extern char *techadjective[]; +extern char *technoun[]; + +extern objecttype_t *lastot; + +command_t *addcommand(enum COMMAND id, char ch, char *desc) { + command_t *a; + + // add to the end of the list + if (firstcommand == NULL) { + firstcommand = malloc(sizeof(command_t)); + a = firstcommand; + a->prev = NULL; + } else { + // go to end of list + a = lastcommand; + a->next = malloc(sizeof(command_t)); + a->next->prev = a; + a = a->next; + } + lastcommand = a; + a->next = NULL; + + // set props + a->id = id; + a->ch = ch; + a->desc = strdup(desc); + + return a; +} + +void initcommands(void) { + // Actions + addcommand(CMD_UP, '<', "Go up stairs."); + addcommand(CMD_DOWN, '>', "Go down stairs, enter a shop/portal."); + addcommand(CMD_REST, '.', "Rest once."); + addcommand(CMD_PICKUP, ',', "Pick up something from the ground."); + addcommand(CMD_CLOSE, 'c', "Close a door."); + addcommand(CMD_COMMS, 'C', "Communicate with an ally."); + //addcommand(CMD_DROP, 'd', "Drop an item."); + addcommand(CMD_DROPMULTI, 'd', "Drop one or more items."); + addcommand(CMD_EAT, 'e', "Eat something."); + addcommand(CMD_EAT, 'E', "Enhance your skills."); + addcommand(CMD_MAGIC, 'm', "Use magic or abilities."); + addcommand(CMD_MEMMAGIC, 'M', "Memorise a magic shortcut"); + addcommand(CMD_OFFER, 'O', "Offer a sacrifice to the gods."); + addcommand(CMD_OPERATE, 'o', "Operate a tool/wand/device."); + addcommand(CMD_PICKLOCK, 'p', "Pick a lock."); + addcommand(CMD_POUR, 'P', "Pour a potion onto something."); + addcommand(CMD_QUAFF, 'q', "Quaff (drink) a potion."); + addcommand(CMD_READ, 'r', "Read a scroll/book."); + addcommand(CMD_RESTFULL, 'R', "Rest until healed, or train your skills."); + addcommand(CMD_THROW, 't', "Throw an object."); + addcommand(CMD_TAKEOFF, 'T', "Take off an item of clothing/jewelery."); + addcommand(CMD_WEILD, 'w', "Weild a weapon."); + addcommand(CMD_WEAR, 'W', "Wear an item of clothing/jewelery."); + // Firearms + addcommand(CMD_FIRE, 'f', "Fire your firearm/bow at your current target."); + addcommand(CMD_FIRENEW, 'F', "Fire your firearm/bow at a new target."); + addcommand(CMD_AIM, 'a', "Aim your current firearm/bow at a new target."); + // Information + addcommand(CMD_HELP, '?', "Display this text."); + addcommand(CMD_INFOPLAYER, '@', "Display player stats."); + addcommand(CMD_INFOARMOUR, ']', "Display player armour."); + addcommand(CMD_FORCEATTACK, 'A', "Force an attack in a given direction."); + addcommand(CMD_LOOKHERE, ':', "Look at current cell."); + addcommand(CMD_LOOKAROUND, '/', "Look at a remote cell."); + addcommand(CMD_INFOKNOWLEDGE, '\\', "Display known items."); + addcommand(CMD_MSGHIST, '|', "Display message history."); + addcommand(CMD_INV, 'i', "Display your inventory."); + // GAME FUNCTIONS + addcommand(CMD_QUIT, 'Q', "Quit the game."); + addcommand(CMD_SAVEQUIT, 'S', "Save and quit the game."); + + sortcommands(); +} + +void initjobs(void) { + int i; + flag_t *f; + // job definitions + + // NOTE: try to always make the job's primary weapon be the first object defined. + // this will make sure that they have the letter 'a'. + addjob(J_GOD, "Diety"); + addflag(lastjob->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_DEX, AT_EXHIGH, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_CON, AT_EXHIGH, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_WIS, AT_EXHIGH, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_CHA, AT_EXHIGH, NA, NULL); + //addflag(lastjob->flags, F_OMNIPOTENT, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_IQ, AT_VHIGH, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_CHA, AT_EXHIGH, NA, NULL); + addflag(lastjob->flags, F_MPDICE, 100, NA, NA, NULL); + //addflag(lastjob->flags, F_MPREGEN, 100, NA, NA, NULL); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "short sword of pyromania"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "hand of god"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 blocks of chocolate"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 vials of ambrosia"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather boots"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather gloves"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "graph paper"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "a digital watch"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 blessed scrolls of create monster"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 blessed potions of experience"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "ring of miracles"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "ring of control"); + addflag(lastjob->flags, F_STARTSKILL, SK_SPELLCASTING, PR_MASTER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_ARCANA, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SS_DEATH, PR_MASTER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SS_TRANSLOCATION, PR_MASTER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SS_DIVINATION, PR_MASTER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SS_MENTAL, PR_MASTER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SS_SUMMONING, PR_MASTER, NA, NULL); + //addflag(lastjob->flags, F_HASPET, NA, NA, NA, "young wolf"); + for (i = 1; i < MAXSKILLS; i++) { + addflag(lastjob->flags, F_CANLEARN, i, NA, NA, NULL); + } + // gods may use all abilities and cast any spell at will + for (i = SS_NONE+1; i < SS_LAST; i++) { + if ((i == SS_ABILITY) || (i == SS_DIVINE)) { + mayusespellschool(lastjob->flags, i, F_CANWILL); + } else { + mayusespellschool(lastjob->flags, i, F_CANCAST); + //mayusespellschool(lastjob->flags, i, F_CANWILL); + } + } + addflag(lastjob->flags, F_NOSCORE, B_TRUE, NA, NA, NULL); + + addjob(J_ADVENTURER, "Adventurer"); + // stat mods + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "2 bananas"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 gold coins"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "3 potions of healing"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_ATHLETICS, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LOCKPICKING, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SPELLCASTING, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_TECHUSAGE, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_HUMANOID, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_UNDEAD, PR_NOVICE, NA, NULL); + // learnable skills + for (i = 1; i < MAXSKILLS; i++) { + addflag(lastjob->flags, F_CANLEARN, i, NA, NA, NULL); + } + // abilities + addflag(lastjob->flags, F_SELECTWEAPON, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_MPDICE, 1, NA, NA, NULL); + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + + addjob(J_ALLOMANCER, "Allomancer"); + // stat mods + addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 2, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "1 gold coins"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "club"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "cloak"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "potion of magic"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_SS_ALLOMANCY, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LOCKPICKING, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_THROWING, PR_NOVICE, NA, NULL); + // learnable skills + addflag(lastjob->flags, F_CANLEARN, SK_BACKSTAB, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SPEECH, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_STEALTH, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CLUBS, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_STAVES, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_UNARMED, NA, NA, NULL); + // abilities + addflag(lastjob->flags, F_MPDICE, 1, 1, NA, NULL); + addflag(lastjob->flags, F_CANCAST, OT_S_ABSORBMETAL, NA, NA, NULL); + addflag(lastjob->flags, F_DETECTMETAL, B_TRUE, NA, NA, NULL); + mayusespellschool(lastjob->flags, SS_ALLOMANCY, F_CANCAST); + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + addjob(J_COMMANDO, "Commando"); + // stat mods + addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_IQ, -4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_CON, 3, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "combat knife"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "revolver"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "helmet"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "flak jacket"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "combat pants"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather boots"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "nightvis goggles"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "1-2 blocks of c4"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "1-3 grenades"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "1-3 flashbangs"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "digital watch"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 bullets"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_ATHLETICS, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_FIRSTAID, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SWIMMING, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_TECHUSAGE, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_HUMANOID, PR_SKILLED, NA, NULL); + // learnable skills + addflag(lastjob->flags, F_CANLEARN, SK_BACKSTAB, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CARTOGRAPHY, PR_EXPERT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_METALWORK, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_STEALTH, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_THROWING, PR_EXPERT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_UNARMED, PR_SKILLED, NA, NULL); + // abilities + addjob(J_DRUID, "Druid"); + // stats + addflag(lastjob->flags, F_MPDICE, 1, 1, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_CHA, 2, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "quarterstaff"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "sickle"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "robe"); + 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_LORE_NATURE, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_STAVES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SPEECH, PR_ADEPT, NA, NULL); + // learnable skills + addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_THROWING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_RANGED, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CLUBS, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, PR_ADEPT, NA, NULL); + // abilities + mayusespellschool(lastjob->flags, SS_NATURE, F_CANCAST); + addflag(lastjob->flags, F_HASPET, NA, NA, NA, "young wolf"); + addflag(lastjob->flags, F_PARTVEGETARIAN, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_LEVSKILL, 5, SK_LORE_NATURE, NA, NULL); + addflag(lastjob->flags, F_LEVSKILL, 10, SK_LORE_NATURE, NA, NULL); + addflag(lastjob->flags, F_LEVSKILL, 15, SK_LORE_NATURE, NA, NULL); + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + + /////////////////////////////////////// + addjob(J_MONK, "Monk"); + // stats + addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 4, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "robe"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "2 loaf of stale bread"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "2 cheese"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "pair of sandals"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_HUMANOID, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_ATHLETICS, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_EVASION, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_STEALTH, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_UNARMED, PR_NOVICE, 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); + // learnable skills + addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_FIRSTAID, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, 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_THROWING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TRAPS, PR_ADEPT, NA, NULL); + // abilities + addflag(lastjob->flags, F_VEGETARIAN, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_CANWILL, OT_A_FEIGNDEATH, NA, NA, NULL); + addflag(lastjob->flags, F_MAXATTACKS, 1, 1, NA, NULL); // this will go up later + // gained abilities + // somewhere: slow falling when next to walls + // somehwere: alertness when sleeping + addflag(lastjob->flags, F_LEVFLAG, 2, F_MPDICE, 1, NULL); + addflag(lastjob->flags, F_LEVSPELL, 2, OT_S_CALMANIMALS, NA, NULL); + // 2: body control - low metabolism + addflag(lastjob->flags, F_LEVSPELL, 3, OT_S_LOWERMETAB, NA, NULL); + // 4: self-healing (mp), immune to haste/slow (innate) + addflag(lastjob->flags, F_LEVFLAG, 4, F_DISEASEIMMUNE, B_TRUE, NULL); + addflag(lastjob->flags, F_LEVABIL, 5, OT_A_HEAVYBLOW, 3, NULL); + // 6: waterawlk via 'body equilibrium' (innate) + addflag(lastjob->flags, F_LEVFLAG, 7, F_TREMORSENSE, 3, NULL); + // 8: molecular manipulation (ie. lower hardness of physical obs by level-7, not lfs) (innate) + addflag(lastjob->flags, F_LEVABIL, 8, OT_A_FLURRY, 3, "pw:1;"); + // 9: resistance to charm, hypnosis, sleep (innate) + addflag(lastjob->flags, F_LEVFLAG, 10, F_DTIMMUNE, DT_POISON, NULL); + addflag(lastjob->flags, F_LEVSPELL, 11, OT_S_PSYARMOUR, NA, NULL); + // 12: quivering palm (v.high mp cost OR once every 200 turns or so) + addflag(lastjob->flags, F_LEVABIL, 13, OT_S_BLINK, 10, "pw:6;"); // l6 = controlled + // 14: speak with plants (mp?innate?) + // 15: mind bar??? what is this + addflag(lastjob->flags, F_LEVABIL, 16, OT_S_IDENTIFY, 100, NULL); + // 17: dimension walk (controlled teleport??) (mp) + // 18: astral projection.. .??useful? + // 19: premonition of death 1-4 turns before + // 20: tower of iron will + // 21: planeshift + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + addjob(J_PLUMBER, "Plumber"); + // stats + addflag(lastjob->flags, F_JOBATTRMOD, A_CHA, -4, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "spanner"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 gold coins"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "overalls"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "cap"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "3-5 mushrooms"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "rubber boots"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_SWIMMING, PR_NOVICE, NA, NULL); + // learnable akills + addflag(lastjob->flags, F_CANLEARN, SK_ATHLETICS, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_METALWORK, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SPELLCASTING, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_FIRE, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_COLD, PR_ADEPT, NA, NULL); + // abilities + addflag(lastjob->flags, F_EVASION, 30, NA, NA, NULL); + addflag(lastjob->flags, F_OBESE, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_CANWILL, OT_A_JUMP, 3, 3, NULL); + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + addjob(J_PRINCE, "Prince"); + // stats + addflag(lastjob->flags, F_JOBATTRMOD, A_CHA, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 2, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "blessed ornamental sword"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "100 gold coins"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "golden crown"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "ornamental dagger"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "velvet robe"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "silk shirt"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "riding trousers"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather boots"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SHIELDS, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SHORTBLADES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LONGBLADES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_HUMANOID, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_NATURE, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SWIMMING, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SPEECH, PR_SKILLED, NA, NULL); + // 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_LISTEN, PR_EXPERT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_METALWORK, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SEWING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LORE_ARCANA, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_POLEARMS, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_PERCEPTION, NA, NA, NULL); + // abilities + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + + addjob(J_PIRATE, "Pirate"); + // stats + addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 3, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_CON, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, -3, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_CHA, -3, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "cutlass"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "silk shirt"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "cloth trousers"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "eyepatch"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "tricorne"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "300-350 gold coins"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "5 potions of rum"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CLIMBING, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LONGBLADES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_UNARMED, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SWIMMING, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_HUMANOID, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_UNDEAD, PR_NOVICE, NA, NULL); + // learnable skills + addflag(lastjob->flags, F_CANLEARN, SK_ATHLETICS, PR_EXPERT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_BACKSTAB, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, PR_EXPERT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LORE_ARCANA, PR_SKILLED, NA, NULL); + 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_THIEVERY, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_THROWING, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_PERCEPTION, NA, NA, NULL); + // abilities + addflag(lastjob->flags, F_STABILITY, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastjob->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastjob->flags, F_EXTRALUCK, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_HASPET, NA, NA, NA, "young hawk"); + addflag(lastjob->flags, F_MAXATTACKS, 2, 2, NA, NULL);// this is so that our hookhand works + addflag(lastjob->flags, F_INJURY, IJ_EYEDESTROYED, NA, NA, NULL); + // also: has a hook instead of fists. + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + + addjob(J_ROGUE, "Rogue"); + // stats + addflag(lastjob->flags, F_JOBATTRMOD, A_STR, -3, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_CON, -2, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "dagger"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "50-100 gold coins"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "5 lockpicks"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_ATHLETICS, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CLIMBING, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_STEALTH, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LISTEN, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_BACKSTAB, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LOCKPICKING, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SHORTBLADES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_THIEVERY, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_HUMANOID, PR_BEGINNER, NA, NULL); + // learnable skills + addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SPEECH, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, PR_SKILLED, NA, NULL); // + addflag(lastjob->flags, F_CANLEARN, SK_STAVES, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_UNARMED, PR_EXPERT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_THROWING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TWOWEAPON, PR_EXPERT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SPELLCASTING, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_DIVINATION, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_GRAVITY, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_MODIFICATION, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_MENTAL, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_TRANSLOCATION, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LORE_ARCANA, PR_ADEPT, NA, NULL); + // abilities + addflag(lastjob->flags, F_MPDICE, 1, NA, NA, NULL); + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + addjob(J_WARRIOR, "Warrior"); + // stats + addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_IQ, -3, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_CON, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_CHA, -3, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, -4, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "helmet"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "suit of ring mail"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "pair of gauntlets"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "pair of metal boots"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "buckler"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10-20 gold coins"); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_AXES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CLUBS, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SHORTBLADES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LONGBLADES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_ATHLETICS, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_ARMOUR, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SHIELDS, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_HUMANOID, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_NATURE, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SEWING, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_METALWORK, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + // learnable skills + addflag(lastjob->flags, F_CANLEARN, SK_CARTOGRAPHY, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CLIMBING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_AXES, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CLUBS, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LONGBLADES, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_POLEARMS, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_STAVES, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_UNARMED, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_THROWING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TWOWEAPON, NA, NA, NULL); + // abilities + addflag(lastjob->flags, F_MAXHPMOD, 120, NA, NA, NULL); + addflag(lastjob->flags, F_SELECTWEAPON, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_LEVABIL, 3, OT_A_HEAVYBLOW, 3, NULL); + addflag(lastjob->flags, F_LEVABIL, 4, OT_A_WARCRY, 4, NULL); + addflag(lastjob->flags, F_LEVABIL, 5, OT_A_CHARGE, 5, NULL); + addflag(lastjob->flags, F_LEVABIL, 6, OT_A_RAGE, 50, NULL); + addflag(lastjob->flags, F_LEVABIL, 10, OT_A_HURRICANESTRIKE, 5, NULL); + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + + addjob(J_WIZARD, "Wizard"); + // stats + addflag(lastjob->flags, F_JOBATTRMOD, A_STR, -4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_IQ, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_CON, -3, NA, NULL); + // initial objects + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "knife"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "robe"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "2 potions of magic"); + // monster wizards sometimes start with a random book + f = addflag(lastjob->flags, F_STARTOBCLASS, 100, OC_BOOK, NA, NULL); addcondition(f, FC_IFMONSTER, 50); + // initial skills + addflag(lastjob->flags, F_STARTSKILL, SK_CARTOGRAPHY, PR_ADEPT, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_ARCANA, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_UNDEAD, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_LORE_DEMONS, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SPELLCASTING, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_CHANNELING, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_STAVES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SS_WILD, PR_NOVICE, NA, NULL); + // learnable skills + addflag(lastjob->flags, F_CANLEARN, SK_LISTEN, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SEWING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SPEECH, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_AIR, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_DEATH, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_DIVINATION, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_FIRE, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_COLD, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_GRAVITY, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_MODIFICATION, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_SUMMONING, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LORE_DEMONS, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_LORE_UNDEAD, NA, NA, NULL); + // abilities + addflag(lastjob->flags, F_MAXHPMOD, 50, NA, NA, NULL); // low hp + addflag(lastjob->flags, F_MPDICE, 1, 1, NA, NULL); + addflag(lastjob->flags, F_RESTHEALTIME, 6, NA, NA, NULL); // wizard heals slowly, but regenerates mp + addflag(lastjob->flags, F_LEVFLAG, 3, F_DETECTMAGIC, B_TRUE, NULL); + addflag(lastjob->flags, F_LEVFLAG, 7, F_DETECTAURAS, B_TRUE, NULL); + addflag(lastjob->flags, F_LEVFLAG, 10, F_CONTROL, B_TRUE, NULL); + addflag(lastjob->flags, F_LEVSPELLSCHOOL, 101, SS_NONE, B_TRUE, NULL); // new spell every 1 level + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); + // monster job flags + f = addflag(lastjob->flags, F_CANCAST, OT_S_FIREDART, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 50); + f = addflag(lastjob->flags, F_CANCAST, OT_S_COLDRAY, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 50); + f = addflag(lastjob->flags, F_CANCAST, OT_S_HEALINGMIN, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 33); + f = addflag(lastjob->flags, F_CANCAST, OT_S_BLINK, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 33); + f = addflag(lastjob->flags, F_CANCAST, OT_S_TELEKINESIS, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 33); + f = addflag(lastjob->flags, F_CANCAST, OT_S_HASTE, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 20); + f = addflag(lastjob->flags, F_CANCAST, OT_S_HEALING, NA, NA, NULL); addcondition(f, FC_IFMONSTER, 20); + + // non-player jobs + addjob(J_SHOPKEEPER, "Shopkeeper"); + addflag(lastjob->flags, F_NOPLAYER, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "100-1000 gold coins"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "shotgun"); + addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "5-10 bullets"); + addflag(lastjob->flags, F_WANTS, OT_GOLD, NA, NA, NULL); +} + +void initobjects(void) { + //int ch; + int i,n; + + // generate hidden name text + for (n = 0; strlen(colour[n].name); n++) { + char buf[BUFLEN]; + // add it without an adjective + snprintf(buf, BUFLEN, "%s book", colour[n].name); + addhiddenname(OC_BOOK, buf); + // add it with all known adjectives + for (i = 0; strlen(bookadjective[i]) ; i++) { + snprintf(buf, BUFLEN, "%s %s book",bookadjective[i], colour[n].name); + addhiddenname(OC_BOOK, buf); + } + } + + addhiddenname(OC_SCROLL, "scroll titled ABRA CA DABRA"); + addhiddenname(OC_SCROLL, "scroll titled BARBAR"); + addhiddenname(OC_SCROLL, "scroll titled CRATOL JEM"); + addhiddenname(OC_SCROLL, "scroll titled DELENTH YIN"); + addhiddenname(OC_SCROLL, "scroll titled ETEE NOM"); + addhiddenname(OC_SCROLL, "scroll titled FIE JOOHM"); + addhiddenname(OC_SCROLL, "scroll titled GREE VII"); + addhiddenname(OC_SCROLL, "scroll titled HERE HERE"); + addhiddenname(OC_SCROLL, "scroll titled HTEB IH"); + addhiddenname(OC_SCROLL, "scroll titled HOCUS POCUS"); + addhiddenname(OC_SCROLL, "scroll titled ILU-MA ZEE"); + addhiddenname(OC_SCROLL, "scroll titled JUNIPO CHECK"); + addhiddenname(OC_SCROLL, "scroll titled KARELS"); + addhiddenname(OC_SCROLL, "scroll titled LUMLEE GWON"); + addhiddenname(OC_SCROLL, "scroll titled MARIGON"); + addhiddenname(OC_SCROLL, "scroll titled MAXIMOR BLATHUS"); + addhiddenname(OC_SCROLL, "scroll titled NORTH"); + addhiddenname(OC_SCROLL, "scroll titled ORI GREEBLE"); + addhiddenname(OC_SCROLL, "scroll titled POCUS HOCUS"); + addhiddenname(OC_SCROLL, "scroll titled QUANDRILAR"); + addhiddenname(OC_SCROLL, "scroll titled REZZ KINETO"); + addhiddenname(OC_SCROLL, "scroll titled SHAZZARIO"); + addhiddenname(OC_SCROLL, "scroll titled THERIUM LARGOS"); + addhiddenname(OC_SCROLL, "scroll titled TAKA TAKA TAKA"); + addhiddenname(OC_SCROLL, "scroll titled UNDWEL"); + addhiddenname(OC_SCROLL, "scroll titled VOLTR YI MEN"); + addhiddenname(OC_SCROLL, "scroll titled WII"); + addhiddenname(OC_SCROLL, "scroll titled XAND"); + addhiddenname(OC_SCROLL, "scroll titled YES"); + addhiddenname(OC_SCROLL, "scroll titled ZAREL NOR"); + + for (n = 0; strlen(colour[n].name); n++) { + char buf[BUFLEN]; + // add it without an adjective + snprintf(buf, BUFLEN, "%s potion", colour[n].name); + addhiddenname(OC_POTION, buf); + // add it with all known adjectives + for (i = 0; strlen(potadjective[i]) ; i++) { + snprintf(buf, BUFLEN, "%s %s potion",potadjective[i], colour[n].name); + addhiddenname(OC_POTION, buf); + } + } + + for (n = 0; strlen(gemtype[n].name); n++) { + char buf[BUFLEN]; + // add it without an adjective + snprintf(buf, BUFLEN, "%s wand", gemtype[n].name); + addhiddenname(OC_WAND, buf); + } + + for (n = 0; strlen(gemtype[n].name); n++) { + char buf[BUFLEN]; + // add it without an adjective + snprintf(buf, BUFLEN, "%s ring", gemtype[n].name); + addhiddenname(OC_RING, buf); + } + + for (n = 0; strlen(technoun[n]); n++) { + // add it without an adjective + addhiddenname(OC_TECH, technoun[n]); + // add it with all known adjectives + for (i = 0; strlen(techadjective[i]) ; i++) { + char buf[BUFLEN]; + snprintf(buf, BUFLEN, "%s %s",techadjective[i], technoun[n]); + addhiddenname(OC_TECH, buf); + } + } + + shufflehiddennames(); + + + // object modifiers - flags can be either known or not, depending on if it's obvious + addobmod(OM_BLOODSTAINED,"bloodstained"); + addflag_real(lastobmod->flags, F_SCARY, 2, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_FLAMING,"flaming"); + addflag_real(lastobmod->flags, F_ONFIRE, B_TRUE, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_FROZEN,"frozen"); + addflag_real(lastobmod->flags, F_FROZEN, B_TRUE, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_HEADLESS,"headless"); + addflag_real(lastobmod->flags, F_HEADLESS, B_TRUE, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_MASTERWORK,"masterwork"); + addflag_real(lastobmod->flags, F_MASTERWORK, B_TRUE, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_SHODDY,"shoddy"); + addflag_real(lastobmod->flags, F_SHODDY, B_TRUE, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_POISONED,"poisoned"); + addflag_real(lastobmod->flags, F_HITCONFER, F_POISONED, SC_POISON, 25, "15-30", PERMENANT, B_KNOWN, -1); + addflag_real(lastobmod->flags, F_HITCONFERVALS, P_VENOM, 1, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_WET1,"damp"); + addflag_real(lastobmod->flags, F_WET, W_DAMP, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_WET2,"wet"); + addflag_real(lastobmod->flags, F_WET, W_WET, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_WET3,"soaked"); + addflag_real(lastobmod->flags, F_WET, W_SOAKED, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_RUSTY1,"rusty"); + addflag_real(lastobmod->flags, F_RUSTED, R_RUSTY, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_RUSTY2,"very rusty"); + addflag_real(lastobmod->flags, F_RUSTED, R_VRUSTY, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + addobmod(OM_RUSTY3,"thoroughly rusty"); + addflag_real(lastobmod->flags, F_RUSTED, R_TRUSTY, NA, NA, NULL, PERMENANT, B_KNOWN, -1); + + // brands modifiers - flags should be UNKNOWN! + // also don't double up with names of scrolls etc. + // ie. spellbook of flight, boots of flight. + + // weapons + addbrand(BR_BALANCE, "of balance", BP_WEAPON); + addflag_real(lastbrand->flags, F_BALANCE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_PYROMANIA, "of pyromania", BP_WEAPON); + addflag_real(lastbrand->flags, F_FLAMESTRIKE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_REVENGE, "of revenge", BP_WEAPON); + addflag_real(lastbrand->flags, F_REVENGE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SHARPNESS, "of sharpness", BP_WEAPON); + addflag_real(lastbrand->flags, F_ARMOURPIERCE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_IMPACT, "of impact", BP_WEAPON); // TODO: make thisonly go ont obashing weapons + addflag_real(lastbrand->flags, F_HEAVYBLOW, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + + // feet + addbrand(BR_LEVITATION, "of hovering", BP_FEET); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_LEVITATING, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_FEATHERFALL, "of featherfall", BP_FEET); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_DTIMMUNE, DT_FALL, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SWIFTNESS, "of swiftness", BP_FEET); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_FASTMOVE, 5, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SLOTH, "of sloth", BP_FEET); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_SLOWMOVE, 5, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_STEALTH, "of stealth", BP_FEET); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_SILENTMOVE, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); + + // hands + addbrand(BR_POWER, "of power", BP_HANDS); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_STR, 3, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_WEAKNESS, "of feebleness", BP_HANDS); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_STR, -3, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_NIMBLENESS, "of nimbleness", BP_HANDS); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_DEX, 3, NULL, PERMENANT, B_UNKNOWN, -1); + + // head + addbrand(BR_THINKING, "of thinking", BP_HEAD); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_IQ, 3, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_KNOWLEDGE, "of knowledge", BP_HEAD); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_DETECTAURAS, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_DETECTMAGIC, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_TELEPATHY, "of telepathy", BP_HEAD); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_DETECTLIFE, 5, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_TELEKINESIS, "of the poltergeist", BP_HEAD); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_CANWILL, OT_S_TELEKINESIS, NA, NULL, PERMENANT, B_UNKNOWN, -1); + + // waist + addbrand(BR_GIANTSTRENGTH, "of giant strength", BP_WAIST); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRSET, A_STR, 18, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_FEEBLENESS, "of feebleness", BP_WAIST); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRSET, A_STR, 3, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_FLIGHT, "of the eagle", BP_WAIST); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_FLYING, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SPEED, "of swiftness", BP_WAIST); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_FASTACT, 5, NA, NULL, PERMENANT, B_UNKNOWN, -1); + + // shoulders + addbrand(BR_CONCEALMENT, "of concealment", BP_SHOULDERS); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_INVISIBLE, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_ANTIMAG, "of antimagic", BP_SHOULDERS); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_RESISTMAG, 10, NA, NULL, PERMENANT, B_UNKNOWN, -1); + addbrand(BR_SHADOWS, "of shadows", BP_SHOULDERS); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_CANWILL, OT_A_DARKWALK, NA, NULL, PERMENANT, B_UNKNOWN, -1); + + // body + addbrand(BR_HEALTH, "of health", BP_BODY); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_CON, 3, NULL, PERMENANT, B_UNKNOWN, -1); + + // materials + addmaterial(MT_NOTHING, "nothing", 0); + addmaterial(MT_MAGIC, "magical energy", 0); + addmaterial(MT_FIRE, "fire", 0); + addmaterial(MT_GAS, "gas", 0.5); + addmaterial(MT_WIRE, "wire", 1); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_BASH, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_COLD, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_PROJECTILE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_HOLY, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_WATER, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_MELT, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_ELECTRIC, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_DECAY, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_POISONGAS, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_UNARMED, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_LIGHT, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_NECROTIC, NA, NA, NULL); + addmaterial(MT_PLANT, "plant matter", 1); + addflag(lastmaterial->flags, F_FLAMMABLE, PERMENANT, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTVULN, DT_ACID, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_WATER, NA, NA, NULL); + addmaterial(MT_PAPER, "paper", 1); + addflag(lastmaterial->flags, F_MATCONVERT, MT_WATER, NA, NA, "lump of soggy paper"); + addflag(lastmaterial->flags, F_MATCONVERTTEXT, MT_WATER, NA, NA, "goes soggy"); + addflag(lastmaterial->flags, F_MATCONVERTTEXTPL, MT_WATER, NA, NA, "go soggy"); + addflag(lastmaterial->flags, F_FLAMMABLE, PERMENANT, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addmaterial(MT_SILK, "silk", 1); + addflag(lastmaterial->flags, F_FLAMMABLE, 6, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); // doesn't catch on fire, but IS vulnerable to it + addflag(lastmaterial->flags, F_DTVULN, DT_ACID, NA, NA, NULL); + addmaterial(MT_FLESH, "flesh", 2); + addflag(lastmaterial->flags, F_FLAMMABLE, 3, NA, NA, NULL); + addmaterial(MT_WETPAPER, "wet paper", 3); + addmaterial(MT_CLOTH, "cloth", 3); + addflag(lastmaterial->flags, F_FLAMMABLE, 3, NA, NA, NULL); + addflag(lastmaterial->flags, F_CANGETWET, B_TRUE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_BASH, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); // doesn't catch on fire, but IS vulnerable to it + addmaterial(MT_FOOD, "food", 3); + addmaterial(MT_PLASTIC, "plastic", 3); + addflag(lastmaterial->flags, F_HARDNESS, 2, NA, NA, NULL); + addmaterial(MT_WAX, "wax", 3); + addflag(lastmaterial->flags, F_MATCONVERT, MT_FIRE, NA, NA, "lump of melted wax"); + addflag(lastmaterial->flags, F_MATCONVERTTEXT, MT_FIRE, NA, NA, "melts"); + addflag(lastmaterial->flags, F_MATCONVERTTEXTPL, MT_FIRE, NA, NA, "melt"); + addmaterial(MT_RUBBER, "rubber", 4); + addmaterial(MT_LEATHER, "leather", 4); + addflag(lastmaterial->flags, F_CANGETWET, B_TRUE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_BASH, NA, NA, NULL); + addmaterial(MT_BONE, "bone", 5); + addflag(lastmaterial->flags, F_HARDNESS, 3, NA, NA, NULL); + addmaterial(MT_OIL, "oil", 5); + addmaterial(MT_ICE, "ice",6); + addflag(lastmaterial->flags, F_HARDNESS, 3, NA, NA, NULL); + addmaterial(MT_WOOD, "wood", 6); + addflag(lastmaterial->flags, F_HARDNESS, 3, NA, NA, NULL); + addflag(lastmaterial->flags, F_FLAMMABLE, 5, NA, NA, NULL); + addflag(lastmaterial->flags, F_CANGETWET, B_TRUE, NA, NA, NULL); + addmaterial(MT_ACID, "acid", 7); + addmaterial(MT_WATER, "water", 7); + addmaterial(MT_BLOOD, "blood", 7); + addmaterial(MT_SLIME, "slime", 9); + addmaterial(MT_STONE, "stone", 10); + addflag(lastmaterial->flags, F_HARDNESS, 4, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_PIERCE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_BITE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_SLASH, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTRESIST, DT_CHOP, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTRESIST, DT_PROJECTILE, NA, NA, NULL); + addmaterial(MT_SILVER, "silver", 11); + addflag(lastmaterial->flags, F_HARDNESS, 2, NA, NA, NULL); + addmaterial(MT_METAL, "metal", 13); + addflag(lastmaterial->flags, F_HARDNESS, 5, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTRESIST, DT_BITE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTRESIST, DT_PIERCE, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTRESIST, DT_SLASH, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTRESIST, DT_PROJECTILE, NA, NA, NULL); + addmaterial(MT_GLASS, "glass", 13); + addflag(lastmaterial->flags, F_HARDNESS, 2, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTVULN, DT_BASH, NA, NA, NULL); + addflag(lastmaterial->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addmaterial(MT_GOLD, "gold", 16); + addflag(lastmaterial->flags, F_HARDNESS, 3, NA, NA, NULL); + + // object classes + addoc(OC_DFEATURE, "Dungeon Features", "Doors, etc.", '\\', C_GREY); + addoc(OC_FURNITURE, "Furniture", "Various kinds of mundane (or not so mundane) furnishings.", '\\', C_BROWN); + addocnoun(lastobjectclass, "furniture"); + addoc(OC_TERRAIN, "Terrain", "Water, etc.", '\\', C_GREY); + addoc(OC_TRAP, "Trap", "Fiendish traps.", '^', C_GREY); + addocnoun(lastobjectclass, "trap"); + addoc(OC_MONEY, "Money", "The standard currency of Nexus.", '$', C_GREY); + addoc(OC_SCROLL, "Scrolls", "An arcane roll of parchment, inscribed with many magical glyphs.", '?', C_GREY); + addocnoun(lastobjectclass, "scroll"); + addflag(lastobjectclass->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + //addflag(lastobjectclass->flags, F_DTCONVERT, DT_WATER, NA, NA, "lump of soggy paper"); + //addflag(lastobjectclass->flags, F_MATCONVERT, MT_WATER, NA, NA, "lump of soggy paper"); + //addflag(lastobjectclass->flags, F_MATCONVERTTEXT, MT_WATER, NA, NA, "goes 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); + addocnoun(lastobjectclass, "wand"); + addflag(lastobjectclass->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_OPERWITHOUTID, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_OPERUSECHARGE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_RNDCHARGES, 1, 8, NA, NULL); + + addoc(OC_POTION, "Potions", "A strange concoction contained within a small flask.", '!', C_GREY); + addocnoun(lastobjectclass, "potion"); + addflag(lastobjectclass->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_POURABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); + addoc(OC_RING, "Rings", "A circular band, worn on the finger.", '=', C_GREY); + addocnoun(lastobjectclass, "ring"); + addflag(lastobjectclass->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_GOESON, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastobjectclass->flags, F_GOESON, BP_LEFTFINGER, NA, NA, NULL); + addoc(OC_WEAPON, "Weapons", "An instrument used for the purpose of causing harm or death.", ')', C_GREY); + addocnoun(lastobjectclass, "weapon"); + 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); + addflag(lastobjectclass->flags, F_CANHAVEOBMOD, OM_SHODDY, 34, NA, NULL); + addoc(OC_ARMOUR, "Armour/Clothing", "Protective gear.", '[', C_GREY); + addocnoun(lastobjectclass, "armour"); + addocnoun(lastobjectclass, "clothing"); + addocnoun(lastobjectclass, "clothes"); + 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); + addflag(lastobjectclass->flags, F_CANHAVEOBMOD, OM_SHODDY, 34, NA, NULL); + addflag(lastobjectclass->flags, F_CANHAVEOBMOD, OM_BLOODSTAINED, 17, NA, NULL); + addoc(OC_MISSILE, "Missiles/Ammunition", "An instrument used for the purpose of causing harm or death.", ';', C_GREY); + addocnoun(lastobjectclass, "missile"); + addocnoun(lastobjectclass, "ammo"); + addocnoun(lastobjectclass, "ammunition"); + addflag(lastobjectclass->flags, F_ENCHANTABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addoc(OC_FLORA, "Plants", "Some kind of plant/foliage.", ',', C_GREEN); + addocnoun(lastobjectclass, "plant"); + addoc(OC_ROCK, "Rocks/Gems", "Boring (or not so boring) rocks or plants.", '*', C_GREY); + addoc(OC_FOOD, "Food", "Yum!", '%', C_GREY); + addocnoun(lastobjectclass, "food"); + addflag(lastobjectclass->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_SMELLY, B_TRUE, NA, NA, NULL); + addoc(OC_GODSTONE, "Godstones", "Ancient artifacts, created by the elder gods.", '*', C_BOLDMAGENTA); + addflag(lastobjectclass->flags, F_UNIQUE, NA, NA, NA, NULL); + addflag(lastobjectclass->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pulsating purple stone"); + addflag(lastobjectclass->flags, F_UNIQUE, NA, NA, NA, NULL); + addflag(lastobjectclass->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + + addoc(OC_CORPSE, "Corpses", "Dead flesh which was once living.", '%', C_GREY); + addflag(lastobjectclass->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_OBHP, 50, 50, NA, NULL); + addflag(lastobjectclass->flags, F_OBHPDRAIN, 1, DT_DECAY, NA, NULL); // ie. corpses last for 50 turns + addoc(OC_TECH, "Technology", "A strange piece of futuristic technology.", '[', C_GREY); + addocnoun(lastobjectclass, "technology"); + addocnoun(lastobjectclass, "tech"); + addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addoc(OC_TOOLS, "Tools", "Useful items, from the common to the obscure.", ']', C_GREY); + addocnoun(lastobjectclass, "tool"); + addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addoc(OC_MISC, "Miscellaneous", "This could be anything.", '\\', C_GREY); + addoc(OC_EFFECT, "Environmental Effects", "Smoke, fire, etc.", '}', C_GREY); + addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addoc(OC_BOOK, "Books", "Spellbooks, tomes or manuals.", '+', C_GREY); + addocnoun(lastobjectclass, "spellbook"); + addocnoun(lastobjectclass, "book"); + addocnoun(lastobjectclass, "tome"); + addflag(lastobjectclass->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addoc(OC_SPELL, "Spells", "A magical spell", '&', C_GREY); // this is a "virtual" object class + addoc(OC_ABILITY, "Abilities", "A special ability", '&', C_GREY); // this is a "virtual" object class + + + // object types + + // dungeon features + addot(OT_DOORWOOD, "wooden door", "A sturdy wooden door.", MT_WOOD, 150, OC_DFEATURE, SZ_LARGE); + // GLYPH here is a special case in getglyph + addflag(lastot->flags, F_DOOR, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LOCKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANBETRAPPED, 5, 10, 60, NULL); + 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); + + addot(OT_DOORIRON, "iron door", "A strong iron door.", MT_METAL, 300, OC_DFEATURE, SZ_LARGE); + // GLYPH here is a special case in getglyph + addflag(lastot->flags, F_DOOR, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LOCKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANBETRAPPED, 10, 10, 60, NULL); + addflag(lastot->flags, F_OBHP, 60, 60, NA, NULL); + addflag(lastot->flags, F_DTIMMUNE, DT_PIERCE, NA, NA, NULL); + addflag(lastot->flags, F_DTIMMUNE, DT_SLASH, NA, NA, NULL); + addflag(lastot->flags, F_DTRESIST, DT_CHOP, NA, NA, NULL); + + + addot(OT_FOUNTAIN, "fountain", "A running fountain of some kind of liquid.", MT_WATER, 20, OC_MISC, SZ_MEDIUM); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_BLUE, NA, NA, "_"); + addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, RR_UNCOMMON, 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_DTCONVERT, DT_COLD, NA, NA, "sheet of ice"); + addflag(lastot->flags, F_DTCREATEOB, DT_FIRE, 0, DT_COMPASS, "cloud of steam"); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, B_DONTKILL, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_WATER, NA, NA, NULL); + + // blocks movement, but you can see and fire through them. + addot(OT_GATEIRON, "iron gate", "A gate comprised of a series of vertical iron bars, raised slightly above the floor.", MT_METAL, 500, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "+"); + addflag(lastot->flags, F_DOOR, SZ_MEDIUM, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_IMPASSABLE, SZ_MEDIUM, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_LOCKABLE, 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_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 120, 120, NA, NULL); + addflag(lastot->flags, F_DTIMMUNE, DT_PIERCE, NA, NA, NULL); + addflag(lastot->flags, F_DTIMMUNE, DT_SLASH, NA, NA, NULL); + addflag(lastot->flags, F_DTRESIST, DT_CHOP, NA, NA, NULL); + addot(OT_GATEWOOD, "wooden gate", "A gate comprised of a series of wooden slats.", MT_WOOD, 200, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "+"); + addflag(lastot->flags, F_DOOR, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_LOCKABLE, 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_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); + + addot(OT_FENCEWOOD, "wooden fence", "A tell fence created from a series of upright logs of wood.", MT_WOOD, 200, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LOCKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); + + addot(OT_BOULDER, "boulder", "A massive stone boulder.", MT_STONE, 80, OC_ROCK, SZ_HUGE); + addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, ""); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "'"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); + addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); +// addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "50-100 stones"); + + + addot(OT_ICICLE, "huge icicle", "A massive ice stalacmite.", MT_ICE, 200, OC_ROCK, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_CYAN, NA, NA, "'"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL); + + addot(OT_STATUE, "statue", "A stone statue of a monster.", MT_STONE, 80, OC_ROCK, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, ""); + addflag(lastot->flags, F_RARITY, H_VILLAGE, 80, NA, ""); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "'"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); // will be overridden + addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "20-50 stones"); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "a statue"); + + addot(OT_HOLEINGROUND, "hole in the ground", "A gaping hole in the ground.", MT_NOTHING, 0, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_GLYPH, C_BLUE, NA, NA, "^"); + addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, NULL); + addflag(lastot->flags, F_PIT, D_DOWN, NA, NA, NULL); + addflag(lastot->flags, F_OPPOSITESTAIRS, OT_HOLEINROOF, 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); + + addot(OT_HOLEINROOF, "hole in the roof", "A gaping hole in the roof.", MT_NOTHING, 0, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_BLUE, NA, NA, "<"); + addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, NULL); + addflag(lastot->flags, F_PIT, D_UP, NA, NA, NULL); + addflag(lastot->flags, F_OPPOSITESTAIRS, OT_HOLEINGROUND, 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); + + 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, NA, ">"); + addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, NULL); + addflag(lastot->flags, F_OPPOSITESTAIRS, OT_STAIRSUP, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + + addot(OT_STAIRSUP, "staircase going up", "A stone staircase climbing upwards.", MT_STONE, 3000, OC_DFEATURE, SZ_HUGE); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "<"); + addflag(lastot->flags, F_CLIMBABLE, D_UP, NA, NA, NULL); + addflag(lastot->flags, F_OPPOSITESTAIRS, OT_STAIRSDOWN, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + + addot(OT_VENDINGMACHINE, "vending machine", "A gold-operated vending machine.", MT_METAL, 500, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, ""); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "_"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + // 10 random objects + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, RANDOM, NA, NULL); + + addot(OT_HOLYCIRCLE, "holy circle", "A consecrated area imbued with holy power.", MT_NOTHING, 0, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_RARITY, H_ALL, 80, NA, ""); + addflag(lastot->flags, F_GLYPH, C_CYAN, NA, NA, "_"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_REPELBLESSED, B_CURSED, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_PENTAGRAM, "pentagram", "A area imbued with evil.", MT_NOTHING, 0, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_RARITY, H_ALL, 80, NA, ""); + addflag(lastot->flags, F_GLYPH, C_RED, NA, NA, "_"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_REPELBLESSED, B_BLESSED, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + + addot(OT_PORTAL, "magic portal", "A magical portal to a different place...", MT_MAGIC, 0, OC_DFEATURE, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_BOLDGREEN, NA, NA, "^"); + addflag(lastot->flags, F_CLIMBABLE, D_IN, 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_NOFEEL, B_TRUE, NA, NA, NULL); + + // terrain + addot(OT_WATERDEEP, "water", "Deep water.", MT_WATER, 300, OC_TERRAIN, SZ_HUGE); + addflag(lastot->flags, F_NO_A, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_BOLDBLUE, NA, NA, "{"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTCONVERT, DT_COLD, NA, NA, "sheet of ice"); + addflag(lastot->flags, F_DTCREATEOB, DT_FIRE, 1, DT_COMPASS, "cloud of steam"); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, B_DONTKILL, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_WATER, NA, NA, NULL); + addflag(lastot->flags, F_DEEPWATER, DP_MAX, NA, NA, NULL); + addflag(lastot->flags, F_ONEPERCELL, B_TRUE, NA, NA, NULL); + + // traps - cell only + addot(OT_TRAPARROW, "arrow trap", "A pressure plate which causes arrows to shoot at you.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 25, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 76, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPARROWP, "poison arrow trap", "A pressure plate which causes poisoned arrows to shoot at you.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 25, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 69, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPPIT, "pit trap", "A pressure plate which causes the floor to drop away.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 20, B_TRUE, 22, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPROCK, "falling rock trap", "A pressure plate which causes heavy rocks to drop from the ceiling.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 20, B_TRUE, 22, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 25, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPSUMMON, "summoning trap", "A magical trap which causes a monster to appear.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 30, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPTRIP, "tripwire", "A thin wire at ankle height.", MT_WIRE, 0.1, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 10, B_FALSE, 20, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 25, NA, NA, NULL); + addflag(lastot->flags, F_ATTACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL); + + + // 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, NULL); + addflag(lastot->flags, F_TRAP, 23, B_TRUE, 25, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addot(OT_TRAPWIND, "wind trap", "A magical trap which assails the target with a blast of air.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TRAP, 20, B_TRUE, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_MAGENTA, NA, NA, "^"); + 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 trap which sounds a loud siren.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 18, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPEBLAST, "energy blast trap", "A magical trap which blasts its victim with energy.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 30, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_MAGENTA, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPFIRE, "fire trap", "A trap which fires a pillar of flame.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 30, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 59, NA, NULL); + addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPGAS, "gas trap", "A trap which releases poisonous gas.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 27, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 69, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPMINE, "landmine trap", "A buried, pressure-sensitive explosive device.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); + addflag(lastot->flags, F_TRAP, 30, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 20, NA, NULL); + addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_TRAPTELEPORT, "teleportation trap", "A magical dispersal field.", MT_NOTHING, 0, OC_TRAP, SZ_LARGE); + addflag(lastot->flags, F_TRAP, NA, B_TRUE, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_MAGENTA, NA, NA, "^"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_SECRET, 30, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); + + + // money etc + addot(OT_GOLD, "gold coin", "Sparkling nuggets of gold, the standard currency of Nexus.", MT_GOLD, 0.01, OC_MONEY, SZ_MINI); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 100, NA, ""); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some gold"); + + addot(OT_STONE, "stone", "A medium-sized roundish stone.", MT_STONE, 0.5, OC_ROCK, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); + 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); + addot(OT_ASH, "pile of ash", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, ""); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); + addot(OT_ASHEXPLODE, "pile of exploding powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_EXPLODEONDAM, NA, NA, NA, "1d6"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, ""); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); + addot(OT_ASHCONCEAL, "pile of concealing powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, ""); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + addot(OT_ASHSLEEP, "pile of sleeping powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, ""); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); + addot(OT_GEMOFSEEING, "gem of seeing", "Magically enhances your eyesight.", MT_STONE, 1, OC_ROCK, SZ_TINY); + addflag(lastot->flags, F_HOLDCONFER, F_XRAYVIS, 2, NA, NULL); + addflag(lastot->flags, F_HOLDCONFER, F_SEEINVIS, B_TRUE, NA, NULL); + addflag(lastot->flags, F_HOLDCONFER, F_ENHANCESEARCH, 20, NA, NULL); + addflag(lastot->flags, F_HOLDCONFER, F_DETECTAURAS, B_TRUE, NA, NULL); + addflag(lastot->flags, F_HOLDCONFER, F_DETECTMAGIC, B_TRUE, NA, NULL); + addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + // godstones + addot(OT_GODSTONEJ, "Godstone of Justice", "An ancient artifact representing the power of justice.", MT_STONE, 3, OC_GODSTONE, SZ_SMALL); + addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); + 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); + // flora + addot(OT_FLOWER, "flower", "A colourful woodland flower.", MT_PLANT, 0.01, OC_FLORA, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, ""); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_GLYPH, C_MAGENTA, NA, NA, ","); + addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, "3d6"); + addot(OT_LEAF, "leaf", "A fallen leaf from a tree.", MT_PLANT, 0.01, OC_FLORA, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, ""); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, ","); + addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, "3d6"); + addot(OT_MISTLETOE, "sprig of mistletoe", "A small cutting of mistletoe.", MT_PLANT, 0.01, OC_FLORA, SZ_TINY); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "leaf"); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, ""); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_GLYPH, C_WHITE, NA, NA, ","); + addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, "3d6"); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addot(OT_SHRUB, "shrub", "A small but dense shrub.", MT_PLANT, 50, OC_FLORA, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, ""); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "%"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MEDIUM, NA, NULL); + addflag(lastot->flags, F_REDUCEMOVEMENT, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, "2d6"); + addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); + addot(OT_STUMP, "tree stump", "A large tree stump.", MT_WOOD, 150, OC_FLORA, SZ_LARGE); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, ""); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "'"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_HUMAN, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, "2d6"); + addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); + addot(OT_TREE, "tree", "A tree.", MT_WOOD, 200, OC_FLORA, SZ_LARGE); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, ""); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "#"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 80, 80, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, "2d6"); + addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); + + // food + addot(OT_BERRY, "berry", "Juicy, brightly coloured berries.", MT_FOOD, 0.1, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_ORANGE, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 8, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); + addflag(lastot->flags, F_NUMAPPEAR, 1, 15, NA, ""); + addot(OT_CACFRUIT, "cactus fruit", "The nutritous fruit from a cactus plant.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_RED, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 100, NA, ""); + addflag(lastot->flags, F_RARITY, H_FOREST, 90, NA, NULL); + addot(OT_GARLIC, "clove of garlic", "A very pungent clove of raw garlic. ", MT_FOOD, 0.1, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 5, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); + addot(OT_NUT, "peanut", "A species in the legume family.", MT_FOOD, 0.1, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 12, NA, ""); + addflag(lastot->flags, F_RARITY, H_FOREST, 90, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_NUMAPPEAR, 1, 12, NA, ""); + addot(OT_BANANA, "banana", "Ba-na-na-na-na-na na-na na-na-na.", MT_FOOD, 0.3, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 50, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); + + addot(OT_BANANASKIN, "banana skin", "A slippery banana skin.", MT_FOOD, 0.1, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "%"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_SLIPPERY, 15, NA, NA, NULL); + addflag(lastot->flags, F_SLIPMOVE, 15, NA, NA, NULL); + + addot(OT_APPLE, "apple", "A crunchy apple.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 50, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); + addot(OT_MUSHROOM, "mushroom", "A large brown mushroom.", MT_FOOD, 0.2, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 60, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); + addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); + addot(OT_BREADSTALE, "loaf of stale bread", "A small loaf of old, stale bread.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 100, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some bread"); + addot(OT_CHEESE, "chunk of cheese", "A chunk of hard cheese.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 85, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addot(OT_STEW, "stew", "Some kind of meat soaked in water.", MT_FOOD, 1.5, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 100, NA, ""); + addot(OT_ROASTMEAT, "chunk of roast meat", "A chunk of flame-roasted flesh.", MT_FLESH, 1, OC_FOOD, SZ_TINY); // weight normally comes from corpse type + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 100, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addot(OT_BREADFRESH, "loaf of fresh bread", "A freshly-baked loaf of bread.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 200, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some bread"); + addot(OT_CLOVER, "four leafed clover", "A rare 4-leafed clover.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 5, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_RARE, NULL); + addflag(lastot->flags, F_HOLDCONFER, F_EXTRALUCK, 1, NA, NULL); + addot(OT_CARROT, "carrot", "A stout orange carrot. Rumour has it that carrots are good for your eyesight.", MT_FOOD, 0.2, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_ORANGE, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 60, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_UNCOMMON, NULL); + addot(OT_CHOCOLATE, "block of chocolate", "An entire block of chocolate.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 250, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + // corpses + addot(OT_CORPSE, "corpse", "xxx", MT_FLESH, 1, OC_CORPSE, SZ_TINY); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 1, NA, NULL); // will be overridden + addot(OT_HEAD, "head", "xxx", MT_FLESH, 1, OC_CORPSE, SZ_SMALL); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 1, NA, NULL); // will be overridden + addot(OT_FLESHCHUNK, "chunk of flesh", "A chunk of flesh from something.", MT_FLESH, 1, OC_FOOD, SZ_SMALL); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "%"); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 25, NA, NULL); + addot(OT_FINGER, "severed finger", "The severed finger from some kind of creature.", MT_FLESH, 0.02, OC_CORPSE, SZ_TINY); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 1, NA, NULL); + + + // potions (sorted by rarity) + addot(OT_POT_JUICE, "potion of fruit juice", "Tasty (but not very fresh) fruit juice!", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addot(OT_POT_HEALINGMIN, "potion of minor healing", "Restores 1-10 health to whoever drinks it.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_AIHEALITEM, B_TRUE, NA, NA, NULL); + addot(OT_POT_WATER, "potion of water", "Plain, regular water.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "small puddle of water"); + modflag(lastot->flags, F_HASHIDDENNAME, NA, NA, NA, "clear potion"); + addot(OT_POT_HEALING, "potion of healing", "Restores 10-20 health to whoever drinks it.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_AIHEALITEM, B_TRUE, NA, NA, NULL); + addot(OT_POT_HEALINGMAJ, "potion of major healing", "Restores 20-30 health to whoever drinks it.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 72, NA, NULL); + addflag(lastot->flags, F_AIHEALITEM, B_TRUE, NA, NA, NULL); + addot(OT_POT_OIL, "potion of oil", "A bottle of cooking oil.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 83, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "puddle of oil"); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_EXPLODEONDAM, DT_FIRE, NA, NA, "2d4"); + addot(OT_POT_COFFEE, "potion of coffee", "A caffeinated beverage prepared from coffee beans.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 83, NA, NULL); + addot(OT_POT_RUM, "potion of rum", "Strong liqour which is sure to make you tipsy.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 83, NA, NULL); + addflag(lastot->flags, F_FLAMMABLE, 1, NA, NA, "medium fire"); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_EXPLODEONDAM, DT_FIRE, NA, NA, "2d6"); + addflag(lastot->flags, F_BADOBJECT, B_TRUE, NA, NA, NULL); + addot(OT_POT_RESTORATION, "potion of restoration", "Restores lost abilities to the drinker.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addot(OT_POT_SLEEP, "potion of sleep", "Puts the drinker into a deep sleep.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 83, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BADOBJECT, B_TRUE, NA, NA, NULL); + addot(OT_POT_SPEED, "potion of haste", "Temporarily increasees the drinker's speed.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + addot(OT_POT_LEVITATION, "potion of levitation", "Causes the drinker to float up in the air.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 78, NA, NULL); + addot(OT_POT_MAGIC, "potion of magic", "Fully restores the drinker's magical energy.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addot(OT_POT_ACROBATICS, "potion of acrobatics", "Allows the drinker to leap large distances.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addot(OT_POT_INVIS, "potion of invisibility", "Temporarily renders the drinker invisible.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + addot(OT_POT_POISON, "potion of poison", "Poisons the drinker.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BADOBJECT, B_TRUE, NA, NA, NULL); + addot(OT_POT_ACID, "flask of battery acid", "Causes massive internal burning if ingested.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "puddle of acid"); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BADOBJECT, B_TRUE, NA, NA, NULL); + addot(OT_POT_ELEMENTIMMUNE, "potion of elemental immunity", "Grants the imbiber temporary immunity to both fire and cold.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addot(OT_POT_BLOOD, "potion of blood", "A small quantity of blood.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "splash of blood"); + addot(OT_POT_SANCTUARY, "potion of sanctuary", "Creates a temporary magical barrier abour the drinker.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + + addot(OT_POT_ETHEREALNESS, "potion of etherealness", "Allows the walker to temporarily pass through walls.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addot(OT_POT_EXPERIENCE, "potion of experience", "Instantly grants the imbiber the next experience level.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 40, NA, NULL); + addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, 40, NA, NULL); + + addot(OT_POT_BLOODC, "potion of cockatrice blood", "A small quantity of cockatrice blood.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "splash of cockatrice blood"); + + addot(OT_POT_COMPETENCE, "potion of competence", "Permemantly increases the drinker's strength, intelligence or dexterity.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + + addot(OT_POT_GASEOUSFORM, "potion of gaseous form", "Turns the drinker into a cloud of gas.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + + addot(OT_POT_POLYMORPH, "potion of polymorph self", "Transmutes the drinker into another living race.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addot(OT_POT_INVULN, "potion of invulnerability", "Grants the drinker temporary immunity to physical harm.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 40, NA, NULL); + addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); + addot(OT_POT_AMBROSIA, "vial of ambrosia", "The nectar of the gods, said to completely restore the drinker's health.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 35, NA, NULL); + addflag(lastot->flags, F_AIHEALITEM, B_TRUE, NA, NA, NULL); + + + + + // scrolls + + addot(OT_SCR_AWARENESS, "scroll of awareness", "Mimics the effects of a 'heightened awareness' spell.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + + addot(OT_SCR_CANINETRACKING, "scroll of canine tracking", "Mimics the effects of a 'canine tracking' spell.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_CANINETRACKING, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + + addot(OT_SCR_REMOVECURSE, "scroll of remove curse", "Removes curses from all weilded equipment.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + + addot(OT_SCR_IDENTIFY, "scroll of identify", "Completely identifies any one item.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_IDENTIFY, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + + addot(OT_SCR_MENDING, "scroll of mending", "Repairs damage to objects.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_MENDING, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 98, RR_COMMON, NULL); + addflag(lastot->flags, F_MAXPOWER, 4, NA, NA, NULL); + + addot(OT_SCR_NOTHING, "scroll of nothing", "Looks like a magic scroll, but doesn't do anything.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 84, RR_UNCOMMON, NULL); + + addot(OT_GRAPHPAPER, "piece of graph paper", "Paper containing a set of grid-lines, intended for mapping.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_HOLDCONFER, F_PHOTOMEM, NA, IFKNOWN, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + + addot(OT_MAP, "map", "A visual representation of the area.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + + addot(OT_SCR_CREATEMONSTER, "scroll of create monster", "Summons a (probably hostile) monster to a nearby location.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_CREATEMONSTER, 4, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + + addot(OT_SCR_DETECTAURA, "scroll of detect aura", "Senses holiness or evil near the caster.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_DETECTAURA, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + + + addot(OT_SCR_DETECTLIFE, "scroll of detect life", "Senses life near the caster.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_DETECTLIFE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + + addot(OT_SCR_DETECTOBS, "scroll of detect objects", "Senses objects near the caster.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_DETECTOBS, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + + + addot(OT_SCR_DETECTMAGIC, "scroll of detect magic", "Allows the reader to detect magical enchantments.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_DETECTMAGIC, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + + addot(OT_SCR_FLAMEPILLAR, "scroll of flame pillar", "Creates a tall pillar of flame.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_FLAMEPILLAR, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + + addot(OT_SCR_FLAMEBURST, "scroll of flame burst", "Creates a radial blast of fire out from the caster, dealing 2d6 damage. Range is based on spell power.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_FLAMEBURST, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + + addot(OT_SCR_ENCHANT, "scroll of enchantment", "Magically enhances a weapon or piece of armour.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_ENCHANT, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + + addot(OT_SCR_FREEZEOB, "scroll of freezing touch", "Permenantly changes the next object touched into solid ice.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_FREEZEOB, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, RR_RARE, NULL); + addflag(lastot->flags, F_BADOBJECT, B_TRUE, NA, NA, NULL); + + addot(OT_SCR_KNOCK, "scroll of knock", "Magically opens a barrier.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_KNOCK, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, RR_COMMON, NULL); + + addot(OT_SCR_LIGHT, "scroll of light", "Creates a permenant light source centred on the caster.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_LIGHT, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + + addot(OT_SCR_MAPPING, "scroll of sense surroundings", "Magically imbues the caster with a map of his/her surroundings.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_MAPPING, 4, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, RR_UNCOMMON, NULL); + + addot(OT_SCR_MINDSCAN, "scroll of mind scan", "Allows you to view the world through another creature's eyes.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_MINDSCAN, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, RR_UNCOMMON, NULL); + + addot(OT_SCR_PERMENANCE, "scroll of permenance", "Makes all effects on an object last forever.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, RR_RARE, NULL); + + addot(OT_SCR_TELEPORT, "scroll of teleportation", "Causes the caster to teleport to a random location within the same level.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_TELEPORT, 4, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + + + addot(OT_SCR_TURNUNDEAD, "scroll of turn undead", "Instills fear in undead creatures.", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_TURNUNDEAD, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_UNCOMMON, NULL); + + addot(OT_SCR_WISH, "scroll of wishing", "Grants the caster any item of their choice (with some limitations).", MT_PAPER, 0.5, OC_SCROLL, SZ_SMALL); + addflag(lastot->flags, F_LINKSPELL, OT_S_WISHLIMITED, NA, NA, NULL); + + + // spells - actually defined as object types + // MUST DEFINE THESE _AFTER_ SCROLLS + + /////////////////// + // allomancy + /////////////////// + // l1 + addot(OT_S_ABSORBMETAL, "absorb metal", "Draws mana from nearby metallic objects.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the maximum amount of metal which can be absorbed."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ALLOMANCY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MPCOST, 0, NA, NA, NULL); + // l2 + addot(OT_S_PULLMETAL, "pull metal", "Pulls metal objects to the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ALLOMANCY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_WALLSTOP, NA, NULL); + addot(OT_S_ACCELMETAL, "accelerate metal", "Greatly accelerates a metal object thrown by the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how fast the object is propelled."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ALLOMANCY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_WALLSTOP, NA, NULL); + addot(OT_S_METALHEAL, "metal healing", "Uses nearby metal for accelerated healing.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how much damage is healed."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ALLOMANCY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + // l3 + addot(OT_S_EXPLODEMETAL, "explode metal", "Causes all metal objects in a location explode.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ALLOMANCY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_MAGSHIELD, "magnetic shield", "Surrounds the caster with magnetic force, repelling metal objects and attacks.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how long the magnetic shield will last."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ALLOMANCY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + // l4 + addot(OT_S_ANIMATEMETAL, "animate metal", "Imbues a metallic weapon with temporary life, enabling it to fight on its own.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ALLOMANCY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + + /////////////////// + // death + /////////////////// + // l1 + addot(OT_S_STENCH, "stench", "Nauseates the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability and duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 4, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l2 + addot(OT_S_BLINDNESS, "blindness", "Temporarily blinds the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability and duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, 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_S_COMMANDUNDEAD, "command undead", "Compels an undead creature to follow a single simple command.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_FEAR, "cause fear", "Causes intense fear in the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability and duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SMITEGOOD, "smite good", "Instantly deals 1-^bpower*2^n damage to good creatures.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 6, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l3 + addot(OT_S_POISONBOLT, "venom bolt", "Fires a glob of venom at the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how difficult the venom is to dodge, and how powerful the poison is."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + addot(OT_S_DRAINLIFE, "drain life", "Draws life force from the victim in order to heal the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The amount of life force drained is ^b1d6+power^n."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + addot(OT_S_PAIN, "pain", "Causes extreme pain in the target whenever they move.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the duration of the pain effect."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l4 + addot(OT_S_WEAKEN, "weaken", "Temporarily lowers the target's muscle strength by ^bpower^n points.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the duration of the weakness effect."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, 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_S_PARALYZE, "paralyze", "Disables the target's muscles, leaving them unable to move for ^bpower*2^n turns.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l5 + addot(OT_S_ANIMATEDEAD, "animate dead", "Imbues nearby corpses with life, creating an undead zombie.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the chances of the zombies being friendly."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + // TODO: should be "castnearob ot_corpse" + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addot(OT_S_FEEBLEMIND, "brain freeze", "Temporarily lowers the target's intelligence to that of an animal.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l6 + addot(OT_S_POSSESSION, "possession", "Completely possess an enemy, moving your consciousness into their body.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines its resistability."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_INFINITEDEATH, "infinite death", "Annihilates all nearby life, including the caster!", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_CASTINGTIME, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + /////////////////// + // divination + /////////////////// + // l1 + addot(OT_S_LOCATEOBJECT, "locate object", "Locates any object within an area the caster has previously travelled.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addot(OT_S_SIXTHSENSE, "sixth sense", "Warns the caster of any creature attempting to sneak up behind them.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power III, the creature's species will be detected."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power V, the exact creature type will be detected."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 5, NA, NA, NULL); + // l2 + addot(OT_S_CANINETRACKING, "canine tracking", "Enhances the caster's sense of smell, allowing them to detect exact scents within a 3 cell radius.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Power determines the spell duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addot(OT_S_MAPPING, "sense surroundings", "Magically imbues the caster with a map of his/her surroundings.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the detection range."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addot(OT_S_DETECTLIFE, "detect life", "Senses the size of creatures within a 10-cell radius of the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the detection range."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power VIII, exact creatures types are detected."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + // l3 + addot(OT_S_AWARENESS, "heightened awareness", "This spell effectively gives the caster \"eyes in the back of their head\", expending their field of vision to a full 360 degrees.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addot(OT_S_DETECTOBS, "detect objects", "Senses objects near the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the detection range and spell duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addot(OT_S_SEEINVIS, "see invisible", "Allows the caster to see invisible creatures.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + + // l4 + addot(OT_S_DETECTAURA, "detect aura", "Senses holiness or evil near the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addot(OT_S_LORE, "lore", "Obtain knowledge about any one species.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power I, you gain Novice level knowledge."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power II, you gain Beginner level knowledge."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power IV, you gain Adept level knowledge."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power VI, you gain Skilled level knowledge."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power VIII, you gain Expert level knowledge."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power X, you gain Master level knowledge."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addot(OT_S_REVEALHIDDEN, "reveal hidden", "Reveals hidden doors or invisible creatures in the caster's line of sight.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + // l5 + addot(OT_S_DETECTMAGIC, "detect magic", "Allows the caster to detect magical enchantments.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + // l6 + addot(OT_S_IDENTIFY, "identification", "Completely identifies any one item.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + + /////////////////// + // enchantment + /////////////////// + // l7 + addot(OT_S_ENCHANT, "enchantment", "Magically enhances a weapon or piece of armour.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + // TODO: hardcode how ai casts this spell + + /////////////////// + // elemental - air + /////////////////// + // l1 + addot(OT_S_MIST, "pea soup", "Hides the caster from view with a thick cloud of mist.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how long the mist will last."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_ADJSELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_CALLWIND, "zephyr", "Conjures a friendly wind, carrying a single object to the caster's hands.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines its range and the weight of objects affected."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 5, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_NEED, NA, NULL); + addot(OT_S_JOLT, "jolt", "Jolts an adjacent enemy with a short pulse of electricity, dealing 1-^bpower^n damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 6, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + + // l2 + addot(OT_S_GUSTOFWIND, "gust of wind", "Causes a gust of wind to blow up to ^bpower^n of the target's objects away.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The chance of each object blowing away is determined by the spell's power."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell's power is boosted when cast outside."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_NEED, NA, NULL); + addot(OT_S_SHATTER, "shatter", "Instantly shatters all glass in the target location.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l3 + addot(OT_S_AIRBLAST, "airblast", "Knocks enemies back with a powerful blast of air.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell's power determines how far objects or enemies will be knocked back."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_NEED, NA, NULL); + addot(OT_S_WINDSHIELD, "cyclonic shield", "Surrounds the caster with a whirling cyclone to repel missiles.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the speed of missile which can be repelled."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_VARPOWER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + // l4 + addot(OT_S_CLOUDKILL, "cloudkill", "Creates a cloud of poisonous gas. The cloud's size is 1-3 cells, depending on the spell power.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + // l5 + addot(OT_S_CHAINLIGHTNING, "chain lightning", "Electricity arcs up to 5 times between all nearby enemies. The initial arc deals 3d6 damage, the next deals 3d5 damage, etc.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's range is based on its power."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_NEED, NA, NULL); + /////////////////// + // elemental - fire + /////////////////// + // l1 + addot(OT_S_SPARK, "spark", "Creates a tiny spark of flame, dealing 1-3 fire damage to creatures and objects.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l2 + addot(OT_S_BLADEBURN, "bladeburn", "Ignites the target's bladed weapon, causing it to temporarily deal fire damage. The spell's power determines how long it will last.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines its duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_FIREDART, "flame dart", "Fires a medium-sized dart of fire, dealing 1d6+^bpower^n fire damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + // l3 + addot(OT_S_FLAMEBURST, "flame burst", "Creates a radial blast of fire out from the caster, inflicting 2d6 fire damage to all within.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The size of the radial blast is based on the spell's power."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJSELF, NA, NA, NULL); + // l4 + addot(OT_S_FLAMEPILLAR, "flame pillar", "Creates a tall pillar of flame.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how long the flames will persist."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_WALLSTOP, NA, NULL); + // l5 + addot(OT_S_BURNINGWAVE, "burning wave", "Fire bursts from the ground in a line towards the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's range is based on its power."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 3, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_WALLSTOP, NA, NULL); + addot(OT_S_FIREBALL, "fireball", "Creates a huge ball of fire, dealing up to ^bpower^nd3 damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The damage is lower for enemies further away from the ball's centre."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); // TODO: should be "near victim" + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + /////////////////// + // elemental - cold + /////////////////// + // l1 + addot(OT_S_CHILL, "chill", "Deals minor (1d3) cold damage to a single target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, 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_S_GLACIATE, "glaciate", "Slows down molecules in a given area, instantly freezing any water present. Has no effect on living creatures.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SNOWBALL, "snowball", "Throws a large snowball, dealing 1 cold damage to all within its blast. The remaining snow will quickly melt to water.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_NEED, NA, NULL); + // l2 + addot(OT_S_FREEZEOB, "freezing touch", "Changes the next thing touched into solid ice. The effect is permenant for inanimate objects, but will wear off on living creatures.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addot(OT_S_ICEEDGE, "ice edge", "Enhances the edge of a bladed weapon with a layer of ice.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how long the enchantment will remain."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_CRYSTALSHIELD, "crystalline shield", "Summons a shield of ice crystals to protect you from missiles.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how effective the shield is."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 6, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + // l3 + addot(OT_S_COLDRAY, "cold ray", "Shoots a blast of ice cold air, dealing 3d6 cold damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how difficult the ray is to dodge."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + addot(OT_S_COLDBURST, "cold burst", "Creates a radial blast of coldness out from the caster, dealing 1d8+3 cold damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's range is based on its power."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJSELF, NA, NA, NULL); + addot(OT_S_ICICLE, "icicle", "A huge icicle rises form the ground, knocking enemies away and blocking passage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long the icicle will remain."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SLIDE, "slipslide", "Generate ice underneath your feet, allowing you to slide along the ground at high speeds.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's duration is based on its power, however its effects will also end if you stop moving."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l4 + addot(OT_S_FROSTBITE, "frostbite", "Deals 1d3 cold damage to target creature per exposed body part.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, 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_S_WALLOFICE, "wall of ice", "Creates an impassable wall of solid ice.", MT_ICE, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long the wall will remain."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_CRYSTALARM, "crystalline armour", "Summons ice crystal armour to protect you from damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power 1-3: one piece of armour is created."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power 4-6: two pieces of armour are created."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power 7-9: three pieces of armour are created."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power 10: four pieces of armour are created."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SHARDSHOT, "shard shot", "Fires a scattered burst of small, fast moving ice shards. The shot will pass through multiple creatures, but damage is reduced with range.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + 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_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_WALLSTOP, NA, NULL); + addot(OT_S_SNAPFREEZE, "snap freeze", "Instantly freezes the target creature. Cold-resistant creatures will take minor damage instead.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + // l6 + addot(OT_S_ABSOLUTEZERO, "absolute zero", "Instantly freezes everything around the caster - creatures, objects, even the ground itself.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_COLD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + /////////////////// + // nature + /////////////////// + // l1 + addot(OT_S_CALMANIMALS, "calm animals", "Makes animals within the casters line of sight become peaceful.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how many hit dice worth of creatures will be affected."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addot(OT_S_DETECTPOISON, "detect poison", "Detects any poisoned object in sight of the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addot(OT_S_PURIFYFOOD, "purify food", "Removes rot or poison from food or drink.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addot(OT_S_STICKTOSNAKE, "sticks to snakes", "Transforms all seen wooden weapons into snakes.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + // l2 + addot(OT_S_BARKSKIN, "barkskin", "Covers the caster with a skin of bark, reducing damage but making them vulnerable to fire.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addot(OT_S_CHARMANIMAL, "befriend animal", "Temporarily makes a single animal friendly to you.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how the maximum hit dice creature which can be affected."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 5, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_LESSENPOISON, "lessen poison", "Reduces the effects of poison within the caster's bloodstream.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_REPELINSECTS, "repel insects", "Surrounds the caster with an insect-repelling smell.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addot(OT_S_SOFTENEARTH, "soften earth", "Converts earth into mud, slowing down.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how much mud will be created."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SUMMONANIMALSSM, "summon small animals", "Summons 2-3 small animals.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long the summoned creatures will remain."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_SUMMONING, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addot(OT_S_WARPWOOD, "warp wood", "Causes damage to all wooden object in the target area.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l3 + addot(OT_S_CALLLIGHTNING, "call lightning", "Blasts a single enemy with a bolt of lightning from the sky, dealing 3d6 damage (4d6 if outdoors).", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, 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_S_LIGHTNINGBOLT, "electricity bolt", "Fires a bolt of electricity through multiple enemies, dealing 2d6 damage to each.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's range is based on its power."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_WALLSTOP, NA, NULL); + addot(OT_S_ENDUREELEMENTS, "endure elements", "Provides resistance to fire and cold.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_QUENCH, "quench", "Extinguishes all fires within the given area.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_EVAPORATE, "evaporate", "Instantly converts all water in the given area into steam.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the amount of water affected."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SLEETSTORM, "sleet storm", "Creates an cloud of sleet, hampering vision and movement.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the size of the storm."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell's power is boosted when cast outside."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 4, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_THORNS, "thorns", "Sharp thorns grow from your skin, dealing 1d4 damage to attackers.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addot(OT_S_WEB, "web", "Slows down pursuers with a burst of sticky spider web.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how much webbing is created."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_NEED, NA, NULL); + // l4 + addot(OT_S_DIG, "dig", "Blasts away earth to create passages.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how much earth can be destroyed."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addot(OT_S_ENTANGLE, "entangle", "Causes magical vines to hold enemies.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the strength of the vines."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_CALMINGSCENT, "calming scent", "Automatically calms any nearby animals.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addot(OT_S_SATEHUNGER, "sate hunger", "Immediately satisfies the hunger of one living creature.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addot(OT_S_SUMMONANIMALSMD, "summon medium animals", "Summons 2-3 medium animals.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long the summoned creatures will remain."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_SUMMONING, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addot(OT_S_WATERJET, "water spray", "Fires a high pressure blast of water from the caster's hands.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how far enemies are knocked back."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + // l5 + addot(OT_S_HAILSTORM, "hail storm", "Creates an intense storm of hail, causing damage to all within.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the size of the storm."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell's power is boosted when cast outside."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, 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_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 5, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l6 + addot(OT_S_LIGHTNINGSTORM, "lightning storm", "Blasts all visible enemies bolts of lightning from the sky, dealing 3d6 damage (4d6 if outdoors).", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how many bolts will appear."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addot(OT_S_SUMMONANIMALSLG, "summon large animals", "Summons 2-3 large animals.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long the summoned creatures will remain."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_SUMMONING, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addot(OT_S_FLOOD, "flood", "Creates a massive ball of water.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the amount of water which appears."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + /////////////////// + // gravity + /////////////////// + // l1 + addot(OT_S_TRUESTRIKE, "weapon attraction", "Gives the target unerring accuracy, making their attacks always hit.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the amount of strikes before it expires."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addflag(lastot->flags, F_VARPOWER, B_TRUE, NA, NA, NULL); + // l2 + addot(OT_S_GRAVLOWER, "lessen gravity", "Causes the caster to fall very slowly.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + // l3 + addot(OT_S_SLOW, "slowness", "Decreases the speed of the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long the slowness will last."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + // l4 + addot(OT_S_GRAVBOOST, "boost gravity", "Greatly increases gravity around the target, stopping them from moving.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long its effects will last."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addot(OT_S_LEVITATION, "levitation", "Causes the caster hover a metre above the ground.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + // l5 + // l6 + addot(OT_S_FLIGHT, "fly", "Allows the caster to fly.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addot(OT_S_HASTE, "haste", "Increases the speed of the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long its effects will last."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + /////////////////// + // life / cleric spells + /////////////////// + // l1 + addot(OT_S_HEALINGMIN, "minor healing", "Restores 1-8 health to the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell heals an extra 2 damage per power level."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_TURNUNDEAD, "turn undead", "Instills fear in undead creatures.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + // l2 + addot(OT_S_SPEAKDEAD, "speak with dead", "Temporarily allow a corpse to answer questions about its former life.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DEATH, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addot(OT_S_SMITEEVIL, "smite evil", "Instantly deals 1-^bpower*2^n damage to evil creatures.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 10, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l3 + addot(OT_S_HEALING, "healing", "Restores 10-20 health to the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell heals an extra 2 damage per power level."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_HOLYAURA, "holy aura", "Surrounds the target with a holy aura, causing their weapon to deal holy damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + // l4 + addot(OT_S_HEALINGMAJ, "major healing", "Restores 20-30 health to the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell heals an extra 2 damage per power level."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_CUREPOISON, "cure poison", "Cures the target of all poisons.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + /////////////////// + // mental/psionic + /////////////////// + // l1 + addot(OT_S_MINDSCAN, "mind scan", "Reveals detailed information about the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_DISORIENT, "disorient", "Spins the target around to face a different direction. This will sometimes also make them dizzy.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 10, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addot(OT_S_STUN, "stun", "Stuns the target, preventing them from taking action for a few seconds.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + // l2 + addot(OT_S_LOWERMETAB, "lower metabolism", "Slow your body's functions, decreasing your rate of hunger but also your movement speed.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power level III: your speed penalty is reduced."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power level V: you no longer suffer a speed penalty."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_TELEKINESIS, "telekinesis", "Mentally move or manipulate nearby objects.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell can lift up to 10kg per power level."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SPECIAL, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_WALLSTOP, NA, NULL); + addot(OT_S_LETHARGY, "lethargy", "Reduces the target's stamina by ^bpower^n*2.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l3 + addot(OT_S_PSYARMOUR, "psychic armour", "Mentally block incoming attacks.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The psychic armour's Armour Rating is ^bpower*4^n."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_VARPOWER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + // TODO: hardcode how ai casts this + addot(OT_S_BAFFLE, "baffle", "Confuses the target, causing them to lose control of their movement.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The target will be confused for ^bpower^n*4 turns."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SLEEP, "sleep", "Puts the target creature to sleep.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines how long the sleep effect will last."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, 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_S_HUNGER, "hunger", "Causes the target to become ravenously hungry.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l4 + addot(OT_S_PACIFY, "pacify", "Induces calmness in another, preventing them from attacking.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_STUNMASS, "mass stun", "Stuns all creatures within sight.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + // l5 + addot(OT_S_CHARM, "charm", "Causes another lifeform to temporary become friendly.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability and duration."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MENTAL, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SPECIAL, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + /////////////////// + // modification + /////////////////// + // l1 + addot(OT_S_HOLDPORTAL, "hold portal", "Prevents a door from opening.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_INSCRIBE, "inscribe", "Creates a magical inscription viewable to anyone standing nearby.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addot(OT_S_KNOCK, "knock", "Magically opens doors or other such barriers.\n", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power VII, this spell will also knock back living creatures."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_WILD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_LIGHT, "light area", "Creates a temporary light source centred on the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power III, you can control where the light appears."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power VIII, the light becomes permenant."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + // l2 + addot(OT_S_DARKNESS, "darkness", "Permenantly darkens the area around the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power III, you can control where the darkness appears."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power VIII, the darkness becomes permenant."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addot(OT_S_MENDING, "mending", "Repairs minor damage to objects (1d6 + ^bpower^n).", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addot(OT_S_GREASE, "grease", "Creates a large pool of greasy oil.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the size of the grease pool."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + // l3 + addot(OT_S_INVISIBILITY, "invisibility", "Temporarily renders the target invisible.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long the invisibility will last."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + //addflag(lastot->flags, F_XPVAL, 50, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_PASSWALL, "passwall", "Allows the caster to temporarily walk through a single wall.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long the caster can wait before entering a wall."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ENCHANTMENT, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + // l5 + addot(OT_S_GASEOUSFORM, "gaseous form", "Changes the caster into a cloud of gas.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + // l6 + addot(OT_S_PETRIFY, "petrify", "Causes a living creature to turn into stone.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addot(OT_S_POLYMORPH, "polymorph", "Transmutes the target into a new living race.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power V, you can polymorph other creatures."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power VIII, you can choose what kind of creature to polymorph into."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, 10, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + + /////////////////// + // summoning + /////////////////// + // l1 + addot(OT_S_FLOATINGDISC, "floating disc", "Creates a disc of energy to carry your equipment.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power level determines how much wight the disc can carry."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_SUMMONING, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 6, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SUMMONWEAPON, "summon weapon", "Summons a blade of pure magic into your hands. Deals 1-^bpower^n damage.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_SUMMONING, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 6, NA, NA, NULL); + addflag(lastot->flags, F_VARPOWER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + // l2 + addot(OT_S_CREATEMONSTER, "create monster", "Summons a (probably hostile) monster to a nearby location.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power V you can control where the monster appears."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power VII you can control the type of monster created."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_SUMMONING, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l5 + addot(OT_S_SUMMONDEMON, "summon demon", "Summons a random demonic entity.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines its chances of success, and how long the demon will remain."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_SUMMONING, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + /////////////////// + // translocation + /////////////////// + // l1 + addot(OT_S_APPORTATION, "apportation", "Instantly transports a single visible object up to 10kg in weight to the caster's pack.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l2 + addot(OT_S_BLINK, "blink", "Teleports the caster to a random location within view.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power VI you can choose where to blink to."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 6, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + addot(OT_S_SUCK, "suck", "Sucks the target lifeform towards the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_WALLSTOP, NA, NULL); + // l3 + addot(OT_S_TWIDDLE, "twiddle", "Swaps places with the target creature.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l4 + addot(OT_S_TELEPORT, "teleportation", "Teleports the caster (and Power-1 adjacent allies) to a new location within the same level.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power V, you can choose the general direction to teleport in."); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At power VII, you can choose exactly where to teleport to."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 4, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addot(OT_S_DISPERSAL, "dispersal", "Scatters everything in the target cell around the area.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines resistability."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); + // l5 + addot(OT_S_GATE, "gate", "Creates a portal to a different dungeon level (within ^bpower^n*2 levels).", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + // l6 + addot(OT_S_PLANESHIFT, "planeshift", "Instantly transports the caster to a different plane of existence.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_TRANSLOCATION, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + + /////////////////// + // wild + /////////////////// + // l1 + addot(OT_S_MANASPIKE, "mana spike", "Fires a small bolt of wild magic, dealing 1d2 magical damage per power level.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_WILD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 3, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + // l2 + addot(OT_S_ENERGYBOLT, "energy bolt", "Fires a medium-sized bolt of wild magic, dealing 1d4 damage per power level.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_WILD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 3, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); + addot(OT_S_ALARM, "alarm", "Creates a passive alarm which goes off when an enemy is nearby.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_WILD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addflag(lastot->flags, F_ONGOING, B_TRUE, NA, NA, NULL); + // l3 + addot(OT_S_ENERGYBLAST, "energy blast", "Causes a ring of energy to expand from the caster, causing 2d6 damage to anything in sight.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the radius of the blast."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_WILD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJSELF, NA, NA, NULL); + addot(OT_S_FLASH, "flash", "Causes a very bright flash, stunning anyone who sees it.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the size of the flash."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_WILD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + // l6 + addot(OT_S_DETONATE, "detonate", "Causes a given area to explode with massive force.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "Spell power determines the size of the explosion."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_WILD, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + + + // divine powers (spells/abilities) + addot(OT_A_BLINDALL, "nosight", "Make everyone on the level blind.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_DEBUG, "debug", "You can toggle debugging for a lifeform.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_ENHANCE, "enhance", "Enhance a lifeform's stats.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_LEARN, "learn", "Learn new skills.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_LEVELUP, "levelup", "Bestow the given xp level.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_S_WISH, "wish", "Grants the caster any item of their choice. Beware - casting this powerful spell will reduce the caster's hit points by 50%.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINE, NA, NA, NULL); + addot(OT_S_WISHLIMITED, "limited wish", "Grants the caster a wish of their choice. Beware - casting this powerful spell will reduce the caster's hit points by 25%.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINE, NA, NA, NULL); + addot(OT_S_CONFISCATE, "confiscate", "Takes any object from the target.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 6, 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_S_GIFT, "gift", "Grants the target any item of their choice (with some limitations).", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINE, NA, NA, NULL); + addot(OT_S_CLEARLEVEL, "blank level", "Blanks out the current map.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + addot(OT_S_CREATEVAULT, "create vault", "Create a vault of the given type.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLLEVEL, 6, NA, NA, NULL); + addflag(lastot->flags, F_SPELLSCHOOL, SS_DIVINE, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); + + // abilities + addot(OT_A_EMPLOY, "employ", "Assigns a job to the target lifeform.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_CHARGE, "charge", "You can quickly charge into close quarters for battle.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addot(OT_A_CRUSH, "crush", "You can crush enemies after grabbing them.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addflag(lastot->flags, F_NEEDSGRAB, B_TRUE, NA, NA, NULL); + addot(OT_A_COOK, "cook", "Combine food and water into a healthy meals.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_DARKWALK, "darkwalk", "Step between the shadows.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + // ai will cast this spell in a special manner... + addot(OT_A_COMBOSTRIKE, "combination strike", "Perform a combination of blows which continues each time you defeat an enemy.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addot(OT_A_DISARM, "disarm", "Attempt to disable a known trap.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_FEIGNDEATH, "feign death", "Pretend to be dead.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_FLURRY, "flurry", "Perform a flurry of attacks, forcing your opponent backwards.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addot(OT_A_GRAB, "grab", "You can grab hold of nearby enemies to prevent their escape.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addflag(lastot->flags, F_XPVAL, 10, NA, NA, NULL); + addot(OT_A_HEAVYBLOW, "heavy blow", "Mighty blow which knocks enemies backwards.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addot(OT_A_HIDE, "hide", "You can hide in the shadows.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + addot(OT_A_HURRICANESTRIKE, "hurricane strike", "A sweeping attack aginst everything nearby.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJSELF, NA, NA, NULL); + addot(OT_A_INSPECT, "inspect", "Try to identify an unknown scroll, book, wand or ring from your pack.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_JUMP, "jump", "You can leap large distances.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_STAMCOST, 3, NA, NA, NULL); + addot(OT_A_POLYREVERT, "revertform", "Revert to your original form.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_NOANNOUNCE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, 10, NA, NULL); + addot(OT_A_QUIVERINGPALM, "quivering palm", "A deadly palm strike which knocks the molecules in the target's body out of alignment.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_PRAY, "pray", "Ask for help from a higher being.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_RAGE, "rage", "Enter a state of berzerker rage, gaining attack and defence bonuses.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJSELF, NA, NA, NULL); + addflag(lastot->flags, F_STAMCOST, 5, NA, NA, NULL); + addot(OT_A_REPAIR, "repair equipment", "Repair damage done to your equipment.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_SPRINT, "sprint", "You can run at high speed over short distances.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_SELF, NA, NA, NULL); + addflag(lastot->flags, F_STAMCOST, 1, NA, NA, NULL); + addot(OT_A_STEAL, "steal", "Try to steal an item from an enemy.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addot(OT_A_STINGACID, "sting (acid)", "You can sting your enemies.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 1, NA, NA, NULL); + addot(OT_A_STUDYSCROLL, "study scroll", "Attempt to learn a spell directly from a scroll.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_SUCKBLOOD, "suck blood", "You can suck the blood from enemies after attaching to them.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addot(OT_A_SWOOP, "swoop", "You can attack an enemy while flying past them.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addot(OT_A_TRAIN, "train skills", "Start training to gain a new experience level or enhance skill.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addot(OT_A_TUMBLE, "tumble", "You can tumble across the ground.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_STAMCOST, 2, NA, NA, NULL); + addot(OT_A_WARCRY, "warcry", "Inspire fear in your enemies with a mighty war cry.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); + + + // books + addot(OT_MANUAL, "manual", "Teaches you one level of its subject matter.", MT_PAPER, 1.5, OC_BOOK, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addot(OT_SPELLBOOK, "spellbook", "Teaches you the spell contained within.", MT_PAPER, 1.5, OC_BOOK, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + + // wands + 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_DUNGEON, 80, RR_UNCOMMON, 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_DUNGEON, 83, RR_UNCOMMON, 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_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_DUNGEON, 80, RR_UNCOMMON, 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_DUNGEON, 80, RR_RARE, 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_DUNGEON, 80, RR_RARE, 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_DUNGEON, 73, RR_RARE, 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_DUNGEON, 73, RR_RARE, 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); + addot(OT_WAND_HASTE, "wand of haste", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, NULL); + addflag(lastot->flags, F_LINKSPELL, OT_S_HASTE, NA, NA, NULL); + addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addot(OT_WAND_WEAKNESS, "wand of enfeeblement", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, NULL); + addflag(lastot->flags, F_LINKSPELL, OT_S_WEAKEN, 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_WONDER, "wand of wonder", "Produces random effects.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, NULL); + addflag(lastot->flags, F_OPERNEEDTARGET, TT_NONE, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addot(OT_WAND_INVIS, "wand of invisibility", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, RR_RARE, NULL); + addflag(lastot->flags, F_LINKSPELL, OT_S_INVISIBILITY, NA, NA, NULL); + addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); + addot(OT_WAND_DISPERSAL, "wand of dispersal", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, RR_RARE, NULL); + addflag(lastot->flags, F_LINKSPELL, OT_S_DISPERSAL, NA, NA, NULL); + addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER|TT_OBJECT, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + addot(OT_WAND_FIREBALL, "wand of fireball", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, RR_RARE, NULL); + addflag(lastot->flags, F_LINKSPELL, OT_S_FIREBALL, 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_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_DUNGEON, 60, RR_RARE, 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_DUNGEON, 60, RR_RARE, 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_DUNGEON, 72, RR_RARE, NULL); + addflag(lastot->flags, F_LINKSPELL, OT_S_TURNUNDEAD, NA, NA, NULL); + addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); + + // tools - unique + addot(OT_ORBDUNGEONEXIT, "dungeon exit orb", "When operated, this magical key will disable the barriers around the dungeon exit stairs.", MT_STONE, 2, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_GLYPH, C_MAGENTA, NA, NA, "["); + addflag(lastot->flags, F_UNIQUE, NA, NA, NA, NULL); + addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + // tools + addot(OT_BANDAGE, "bandage", "A small medical bandage. When worn, it will counteract bleeding.", MT_CLOTH, 0.5, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_ALL, 80, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_HANDS, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); + + addot(OT_BLANKET, "wool blanket", "A warm wool blanket for those cold winter nights.", MT_CLOTH, 2, OC_TOOLS, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_ALL, 80, NA, NULL); + addflag(lastot->flags, F_HELPSREST, 10, NA, NA, NULL); + + addot(OT_BLINDFOLD, "blindfold", "Short length of wide cloth, used for blocking eyesight.", MT_CLOTH, 0.01, OC_TOOLS, SZ_TINY); + addflag(lastot->flags, F_GOESON, BP_EYES, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_BLIND, B_TRUE, NA, NULL); + addflag(lastot->flags, F_VALUE, 20, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + + addot(OT_CALTROP, "caltrop", "Connected metal spikes arranged such that one will always point upwards.", MT_METAL, 0.2, OC_TOOLS, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, NA, NA, NA, NULL); + addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_SHARP, 2, 5, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + + addot(OT_BUGLAMP, "glowing flask", "A glass flask with a glowbug corpse inside.", MT_GLASS, 0.3, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "!"); + addflag(lastot->flags, F_PRODUCESLIGHT, 2, NA, NA, NULL); + addflag(lastot->flags, F_HOLDCONFER, F_PRODUCESLIGHT, 2, IFKNOWN, NULL); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "a flask"); + + addot(OT_CANDLE, "candle", "A short wax candle.", MT_WAX, 0.2, OC_TOOLS, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACTIVATEPREFIX, NA, NA, NA, "lit"); + addflag(lastot->flags, F_ACTIVATECONFER, F_PRODUCESLIGHT, 1, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 1, NA, IFACTIVE, NULL); + addflag(lastot->flags, F_RNDCHARGES, 50, 100, NA, NULL); + addflag(lastot->flags, F_LIGHTSOURCE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CHARGELOWMSG, B_TRUE, NA, NA, "flickers"); + addflag(lastot->flags, F_CHARGEOUTMSG, B_TRUE, NA, NA, "goes out"); + + addot(OT_FRIDGE, "refrigerator", "An insulated household appliance, made for storing food.", MT_METAL, 80, OC_TOOLS, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GLYPH, C_WHITE, NA, NA, "]"); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 40, 40, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + + addot(OT_GUNPOWDER, "pile of gunpowder", "A black metallic powder.", MT_METAL, 0.5, OC_TOOLS, SZ_TINY); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of black powder"); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_EXPLODEONDAM, DT_FIRE, NA, NA, "8d2"); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, "2d6"); + addflag(lastot->flags, F_FLAMMABLE, 3, NA, NA, NULL); + addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); + + addot(OT_LAMPOIL, "oil lamp", "An oil-powered lamp which produces light.", MT_METAL, 1, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACTIVATECONFER, F_PRODUCESLIGHT, 2, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 2, NA, IFACTIVE, NULL); + addflag(lastot->flags, F_RNDCHARGES, 200, 400, NA, NULL); + addflag(lastot->flags, F_REFILLWITH, OT_POT_OIL, NA, NA, NULL); + addflag(lastot->flags, F_LIGHTSOURCE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CHARGELOWMSG, B_TRUE, NA, NA, "flickers"); + addflag(lastot->flags, F_CHARGEOUTMSG, B_TRUE, NA, NA, "goes out"); + + addot(OT_LANTERNOIL, "oil lantern", "An oil-powered lantern which produces a lot of light.", MT_METAL, 1, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 55, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACTIVATECONFER, F_PRODUCESLIGHT, 3, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 3, NA, IFACTIVE, NULL); + addflag(lastot->flags, F_RNDCHARGES, 300, 500, NA, NULL); + addflag(lastot->flags, F_REFILLWITH, OT_POT_OIL, NA, NA, NULL); + addflag(lastot->flags, F_LIGHTSOURCE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CHARGELOWMSG, B_TRUE, NA, NA, "flickers"); + addflag(lastot->flags, F_CHARGEOUTMSG, B_TRUE, NA, NA, "goes out"); + + addot(OT_LOCKPICK, "lockpick", "An angled piece of metal, used to open locks.", MT_METAL, 0.05, OC_TOOLS, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_PICKLOCKS, 10, B_DIEONFAIL, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + + addot(OT_PANPIPES, "set of panpipes", "A set of musical pipes.", MT_METAL, 0.5, OC_TOOLS, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + + addot(OT_PICKAXE, "pickaxe", "A heavy tool for breaking rock.", MT_METAL, 8, OC_TOOLS, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + + addot(OT_ROPE, "rope", "A long length of strong rope.", MT_CLOTH, 5, OC_TOOLS, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastot->flags, F_HELPSCLIMB, 3, NA, NA, NULL); + + addot(OT_SACK, "sack", "A small cloth sack.", MT_CLOTH, 0.5, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "("); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 30, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 10, NA, NA, NULL); + + addot(OT_SACKLARGE, "large sack", "A large cloth sack.", MT_CLOTH, 1, OC_TOOLS, SZ_MEDIUM); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "("); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 50, 50, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + + addot(OT_SACKHUGE, "huge sack", "An enormous cloth sack.", MT_CLOTH, 1, OC_TOOLS, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "("); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 50, 50, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + + + addot(OT_BAGOFHOLDING, "bag of holding", "A magical sack which causes items placed inside it to become weightless.", MT_CLOTH, 0.5, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_RARE, NULL); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "("); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERWITHOUTID, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOTRIED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HOLDING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 30, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 10, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "sack"); + + addot(OT_BAGOFHOLDINGLARGE, "large bag of holding", "A large magical sack which causes items placed inside it to become weightless.", MT_CLOTH, 0.5, OC_TOOLS, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_RARE, NULL); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "("); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERWITHOUTID, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOTRIED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HOLDING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "large sack"); + + addot(OT_BAGOFHOLDINGHUGE, "huge bag of holding", "An enormous magical sack which causes items placed inside it to become weightless.", MT_CLOTH, 0.5, OC_TOOLS, SZ_LARGE); + addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_VERYRARE, NULL); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "("); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERWITHOUTID, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOTRIED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HOLDING, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 100, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "huge sack"); + + addot(OT_SAFEBOX, "safebox", "A small metal container for safely storing valuables.", MT_METAL, 2, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 77, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "("); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANBETRAPPED, 20, 25, 66, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + + addot(OT_TORCH, "torch", "A metre-long wooden rod with a flammable end.", MT_WOOD, 2, OC_TOOLS, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACTIVATEPREFIX, NA, NA, NA, "lit"); + addflag(lastot->flags, F_ACTIVATECONFER, F_PRODUCESLIGHT, 2, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 2, NA, IFACTIVE, NULL); + addflag(lastot->flags, F_RNDCHARGES, 100, 200, NA, NULL); + addflag(lastot->flags, F_REFILLWITH, OT_POT_OIL, NA, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_FIRE, NA, NA, "1d4"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_LIGHTSOURCE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CHARGELOWMSG, B_TRUE, NA, NA, "flickers"); + addflag(lastot->flags, F_CHARGEOUTMSG, B_TRUE, NA, NA, "goes out"); + + addot(OT_TOWEL, "towel", "An large absorbent cloth used for drawing off moisture.", MT_CLOTH, 1.5, OC_TOOLS, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + + // tech - l0 + addot(OT_CREDITCARD, "credit card", "A rectangular plastic card.", MT_PLASTIC, 0.01, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_ALL, 90, NA, NULL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_PICKLOCKS, 2, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addot(OT_PAPERCLIP, "paperclip", "A thin, looped wire for holding paper together.", MT_WIRE, 0.01, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_ALL, 90, NA, NULL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_PICKLOCKS, 4, B_DIEONFAIL, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + // can use as a (very bad) weapon too... + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d1"); + addflag(lastot->flags, F_ACCURACY, 50, NA, NA, NULL); + + addot(OT_SLEEPINGBAG, "sleeping bag", "An insulated bag for sleeping in. Very comfortable.", MT_CLOTH, 4, OC_TECH, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, NULL); + addflag(lastot->flags, F_HELPSREST, 15, NA, NA, NULL); + + // tech - l1 + addot(OT_POCKETWATCH, "pocket watch", "A portable timekeeping device made to be carried in a pocket.", MT_METAL, 0.1, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_NOVICE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_DIGITALWATCH, "digital watch", "An electronic timekeeping device which shows the time as a number.", MT_METAL, 0.1, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_NOVICE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_INSECTICIDE, "can of insecticide", "A spraycan containing poisonous chemicals.", MT_METAL, 0.5, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERUSECHARGE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, "Where will you spray?"); + addflag(lastot->flags, F_RNDCHARGES, 1, 5, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_NOVICE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_LANTERNLED, "LED lantern", "A low-powered but efficient lantern which will last almost forever.", MT_METAL, 0.5, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACTIVATECONFER, F_PRODUCESLIGHT, 2, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 2, NA, IFACTIVE, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_NOVICE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_TENT, "tent", "A easy to use, portable shelter made of fabric.", MT_CLOTH, 10, OC_TECH, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, NULL); + addflag(lastot->flags, F_HELPSREST, 15, 1, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_NOVICE, NA, NA, NULL); + + // tech - l2 + addot(OT_FLASHBANG, "flashbang", "A stun grenade which temporarily blinds all within sight.", MT_METAL, 1, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CHARGES, 2, 2, NA, NULL); + addflag(lastot->flags, F_DONTSHOWCHARGES, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RECHARGEWHENOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FLASHONDEATH, 4, NA, B_IFACTIVATED, NULL); + addflag(lastot->flags, F_FLASHONDAM, 4, NA, B_IFACTIVATED, NULL); + addflag(lastot->flags, F_GRENADE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_BEGINNER, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_GRENADE, "grenade", "An explosive weapon which explodes a short time after activation.", MT_METAL, 1, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CHARGES, 2, 2, NA, NULL); + addflag(lastot->flags, F_DONTSHOWCHARGES, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RECHARGEWHENOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_EXPLODEONDEATH, NA, NA, B_IFACTIVATED, "8d2"); + addflag(lastot->flags, F_EXPLODEONDAM, NA, NA, B_IFACTIVATED, "5d2"); + addflag(lastot->flags, F_GRENADE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_BEGINNER, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_C4, "block of c4", "An extremely explosive plastic which explodes a medium time after activation.", MT_PLASTIC, 1, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 76, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CHARGES, 5, 5, NA, NULL); + addflag(lastot->flags, F_DONTSHOWCHARGES, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RECHARGEWHENOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_EXPLODEONDEATH, NA, B_BIG, B_IFACTIVATED, "90d2"); // 90 - 180 damage + addflag(lastot->flags, F_GRENADE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_BEGINNER, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_MOTIONSCANNER, "motion scanner", "Small scanning device which detects nearby lifeforms.", MT_METAL, 1.5, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_RARITY, H_ALL, 70, RR_RARE, NULL); + addflag(lastot->flags, F_HOLDCONFER, F_DETECTLIFE, 10, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_BEGINNER, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_NVGOGGLES, "nightvis goggles", "Special goggles which allow the wear to see in the dark.", MT_METAL, 1.5, OC_TECH, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_ALL, 70, RR_RARE, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_BEGINNER, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_EYES, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_SEEINDARK, 5, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addot(OT_STYPTIC, "styptic", "A medical compound designed to inhibit bleeding.", MT_METAL, 0.5, OC_TECH, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_BEGINNER, NA, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + + + // tech - l3 + addot(OT_INFOVISOR, "infovisor", "Sleek looking metal visor which displays info directly into the retina.", MT_METAL, 0.2, OC_TECH, SZ_SMALL); + addflag(lastot->flags, F_GOESON, BP_EYES, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_EXTRAINFO, B_TRUE, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ENHANCESEARCH, 10, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_ADEPT, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_LOCKHACKER, "lock hacker", "A sophisticated machine to manipulate physical locks.", MT_METAL, 3, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 78, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_ADEPT, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_PORTLADDER, "portable ladder", "A lightweight two metre ladder which automatically folds down to pocket size.", MT_METAL, 2, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 83, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_ADEPT, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + + // tech - l4 + addot(OT_JETPACK, "jet pack", "A portable ion-thruster which allows the wearer to fly.", MT_METAL, 10, OC_TECH, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 68, RR_RARE, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RNDCHARGES, 10, 30, NA, NULL); + addflag(lastot->flags, F_REFILLWITH, OT_POT_OIL, NA, NA, NULL); + addflag(lastot->flags, F_ACTIVATECONFER, F_FLYING, B_TRUE, NA, NULL); + addflag(lastot->flags, F_ACTIVATECONFER, F_PRODUCESLIGHT, 1, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_SKILLED, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + + // tech - l5 + addot(OT_TELEPAD, "teleport beacon", "A metal cone which will teleport the user to the nearest similar cone.", MT_METAL, 3, OC_TECH, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 68, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_EXPERT, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + addot(OT_XRAYGOGGLES, "pair of xray goggles", "Bulky looking goggles which allow you to see through walls.", MT_METAL, 0.3, OC_TECH, SZ_TINY); + addflag(lastot->flags, F_GOESON, BP_EYES, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_XRAYVIS, 2, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, RR_RARE, NULL); + addflag(lastot->flags, F_TECHLEVEL, PR_EXPERT, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); + + // tech - l6 ??? + + // misc + addot(OT_BONE, "bone", "A bone from an unknown creature.", MT_BONE, 0.1, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 90, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addot(OT_CHEST, "chest", "A small wooden treasure chest.", MT_METAL, 40, OC_FURNITURE, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "("); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 6, 6, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANBETRAPPED, 20, 20, 66, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 90, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 80, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 70, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 60, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBRND, 50, NA, NA, NULL); + addot(OT_EMPTYFLASK, "empty flask", "An empty glass flask.", MT_GLASS, 0.2, OC_MISC, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "!"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addot(OT_EMPTYVIAL, "empty vial", "An empty glass vial.", MT_GLASS, 0.1, OC_MISC, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "!"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 82, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addot(OT_BROKENGLASS, "piece of broken glass", "Sharp shards of broken glass.", MT_GLASS, 0.1, OC_MISC, SZ_MINI); + addflag(lastot->flags, F_STACKABLE, NA, NA, NA, NULL); + addflag(lastot->flags, F_NUMAPPEAR, 1, 8, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "^"); + addflag(lastot->flags, F_SHARP, 1, 2, NA, NULL); + addflag(lastot->flags, F_CRUSHABLE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastot->flags, F_NOSHATTER, B_TRUE, NA, NA, NULL); + addot(OT_ICESHEET, "sheet of ice", "A large sheet of slippery ice.", MT_ICE, 0.5, OC_MISC, SZ_MEDIUM); + 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_WHITE, NA, NA, "_"); + addflag(lastot->flags, F_DTCONVERT, DT_FIRE, NA, NA, "large puddle of water"); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "large puddle of water"); + addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "melts"); + addflag(lastot->flags, F_DIECONVERTTEXTPL, NA, NA, NA, "melt"); + addflag(lastot->flags, F_OBHP, 50, 50, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SLIPPERY, 14, NA, NA, NULL); + addot(OT_ICECHUNK, "chunk of ice", "A chunk of ice.", MT_ICE, 0.5, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 3, NA, NULL); + addflag(lastot->flags, F_STACKABLE, NA, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "small puddle of water"); + addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "melts"); + addflag(lastot->flags, F_DIECONVERTTEXTPL, NA, NA, NA, "melt"); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOSHATTER, B_TRUE, NA, NA, NULL); + + addot(OT_MELTEDWAX, "lump of melted wax", "A useless lump of melted wax.", MT_WAX, 0.1, OC_MISC, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, NA, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_NOMATCONVERT, 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_STACKABLE, NA, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "?"); + addflag(lastot->flags, F_NOMATCONVERT, NA, NA, NA, NULL); + + addot(OT_VOMITPOOL, "pool of vomit", "A disgusting pool of regurgitated food.", MT_WATER, 1, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_VILLAGE, 90, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, ","); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SLIPPERY, 1, NA, NA, NULL); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, 0, NA, NULL); + addflag(lastot->flags, F_TAINTED, B_TRUE, NA, NA, NULL); + + addot(OT_ACIDPOOL, "pool of acid", "A pool of corrosive acid.", MT_ACID, 0, OC_MISC, SZ_MEDIUM); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "~"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "evaporates"); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "puddle of acid"); + addflag(lastot->flags, F_OBHP, 4, 4, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAMBP, BP_FEET, DT_ACID, FALLTHRU, "2d4"); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_ACID, NA, NA, NULL); + + addot(OT_ACIDPUDDLE, "puddle of acid", "A small puddle of corrosive acid.", MT_ACID, 0, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "~"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBDIETEXT, NA, NA, NA, "evaporates"); + addflag(lastot->flags, F_OBHP, 4, 4, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAMBP, BP_FEET, DT_ACID, FALLTHRU, "1d4"); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_ACID, NA, NA, NULL); + + addot(OT_ACIDSPLASH, "splash of acid", "A splash corrosive acid.", MT_ACID, 0, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBDIETEXT, NA, NA, NA, "evaporates"); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAMBP, BP_FEET, DT_ACID, FALLTHRU, "1d2"); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_ACID, NA, NA, NULL); + + addot(OT_SLIMEPOOL, "pool of slime", "A disgusting mass of sticky slime.", MT_WATER, 20, OC_MISC, SZ_MEDIUM); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_EDIBLE, B_TRUE, 2, NA, NULL); + + addot(OT_PUDDLEOIL, "puddle of oil", "A slippery puddle of oil.", MT_OIL, 15, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, ","); // should really be dark grey + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FLAMMABLE, 5, NA, NA, "medium fire"); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_OIL, NA, NA, NULL); + addflag(lastot->flags, F_SLIPPERY, 13, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBDIETEXT, NA, NA, NA, "evaporates"); + + // this isn't made out of water, so that it won't put out fire etc + addot(OT_SPLASHWATER, "splash of water", "A small splash of water.", MT_NOTHING, 0.5, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_BLUE, NA, NA, ","); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBDIETEXT, NA, NA, NA, "evaporates"); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, "0d1+100"); + addflag(lastot->flags, F_LINKOB, OT_POT_WATER, NA, NA, NULL); + + addot(OT_MUDPOOL, "pool of mud", "A large puddle of wet mud.", MT_WATER, 60, OC_MISC, SZ_MEDIUM); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "~"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 90, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTIMMUNE, DT_WATER, NA, NA, NULL); + addflag(lastot->flags, F_REDUCEMOVEMENT, 2, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + //addflag(lastot->flags, F_WALKDAM, DT_WATER, NA, NA, "0d1+1"); + addflag(lastot->flags, F_WALKDAMBP, BP_FEET, DT_WATER, FALLTHRU, "0d1+1"); + + addot(OT_PUDDLEWATER, "small puddle of water", "A small puddle of water.", MT_WATER, 10, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_BLUE, NA, NA, ","); + addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 90, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTCONVERT, DT_COLD, NA, NA, "sheet of ice"); + addflag(lastot->flags, F_DTCONVERT, DT_FIRE, NA, NA, "puff of steam"); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_WATER, NA, NA, NULL); + //addflag(lastot->flags, F_WALKDAM, DT_WATER, NA, NA, "0d1+1"); + addflag(lastot->flags, F_WALKDAMBP, BP_FEET, DT_WATER, FALLTHRU, "0d1+1"); + + addot(OT_PUDDLEWATERL, "large puddle of water", "A large pool of water.", MT_WATER, 20, OC_MISC, SZ_MEDIUM); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_BLUE, NA, NA, "~"); + addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 85, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DTCONVERT, DT_COLD, NA, NA, "sheet of ice"); + addflag(lastot->flags, F_DTCONVERT, DT_FIRE, NA, NA, "cloud of steam"); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_WATER, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAMBP, BP_FEET, DT_WATER, FALLTHRU, "0d1+2"); + + addot(OT_BLOODSTAIN, "blood stain", "A dried stain of blood.", MT_BLOOD, 0, OC_MISC, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_RED, NA, NA, ","); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_COSMETIC, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_BLOODCSPLASH, "splash of cockatrice blood", "A small pool of cockatrice blood.", MT_BLOOD, 0, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SLIPPERY, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBDIETEXT, NA, NA, NA, "evaporates"); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, 0, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_BLOODC, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_BLOODSPLASH, "splash of blood", "A small pool of blood.", MT_BLOOD, 0, OC_MISC, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, ","); + addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SLIPPERY, 1, NA, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "blood stain"); + //addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "dries up"); + //addflag(lastot->flags, F_DIECONVERTTEXTPL, NA, NA, NA, "dry up"); + addflag(lastot->flags, F_NODIECONVERTTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_BLOOD, NA, NA, NULL); + addflag(lastot->flags, F_COSMETIC, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + + addot(OT_BLOODPOOL, "pool of blood", "A large pool of blood.", MT_BLOOD, 0, OC_MISC, SZ_MEDIUM); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "~"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SLIPPERY, 3, NA, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "blood stain"); + addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "dries up"); + addflag(lastot->flags, F_DIECONVERTTEXTPL, NA, NA, NA, "dry up"); + addflag(lastot->flags, F_OBHP, 45, 45, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DRINKABLE, B_TRUE, 0, NA, NULL); + addflag(lastot->flags, F_LINKOB, OT_POT_BLOOD, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, 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, NA, "|"); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 6, 6, NA, NULL); + + + // furniture + addot(OT_CANDELABRUM, "candelabrum", "A large (and heavy) decorative candle, about human height.", MT_METAL, 60, OC_FURNITURE, SZ_HUMAN); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "\\"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACTIVATEPREFIX, NA, NA, NA, "lit"); + addflag(lastot->flags, F_ACTIVATECONFER, F_PRODUCESLIGHT, 4, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 4, NA, IFACTIVE, NULL); + addflag(lastot->flags, F_REFILLWITH, OT_POT_OIL, NA, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_LIGHTSOURCE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CHARGELOWMSG, B_TRUE, NA, NA, "flickers"); + addflag(lastot->flags, F_CHARGEOUTMSG, B_TRUE, NA, NA, "goes out"); + + 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_RARE, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "|"); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOB, 80, NA, NA, "3-4 piles of ash"); + addflag(lastot->flags, F_STARTOB, 80, NA, NA, "5-10 bones"); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + + addot(OT_FIREPLACE, "fireplace", "A roaring fireplace.", MT_STONE, 200, OC_FURNITURE, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_RED, NA, NA, "\\"); + addflag(lastot->flags, F_PRODUCESLIGHT, 3, NA, IFACTIVE, 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_ONFIRE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); + + addot(OT_WEAPONRACK, "weapon rack", "A large matel frame, made to store weapons.", MT_METAL, 150, OC_FURNITURE, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_RARE, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "\\"); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOB, 80, NA, NA, "random weapon"); + addflag(lastot->flags, F_STARTOB, 60, NA, NA, "random weapon"); + addflag(lastot->flags, F_STARTOB, 50, NA, NA, "good weapon"); + addflag(lastot->flags, F_STARTOB, 50, NA, NA, "great weapon"); + + addot(OT_WOODENBARREL, "wooden barrel", "A solid wooden barrel.", MT_WOOD, 40, OC_FURNITURE, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_VILLAGE, 75, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "("); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); + addflag(lastot->flags, F_CRUSHABLE, SZ_HUGE, NA, NA, NULL); + addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 12, 12, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_POTION, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_POTION, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); + + addot(OT_WOODENTABLE, "wooden table", "A waist-height wooden table.", MT_WOOD, 25, OC_FURNITURE, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "\\"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_HUMAN, 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); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_BASH, NA, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); + + addot(OT_WOODENSTOOL, "wooden footstool", "A small, wooden footstool.", MT_WOOD, 5, OC_FURNITURE, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_ALL, 83, NA, NULL); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "\\"); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 4, 4, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); + + // trail objects + addot(OT_FOOTPRINT, "footprints", "Footprints which show the passage of some kind of creature.", MT_NOTHING, 0, OC_MISC, SZ_MINI); + addflag(lastot->flags, F_NO_A, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NO_PLURAL, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOGLYPH, NA, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + // NOTE: must add F_TRAIL when creating this object. + addot(OT_SCENT, "scent", "The scent of a creature, only perceivable to those with an enhanced sense of smell.", MT_NOTHING, 0, OC_MISC, SZ_MINI); + addflag(lastot->flags, F_NO_A, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NO_PLURAL, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOGLYPH, NA, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); + // NOTE: must add F_TRAIL when creating this object. + + // effects + addot(OT_FIRELARGE, "large fire", "A large, roaring inferno.", MT_FIRE, 0, OC_EFFECT, SZ_HUMAN); + addflag(lastot->flags, F_GLYPH, C_ORANGE, NA, NA, "{"); + addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "dies down a little"); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "medium fire"); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAM,DT_FIRE, NA, NA, "2d4+4"); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 3, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + addot(OT_FIREMED, "medium fire", "A medium-sized roaring fire.", MT_FIRE, 0, OC_EFFECT, SZ_MEDIUM); + addflag(lastot->flags, F_GLYPH, C_RED, NA, NA, "{"); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "small fire"); + addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "dies down a little"); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "2d4"); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 2, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + addot(OT_FIRESMALL, "small fire", "A small blaze.", MT_FIRE, 0, OC_EFFECT, SZ_SMALL); + addflag(lastot->flags, F_GLYPH, C_RED, NA, NA, "{"); + addflag(lastot->flags, F_OBDIETEXT, B_TRUE, NA, NA, "goes out"); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "1d4"); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_PRODUCESLIGHT, 1, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + + addot(OT_STEAMCLOUD, "cloud of steam", "A thick cloud of scalding steam.", MT_GAS, 0, OC_EFFECT, SZ_HUMAN); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "}"); + addflag(lastot->flags, F_NODIECONVERTTEXT, NA, NA, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "puff of steam"); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, 3, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "1d2"); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + + addot(OT_STEAMPUFF, "puff of steam", "A small puff of scalding steam.", MT_GAS, 0, OC_EFFECT, SZ_MEDIUM); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "}"); + addflag(lastot->flags, F_OBDIETEXT, B_TRUE, NA, NA, "disperses"); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, 1, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "1d1+1"); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + + + addot(OT_SLEETSTORM, "storm of sleet", "An intense storm of sleet. Hampers movement", MT_GAS, 0, OC_EFFECT, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_CYAN, NA, NA, "}"); + addflag(lastot->flags, F_NODIECONVERTTEXT, NA, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, 3, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_REDUCEMOVEMENT, 3, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + addflag(lastot->flags, F_WALKDAMBP, BP_HEAD, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_SHOULDERS, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_BODY, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_HANDS, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_LEGS, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_FEET, DT_WATER, NA, "1d2"); + + addot(OT_MIST, "thick mist", "A thick cloud of obscuring mist.", MT_GAS, 0, OC_EFFECT, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "}"); + addflag(lastot->flags, F_OBDIETEXT, B_TRUE, NA, NA, "clears"); + addflag(lastot->flags, F_OBHP, 4, 4, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + + addot(OT_SMOKECLOUD, "cloud of smoke", "A thick cloud of black smoke.", MT_GAS, 0, OC_EFFECT, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "}"); + addflag(lastot->flags, F_NODIECONVERTTEXT, NA, NA, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "puff of smoke"); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + addflag(lastot->flags, F_CAUSESCOUGH, 26, NA, NA, NULL); + + + addot(OT_SMOKEPUFF, "puff of smoke", "A small puff of black smoke.", MT_GAS, 0, OC_EFFECT, SZ_MEDIUM); + addflag(lastot->flags, F_GLYPH, NA, NA, NA, "}"); + addflag(lastot->flags, F_OBDIETEXT, B_TRUE, NA, NA, "disperses"); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, 4, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_CAUSESCOUGH, 18, NA, NA, NULL); + + addot(OT_POISONCLOUD, "cloud of poison gas", "A thick cloud of poisonous gas.", MT_GAS, 0, OC_EFFECT, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "}"); + addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "thins out a little"); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "puff of gas"); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAM, DT_POISONGAS, NA, NA, "1d4"); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + addflag(lastot->flags, F_BLOCKSVIEW, 2, NA, NA, NULL); + + addot(OT_POISONPUFF, "puff of poison gas", "A small puff of poisonous gas.", MT_GAS, 0, OC_EFFECT, SZ_MEDIUM); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "}"); + addflag(lastot->flags, F_OBDIETEXT, B_TRUE, NA, NA, "disperses"); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_WALKDAM, DT_POISONGAS, NA, NA, "1d2"); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + + addot(OT_HAILSTORM, "hail storm", "An intense storm of damaging hail.", MT_GAS, 0, OC_EFFECT, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_WHITE, NA, NA, "}"); + addflag(lastot->flags, F_NODIECONVERTTEXT, NA, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, 5, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + addflag(lastot->flags, F_WALKDAM, DT_COLD, NA, NA, "1d4"); + addflag(lastot->flags, F_WALKDAMBP, BP_HEAD, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_SHOULDERS, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_BODY, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_HANDS, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_LEGS, DT_WATER, NA, "1d2"); + addflag(lastot->flags, F_WALKDAMBP, BP_FEET, DT_WATER, NA, "1d2"); + + addot(OT_ICEWALL, "wall of ice", "A wall made of solid ice.", MT_ICE, 0, OC_EFFECT, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_CYAN, NA, NA, "#"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 100, 100, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + + + addot(OT_MAGICBARRIER, "magical barrier", "A glowing, impassable barrier of magical energy.", MT_MAGIC, 0, OC_EFFECT, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "#"); + addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); + addflag(lastot->flags, F_REALLYIMPASSABLE, NA, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBDIETEXT, B_TRUE, NA, NA, "vanishes"); + addflag(lastot->flags, F_PRODUCESLIGHT, 1, NA, NA, NULL); + + addot(OT_VINE, "entangling vine", "A living vine which grasps nearby creature", MT_SILK, 0.1, OC_EFFECT, SZ_HUMAN); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 82, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 90, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREEN, NA, NA, "^"); + addflag(lastot->flags, F_RESTRICTMOVEMENT, 30, B_TRUE, B_TRUE, NULL);// the value here will be filled in by the spell. + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_ACID, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + + addot(OT_WEB, "web", "A huge, sticky spider web.", MT_SILK, 0.1, OC_EFFECT, SZ_HUMAN); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 86, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 88, NA, NULL); + addflag(lastot->flags, F_RESTRICTMOVEMENT, 25, B_TRUE, B_TRUE, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastot->flags, F_DTVULN, DT_ACID, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + + + // armour - body + addot(OT_COTTONSHIRT, "cotton shirt", "A comfortable white cotton shirt.", MT_CLOTH, 0.7, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 0, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addot(OT_ARMOURLEATHER, "leather armour", "Body armour created from soft leather.", MT_LEATHER, 10, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 4, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 10, 10, NULL); + addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 3, NA, NULL); + addot(OT_ARMOURRING, "suit of ring mail", "Body armour formed by a series of metallic rings sewn to a leather foundation.", MT_METAL, 15, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 6, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 20, 20, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 7, NA, NULL); + addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + addot(OT_ARMOURSCALE, "suit of scale armour", "Body armour consisting of many small scales attached to leather.", MT_METAL, 20, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 10, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 30, 30, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addflag(lastot->flags, F_OBHP, 35, 35, NA, NULL); + addot(OT_ARMOURCHAIN, "suit of chainmail", "Heavy body armour consisting of tightly meshed metal rings.", MT_METAL, 25, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 15, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 40, 40, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addflag(lastot->flags, F_OBHP, 45, 45, NA, NULL); + addot(OT_ARMOURSPLINT, "suit of splint mail", "Heavy armour, consisting of strips of metal attached to a leather backing.", MT_METAL, 35, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 20, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 50, 50, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 11, NA, NULL); + addflag(lastot->flags, F_OBHP, 50, 50, NA, NULL); + addot(OT_ARMOURPLATE, "suit of plate mail", "Heavy armour with embedded metal plates.", MT_METAL, 40, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, RR_RARE, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 25, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 60, 60, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_OBHP, 60, 60, NA, NULL); + + addot(OT_FLAKJACKET, "flak jacket", "Heavy metal body armour. Designed to stop a bullet, but ineffective against melee attacks.", MT_METAL, 30, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 10, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 10, NA, NULL); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addot(OT_OVERALLS, "pair of overalls", "Well-made, brightly coloured workman overalls.", MT_CLOTH, 1, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addot(OT_SILKSHIRT, "silk shirt", "A lightweight, comfortable white silk shirt.", MT_SILK, 0.5, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 0, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addot(OT_ROBE, "robe", "A plain robe.", MT_CLOTH, 4, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addot(OT_VELVETROBE, "velvet robe", "A luxurious velvet robe.", MT_CLOTH, 4, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + // armour - shoulders + addot(OT_CLOAK, "cloak", "A standard leather cloak.", MT_LEATHER, 4, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_SHOULDERS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_WATERPROOF, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HELPSREST, 5, NA, NA, NULL); + // armour - waist + addot(OT_BELTLEATHER, "leather belt", "A plain leather belt.", MT_LEATHER, 0.2, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_WAIST, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + // armour - legs + addot(OT_CLOTHTROUSERS, "pair of cloth trousers", "A rough pair of cloth trousers.", MT_CLOTH, 2, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addot(OT_RIDINGTROUSERS, "pair of riding trousers", "A fitted pair of leather trousers.", MT_LEATHER, 2, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addot(OT_COMBATPANTS, "pair of combat pants", "An lightly-armoured pair of camoflauged trousers.", MT_CLOTH, 2, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 3, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addot(OT_GREAVES, "set of greaves", "A set of heavy metal greaves.", MT_METAL, 4, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 4, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 25, 25, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 15, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + // armour - feet + addot(OT_SANDALS, "pair of sandals", "Comfortable pair of open leather sandals.", MT_LEATHER, 1, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 0, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL); + addot(OT_SHOESLEATHER, "pair of leather shoes", "Cheap and rather uncomfortable leather shoes.", MT_LEATHER, 2, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + addot(OT_BOOTSRUBBER, "pair of rubber boots", "A waterproof (but somewhat cumbersome) pair of rubber boots.", MT_RUBBER, 6, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 0, 5, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_DTRESIST, DT_ELECTRIC, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addot(OT_BOOTSSPIKED, "pair of spiked boots", "A plain pair of leather boots with spikes on the bottom.", MT_LEATHER, 3, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_STABILITY, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + addot(OT_BOOTSLEATHER, "pair of leather boots", "A stout pair of leather boots.", MT_LEATHER, 4, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + addot(OT_BOOTSMETAL, "pair of metal boots", "A strong pair of metal boots.", MT_METAL, 5, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_RARE, NULL); + addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + // armour - gloves + addot(OT_GLOVESCLOTH, "pair of cloth gloves", "A pair of soft cloth gloves.", MT_CLOTH, 0.15, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HANDS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 0, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addot(OT_GLOVESLEATHER, "pair of leather gloves", "A pair of coarse leather gloves.", MT_LEATHER, 0.25, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HANDS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addot(OT_GAUNTLETS, "pair of gauntlets", "A durable pair of metal gauntlets.", MT_METAL, 2, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HANDS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 10, 5, NULL); + addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + // armour - head + addot(OT_SUNHAT, "sun hat", "Wide-brimmed hat made for working in the sun.", MT_CLOTH, 1, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addot(OT_PIRATEHAT, "tricorne", "A three cornered hat with a skull and crossbones emblem.", MT_CLOTH, 1, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_SCARY, 2, NA, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addot(OT_CAP, "cap", "Close-fitting headwear with a short shade visor at the front.", MT_CLOTH, 1, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addot(OT_GASMASK, "gas mask", "A full face mask which protects the wearer from toxic gasses.", MT_METAL, 3.5, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACYMOD, -10, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_DTIMMUNE, DT_POISONGAS, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_VISRANGEMOD, -2, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addot(OT_HELM, "helmet", "A plain metal helmet.", MT_METAL, 2, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 3, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); + addot(OT_HELMFOOTBALL, "football helmet", "A metal helmet with a grill in front of the face.", MT_METAL, 1, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACYMOD, -10, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_VISRANGEMOD, -1, NA, NULL); + addot(OT_GOLDCROWN, "golden crown", "A heavy gold crown, encrusted with jewels.", MT_GOLD, 5, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 25, RR_RARE, NULL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); + addot(OT_HELMBONE, "bone helmet", "Scary-looking helmet made from the bones of an animal (?).", MT_BONE, 1, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); + addflag(lastot->flags, F_SCARY, 4, NA, NA, NULL); + + // armour - ears + addot(OT_EARPLUGS, "set of earplugs", "A pair of cloth plugs designed to give the wearer a peaceful night's sleep. ", MT_CLOTH, 0.01, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_EARS, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_DEAF, NA, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + + // armour - eyes + addot(OT_SUNGLASSES, "pair of sunglasses", "Tinted eyewear to protect against sunlight.", MT_GLASS, 0.01, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_EYES, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 0, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_VISRANGEMOD, -1, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_NIGHTVISRANGEMOD, -1, NA, NULL); + addflag(lastot->flags, F_TINTED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addot(OT_EYEPATCH, "eyepatch", "A small patch of black material which covers one eye. Scary looking.", MT_CLOTH, 0.01, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_GOESON, BP_EYES, NA, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SCARY, 2, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_VISRANGEMOD, -2, NA, NULL); + + + // armour - shields + addot(OT_BUCKLER, "buckler", "A small, unobtrusive wooden shield.", MT_WOOD, 3.00, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_SHIELD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_SECWEAPON, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_SHIELDPENALTY, 5, NA, NULL); + addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); + // similar to a buckler, but repairable, lighter, and less durable + addot(OT_SHIELDHIDE, "hide shield", "A small shield constructed out of animal skin.", MT_LEATHER, 2.00, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_SHIELD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_SECWEAPON, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_SHIELDPENALTY, 5, NA, NULL); + addflag(lastot->flags, F_OBHP, 18, 18, NA, NULL); + addot(OT_SHIELD, "shield", "A medium-sized metal shield.", MT_METAL, 4.00, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_SHIELD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_SECWEAPON, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_SHIELDPENALTY, 15, NA, NULL); + addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + addot(OT_SHIELDLARGE, "large shield", "A large (if somewhat cumbersome) shield.", MT_METAL, 6.00, OC_ARMOUR, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_SHIELD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_SECWEAPON, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_SHIELDPENALTY, 20, NA, NULL); + addflag(lastot->flags, F_OBHP, 40, 40, NA, NULL); + addot(OT_SHIELDTOWER, "tower shield", "An enormous but very cumbersome shield.", MT_METAL, 11.00, OC_ARMOUR, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_SHIELD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_SECWEAPON, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_SHIELDPENALTY, 30, NA, NULL); + addflag(lastot->flags, F_OBHP, 50, 50, NA, NULL); + + // rings + addot(OT_RING_SIGHT, "ring of sight", "Allows the caster to see the invisible, and in the dark.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_SEEINVIS, NA, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_SEEINDARK, 2, NA, NULL); + addflag(lastot->flags, F_EQUIPCONFER, F_VISRANGEMOD, 1, NA, NULL); + addot(OT_RING_MANA, "ring of mana", "Increases the wearer's MP pool.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_EXTRAMP, 10, NA, NULL); + addot(OT_RING_LUCK, "ring of luck", "Makes the wearer more lucky.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_EXTRALUCK, 5, NA, NULL); + addot(OT_RING_PROTFIRE, "ring of fire immunity", "Grants the caster complete immunity to fire.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_DTIMMUNE, DT_FIRE, NA, NULL); + addot(OT_RING_PROTCOLD, "ring of cold immunity", "Grants the caster complete immunity to cold.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_DTIMMUNE, DT_COLD, NA, NULL); + + addot(OT_RING_STR, "ring of strength", "Increases the wearer's strength.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_ATTRMOD, A_STR, 1, NULL); // '1' is randomized during generation + addflag(lastot->flags, F_IDWHENUSED, B_TRUE, NA, NA, NULL); + addot(OT_RING_IQ, "ring of intelligence", "Increases the wearer's intelligence.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_ATTRMOD, A_IQ, 1, NULL); // '1' is randomized during generation + addflag(lastot->flags, F_IDWHENUSED, B_TRUE, NA, NA, NULL); + addot(OT_RING_CON, "ring of fitness", "Increases the wearer's fitness.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_ATTRMOD, A_CON, 1, NULL); // '1' is randomized during generation + addflag(lastot->flags, F_IDWHENUSED, B_TRUE, NA, NA, NULL); + addot(OT_RING_DEX, "ring of dexterity", "Increases the wearer's dexterity.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_ATTRMOD, A_DEX, 1, NULL); // '1' is randomized during generation + addflag(lastot->flags, F_IDWHENUSED, B_TRUE, NA, NA, NULL); + + addot(OT_RING_HUNGER, "ring of hunger", "Greatly increases the metabolic rate of the wearer.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 73, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_FASTMETAB, 3, NA, NULL); + addflag(lastot->flags, F_STARTBLESSED, B_CURSED, NA, NA, NULL); + addot(OT_RING_WOUNDING, "ring of wounding", "Increases the damage output of the wearer.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 73, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_EXTRADAM, NA, NA, "0d0+4"); + addflag(lastot->flags, F_ENCHANTABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_IDWHENUSED, B_TRUE, NA, NA, NULL); + addot(OT_RING_INVIS, "ring of invisibility", "Renders the wearer invisible.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 60, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_INVISIBLE, NA, NA, NULL); + addot(OT_RING_INVULN, "ring of invulnerability", "Grants the caster complete immunity to physical harm.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_EQUIPCONFER, F_INVULNERABLE, NA, NA, NULL); + addot(OT_RING_MPREGEN, "ring of recharging", "Slowly regenerates the wearer's mana.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 50, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_MPREGEN, 1, NA, NULL); + addot(OT_RING_CONTROL, "ring of control", "Allows the wearer control over teleportation and polymorphic effects.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 50, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_CONTROL, NA, NA, NULL); + addot(OT_RING_REGENERATION, "ring of regeneration", "Slowly regenerates the wearer's health, even when not resting.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 50, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_REGENERATES, 1, NA, NULL); + addot(OT_RING_RESISTMAG, "ring of magic resistance", "Renders the wearer immune to most magical effects.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 50, NA, ""); + addflag(lastot->flags, F_EQUIPCONFER, F_RESISTMAG, 5, NA, NULL); + addot(OT_RING_MIRACLES, "ring of miracles", "Grants a limited number of miracles to the wearer.", MT_METAL, 0.1, OC_RING, SZ_MINI); + addflag(lastot->flags, F_RARITY, H_ALL, 40, NA, ""); + addflag(lastot->flags, F_CHARGES, 1, 3, NA, NULL); + + // unarmed weapons - note these damage/accuracys can be + // overridded with the lifeform flag F_HASATTACK + // + // DAMTYPE _cannot_ be overridden (yet)! + addot(OT_FISTS, "fists", "human fists", MT_FLESH, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_UNARMED, NA, NA, "1d2"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_UNARMED, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); + + // this one is for the pirate + addot(OT_HOOKHAND, "hook", "hook", MT_METAL, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d4"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_UNARMED, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ATTACKVERB, NA, 5, NA, "scratch"); + addflag(lastot->flags, F_ATTACKVERB, 6, 15, NA, "scrape"); + addflag(lastot->flags, F_ATTACKVERB, 16, NA, NA, "rake"); + + + addot(OT_TEETH, "teeth", "teeth object", MT_BONE, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_BITE, NA, NA, "1d2"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 3, NA, NA, NULL); + + addot(OT_CLAWS, "claws", "claws object", MT_BONE, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d2"); + addflag(lastot->flags, F_ATTACKVERB, NA, 5, NA, "scratch"); + addflag(lastot->flags, F_ATTACKVERB, 6, 15, NA, "claw"); + addflag(lastot->flags, F_ATTACKVERB, 16, 30, NA, "tear"); + addflag(lastot->flags, F_ATTACKVERB, 31, 40, NA, "rake"); + addflag(lastot->flags, F_ATTACKVERB, 41, 50, NA, "gouge"); + addflag(lastot->flags, F_ATTACKVERB, 51, NA, NA, "shred"); + addflag(lastot->flags, F_KILLVERB, 70, NA, NA, "disembowel"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_HOOF, "hooves", "hoof object", MT_BONE, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d2"); + addflag(lastot->flags, F_ATTACKVERB, NA, NA, NA, "kick"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_BUTT, "headbutt", "headbutt object", MT_BONE, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d2"); + addflag(lastot->flags, F_ATTACKVERB, NA, NA, NA, "butt"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_STING, "sting", "sting object", MT_BONE, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_ATTACKVERB, NA, NA, NA, "sting"); + addflag(lastot->flags, F_DAM, DT_ACID, NA, NA, "1d2"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + + addot(OT_TAIL, "tail", "tail object", MT_FLESH, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_ATTACKVERB, NA, NA, NA, "tailslap"); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d4"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_TENTACLE, "tentacle", "tentacle object", MT_FLESH, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "2d6"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_ZAPPER, "zapper", "zapper object", MT_NOTHING, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_ELECTRIC, NA, NA, "1d2"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + + // monster weapons + addot(OT_ACIDATTACK, "acidattack", "acid attack object", MT_WATER, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_DAM, DT_ACID, NA, NA, "1d2"); + addflag(lastot->flags, F_ACCURACY, 60, NA, NA, NULL); + addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addot(OT_TOUCHPARALYZE, "paralyzing touch", "paralyzing touch object", MT_BONE, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_ARMOURPIERCE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_DAM, DT_TOUCH, NA, NA, "1d1"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_HITCONFER, F_PARALYZED, SC_CON, 22, "2-4"); + addflag(lastot->flags, F_HITCONFERVALS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addot(OT_TOUCHPARALYZE2, "strong paralyzing touch", "strong paralyzing touch object", MT_BONE, 0, OC_WEAPON, SZ_TINY); + addflag(lastot->flags, F_ARMOURPIERCE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_DAM, DT_TOUCH, NA, NA, "1d1"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_HITCONFER, F_PARALYZED, SC_CON, 30, "5-10"); + addflag(lastot->flags, F_HITCONFERVALS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + + // missiles + addot(OT_DART, "dart", "A small, sharp projectile weapon.", MT_WOOD, 0.5, OC_MISSILE, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_MISSILEDAM, 2, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); + addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 15, NA, NULL); + + addot(OT_NANODART, "nanodart", "A metal dart with a laser-sharpened point.", MT_METAL, 0.5, OC_MISSILE, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_MISSILEDAM, 2, NA, NA, ""); + addflag(lastot->flags, F_ARMOURPIERCE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); + addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); + + addot(OT_NEEDLE, "needle", "A tiny pointed needle.", MT_METAL, 0.02, OC_MISSILE, SZ_TINY); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_MISSILEDAM, 1, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); + addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 25, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + + addot(OT_JAVELIN, "javelin", "A long, sharp missile weapon.", MT_METAL, 6, OC_MISSILE, SZ_MEDIUM); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_MISSILEDAM, 3, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 2, NA, ""); + addflag(lastot->flags, F_OBHP, 3, 3, NA, ""); + addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); + + addot(OT_ARROW, "arrow", "A sharp wooden arrow.", MT_WOOD, 0.25, OC_MISSILE, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 15, NA, NULL); + + addot(OT_BOLT, "bolt", "A sharp metal spike, meant for firing from a crossbow.", MT_METAL, 0.5, OC_MISSILE, SZ_SMALL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); + addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 20, NA, NULL); + + + addot(OT_BULLET, "bullet", "A regular gun bullet.", MT_METAL, 0.1, OC_MISSILE, SZ_MINI); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 10, NA, NULL); + + addot(OT_RUBBERBULLET, "rubber bullet", "A rubber gun bullet - does not do much damage.", MT_RUBBER, 0.05, OC_MISSILE, SZ_MINI); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 1, 1, NA, NULL); + addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); + + + // axes + addot(OT_AXE, "axe", "A short pole with a heavy, wedge-shaped blade for chopping.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_DAM, DT_CHOP, NA, NA, "1d6"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addot(OT_BATTLEAXE, "battleaxe", "An large axe specifically designed for combat.", MT_METAL, 8, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_DAM, DT_CHOP, NA, NA, "1d8+1"); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addot(OT_GREATAXE, "greataxe", "An enormous axe made designed for combat.", MT_METAL, 10, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_CHOP, NA, NA, "1d9+1"); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 16, NA, NULL); + addot(OT_HANDAXE, "hand axe", "A fast one-handed axe, ideal for throwing.", MT_METAL, 2.5, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_DAM, DT_CHOP, NA, NA, "1d7"); + addflag(lastot->flags, F_ACCURACY, 85, NA, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 7, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addot(OT_WARAXE, "war axe", "An axe made for combat.", MT_METAL, 7, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_DAM, DT_CHOP, NA, NA, "1d7+1"); + addflag(lastot->flags, F_ACCURACY, 85, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 11, NA, NULL); + + // short blades + addot(OT_COMBATKNIFE, "combat knife", "A sharp knife designed for military use.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d4+1"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_PICKLOCKS, 7, B_BLUNTONFAIL, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); + addot(OT_DAGGER, "dagger", "A short stabbing weapon with a pointed blade.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d4"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_PICKLOCKS, 7, B_BLUNTONFAIL, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); + addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 10, NA, NULL); + addot(OT_KNIFE, "knife", "A moderately sharp stabbing tool.", MT_METAL, 0.5, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d3"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_PICKLOCKS, 7, B_BLUNTONFAIL, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addot(OT_ORNDAGGER, "ornamental dagger", "This dagger is pretty, but not particularly effective.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_SHINY, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d3"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_PICKLOCKS, 7, B_BLUNTONFAIL, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addot(OT_QUICKBLADE, "quickblade", "A short blade of exceptional quality, which somehow allows its bearer to attack faster.", MT_METAL, 3.0, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d4"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); + addot(OT_RAPIER, "rapier", "A long, narrow French sword lacking a cutting edge. Made for stabbing.", MT_METAL, 3.5, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d8"); + addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 6, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 3, NA, NA, NULL); + addot(OT_SAI, "sai", "A dagger with two long prongs on either side, made to trap opponents' weapons.", MT_METAL, 1.5, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 81, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d4"); + addflag(lastot->flags, F_DISARMATTACK, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 10, NA, NULL); + addot(OT_SHORTSWORD, "short sword", "A short blade for fighting. Better for stabbing.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d6"); + addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 6, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 5, NA, NULL); + addot(OT_SICKLE, "sickle", "A hand-held agricultural tool with a curved blade.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d6"); + addflag(lastot->flags, F_ACCURACY, 60, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); + addot(OT_STEAKKNIFE, "steak knife", "A common kitchen knife.", MT_METAL, 0.2, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d2"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + + // long blades + addot(OT_FALCHION, "falchion", "A single-edged heavy sword made for chopping.", MT_METAL, 6.5, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 61, NA, NULL); + addflag(lastot->flags, F_DAM, DT_CHOP, NA, NA, "1d8+3"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addot(OT_GREATSWORD, "greatsword", "A massive two-handed sword.", MT_METAL, 10, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 55, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d12+6"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 7, NA, NA, NULL); + addot(OT_LONGSWORD, "longsword", "Standard issue long slashing weapon.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d8"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 10, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 5, NA, NULL); + addot(OT_ORNSWORD, "ornamental sword", "A gleaming (but quite blunt) blade.", MT_METAL, 6, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_SHINY, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d6"); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); + addot(OT_SCIMITAR, "scimitar", "A fast, sharp, curved blade.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 90, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d7"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 8, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 7, NA, NA, NULL); + addot(OT_CUTLASS, "cutlass", "An accurate, light-weight pirate blade.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d7"); + addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 8, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + // polearms + addot(OT_GLAIVE, "glaive", "A single-edged blade attached to a long pole.", MT_METAL, 10, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d7+3"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); + addot(OT_GUISARME, "guisarme", "A hooked polearm, made by attaching a hook to a spear shaft.", MT_METAL, 10, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); + addflag(lastot->flags, F_TRIPATTACK, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 130, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "2d4"); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); + addot(OT_HALBERD, "halberd", "A spiked axe blade mounted on a long shaft, with a hook on the back.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 71, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 130, NA, NA, NULL); + addflag(lastot->flags, F_TRIPATTACK, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_CHOP, NA, NA, "1d9+2"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 9, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); + addot(OT_LANCE, "lance", "A pole weapon designed for use while mounted.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 140, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d8+2"); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); + addot(OT_RANSEUR, "ranseur", "A long spear and cross hilt, resembling a pole-mounted sai. Good for disarming.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); + addflag(lastot->flags, F_DISARMATTACK, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 120, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "2d4"); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 9, NA, NULL); + addot(OT_SCYTHE, "scythe", "An agricultural hand tool for mowing grass, or reaping crops.", MT_METAL, 6, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "2d4"); + addflag(lastot->flags, F_ACCURACY, 65, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addot(OT_SPEAR, "spear", "A long pole with a sharpened head.", MT_METAL, 9, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 140, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d8"); + addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); + addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 7, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); + addot(OT_TRIDENT, "trident", "A three-pronged stabbing weapon.", MT_METAL, 5, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d10"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 7, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + // staves + addot(OT_QUARTERSTAFF, "quarterstaff", "A long, stout pole.", MT_WOOD, 4, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d8"); + addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 7, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_BAMBOOSTAFF, "bamboo staff", "A long hard pole made from bamboo.", MT_WOOD, 3, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "2d4"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 6, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_BLADEDSTAFF, "bladed staff", "A long wooden pole with blades on either end.", MT_WOOD, 5, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "2d4+3"); + addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 7, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 9, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_IRONSTAFF, "iron staff", "A long, stout metal pole.", MT_METAL, 8, OC_WEAPON, SZ_HUMAN); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "3d4+1"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 8, NA, NA, NULL); + + + // clubs (bashing) + addot(OT_CLUB, "club", "A heavy, blunt wooden instrument to hit things with.", MT_WOOD, 8, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d6"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 7, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addot(OT_FLAIL, "flail", "A flexible chain attached to a heavy weight.", MT_METAL, 9, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "2d4"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addot(OT_FLAILHEAVY, "heavy flail", "A flexible chain attached to a very heavy weight.", MT_METAL, 12, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 115, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "2d6"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 8, NA, NA, NULL); + addot(OT_GREATCLUB, "great club", "An enormous, very heavy, blunt instrument to hit things with.", MT_STONE, 15, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 180, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d10+5"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 16, NA, NULL); + addot(OT_MACE, "mace", "A weapon with a heavy head on a solid shaft used to bludgeon opponents.", MT_METAL, 10, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d7+1"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 7, NA, NA, NULL); + addot(OT_MORNINGSTAR, "morningstar", "A heavy, spiked mace.", MT_METAL, 12, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d9+3"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 8, NA, NA, NULL); + addot(OT_NUNCHAKU, "nunchaku", "Two stout sticks connected with a short or rope. Good for disarming.", MT_WOOD, 4.5, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_DISARMATTACK, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d6+1"); + addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_DEX, 10, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 3, NA, NA, NULL); + addot(OT_SPANNER, "spanner", "A long, heavy metal wrench.", MT_METAL, 1, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d4"); + addflag(lastot->flags, F_ACCURACY, 65, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERNEEDDIR, B_TRUE, NA, NA, "Use your spanner in which direction"); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addot(OT_STICK, "stick", "A sturdy wooden stick.", MT_WOOD, 0.5, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d2"); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + + // projectile weapons + addot(OT_BOW, "short bow", "A weapon which projects arrows via its elasticity.", MT_WOOD, 5, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FIRESPEED, 8, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 5, NA, NA, NULL); + addflag(lastot->flags, F_AMMOOB, OT_ARROW, NA, NA, NULL); + addflag(lastot->flags, F_AMMOCAPACITY, 1, NA, NA, NULL); + addflag(lastot->flags, F_FIRETURNS, 1, NA, NA, NULL); + addflag(lastot->flags, F_RELOADTURNS, 1, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 9, NA, NULL); + addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); + + addot(OT_CROSSBOW, "crossbow", "A standard crossbow. Very powerful, but needs high strength to use.", MT_WOOD, 8, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FIRESPEED, 12, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 10, NA, NA, NULL); + addflag(lastot->flags, F_AMMOOB, OT_BOLT, NA, NA, NULL); + addflag(lastot->flags, F_AMMOCAPACITY, 1, NA, NA, NULL); + addflag(lastot->flags, F_FIRETURNS, 2, NA, NA, NULL); + addflag(lastot->flags, F_RELOADTURNS, 2, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + + addot(OT_CROSSBOWHAND, "hand crossbow", "A small one-handed crossbow. Lightweight, but less powerful than a full-sized one.", MT_WOOD, 3, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FIRESPEED, 6, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 10, NA, NA, NULL); + addflag(lastot->flags, F_AMMOOB, OT_BOLT, NA, NA, NULL); + addflag(lastot->flags, F_AMMOCAPACITY, 1, NA, NA, NULL); + addflag(lastot->flags, F_FIRETURNS, 1, NA, NA, NULL); + addflag(lastot->flags, F_RELOADTURNS, 1, NA, NA, NULL); + + addot(OT_LONGBOW, "longbow", "A very large (human-sized) bow, capable of firing arrows with great power.", MT_WOOD, 7, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FIRESPEED, 12, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 10, NA, NA, NULL); + addflag(lastot->flags, F_AMMOOB, OT_ARROW, NA, NA, NULL); + addflag(lastot->flags, F_AMMOCAPACITY, 1, NA, NA, NULL); + addflag(lastot->flags, F_FIRETURNS, 1, NA, NA, NULL); + addflag(lastot->flags, F_RELOADTURNS, 1, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); + + addot(OT_REVOLVER, "revolver", "Basic one-handed firearm.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + //addflag(lastot->flags, F_DAMTYPE, DT_BASH, NA, NA, NULL); + //addflag(lastot->flags, F_DAM, 3, 4, NA, NULL); + addflag(lastot->flags, F_FIRESPEED, 20, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 10, NA, NA, NULL); + addflag(lastot->flags, F_AMMOOB, OT_BULLET, NA, NA, NULL); + addflag(lastot->flags, F_AMMOOB, OT_RUBBERBULLET, NA, NA, NULL); + addflag(lastot->flags, F_AMMOCAPACITY, 6, NA, NA, NULL); + addflag(lastot->flags, F_FIRETURNS, 1, NA, NA, NULL); + addflag(lastot->flags, F_RELOADTURNS, 2, NA, NA, NULL); + + addot(OT_SHOTGUN, "shotgun", "Powerful but short-ranged gun.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FIRESPEED, 30, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 3, NA, NA, NULL); + addflag(lastot->flags, F_AMMOOB, OT_BULLET, NA, NA, NULL); + addflag(lastot->flags, F_AMMOCAPACITY, 2, NA, NA, NULL); + addflag(lastot->flags, F_FIRETURNS, 1, NA, NA, NULL); + addflag(lastot->flags, F_RELOADTURNS, 3, NA, NA, NULL); + + addot(OT_SLING, "sling", "Stretchy piece of rubber for launching projectiles.", MT_RUBBER, 0.5, OC_WEAPON, SZ_SMALL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_FIRESPEED, 6, NA, NA, NULL); + addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); + addflag(lastot->flags, F_RANGE, 5, NA, NA, NULL); + addflag(lastot->flags, F_AMMOOB, OT_STONE, NA, NA, NULL); + addflag(lastot->flags, F_AMMOCAPACITY, 1, NA, NA, NULL); + addflag(lastot->flags, F_FIRETURNS, 1, NA, NA, NULL); + addflag(lastot->flags, F_RELOADTURNS, 1, NA, NA, NULL); + + + // special weapons + addot(OT_ENERGYBLADE, "energy blade", "A summoned weapon made of pure magical energy.", MT_MAGIC, 0, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_DAM, DT_MAGIC, NA, NA, "1d4"); // will be replaced when summoned + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + + addot(OT_HANDOFGOD, "hand of god", "The ultimate power.", MT_FLESH, 0.1, OC_WEAPON, SZ_MEDIUM); + //addflag(lastot->flags, F_RARITY, H_DUNGEON, RR_UNIQUE, NA, NULL); + //addflag(lastot->flags, F_DAMTYPE, DT_HOLY, NA, NA, NULL); + addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d6+100"); + addflag(lastot->flags, F_ACCURACY, 500, NA, NA, NULL); + addflag(lastot->flags, F_UNIQUE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); + + addot(OT_ICESHIELD, "ice crystal shield", "A summoned shield made of ice crystals.", MT_ICE, 0, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_SHIELD, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_GOESON, BP_SECWEAPON, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); // will be replaced when summoned + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); // will be replaced when summoned + + addot(OT_ICEARMOUR, "ice crystal armour", "Summoned body armour made of ice crystals.", MT_ICE, 0, OC_ARMOUR, SZ_HUMAN); + addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 5, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); // will be replaced when summoned + addot(OT_ICEBOOTS, "pair of ice crystal boots", "Summoned boots made of ice crystals.", MT_ICE, 0, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 5, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); // will be replaced when summoned + addot(OT_ICEGLOVES, "pair of ice crystal gauntlets", "Summoned gauntlets made of ice crystals.", MT_ICE, 0, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_GOESON, BP_HANDS, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 5, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); // will be replaced when summoned + addot(OT_ICEHELMET, "ice crystal helmet", "A summoned helmet made of ice crystals.", MT_ICE, 0, OC_ARMOUR, SZ_SMALL); + addflag(lastot->flags, F_GOESON, BP_HEAD, NA, NA, NULL); + addflag(lastot->flags, F_ARMOURRATING, 5, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); // will be replaced when summoned + + // special obs + addot(OT_PLAYERSTART, "playerstart", "starting pos for player", MT_NOTHING, 0, OC_MISC, SZ_MINI); +} + +void initrace(void) { + race_t *r; + flag_t *f; + objecttype_t *ot; + // race classes + addraceclass(RC_OTHER, "strange creature", "strange creatures", SK_NONE); + addraceclass(RC_ANIMAL, "animal", "animals and insects", SK_LORE_NATURE); + addraceclass(RC_AQUATIC, "aquatic creature", "aquatic creatures", SK_LORE_NATURE); + addraceclass(RC_DEMON, "demon", "demons", SK_LORE_DEMONS); + addraceclass(RC_GOD, "god", "dieties", SK_NONE); + addraceclass(RC_HUMANOID, "humanoid", "humanoid creatures", SK_LORE_HUMANOID); + addraceclass(RC_INSECT, "insect", "insects and animals", SK_LORE_NATURE); + addraceclass(RC_MAGIC, "magical creature", "magical creatures", SK_LORE_ARCANA); + addraceclass(RC_PLANT, "plant", "plants", SK_LORE_NATURE); + addraceclass(RC_SLIME, "slime", "slimes", SK_NONE); + addraceclass(RC_UNDEAD, "undead", "the undead", SK_LORE_UNDEAD); + + // unique monsters + addrace(R_JAILER, "jailer", 110, '@', C_MAGENTA, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_NAME, NA, NA, NA, "Jimbo"); + addflag(lastrace->flags, F_UNIQUE, NA, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+20"); + //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, NA, NA, "1d4"); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "11-13"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STAYINROOM, NA, NA, NA, NULL); // stay in our maze + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "50-100 gold coins"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "+2 halberd"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "great armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "good armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "good armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "dungeon exit orb"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "concealing powder"); + addflag(lastrace->flags, F_FLEEONHPPCT, 40, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_POLEARMS, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_ARMOUR, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HEAVYBLOW, 2, 2, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HURRICANESTRIKE, 2, 2, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_RAGE, 20, 20, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + + // races / monsters + // playable races + addrace(R_HUMAN, "human", 75, '@', C_GREY, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_RANDOM, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+2"); + 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, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTJOB, 75, J_RANDOM, 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_FLEEONHPPCT, 50, NA, NA, NULL); + + addrace(R_AVIAD, "aviad", 60, 'h', C_WHITE, MT_FLESH, RC_HUMANOID); + // stats + addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_RANDOM, NA, NULL); + // bonuses + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_CANWILL, OT_S_FLIGHT, NA, NA, "pw:1;"); + // penalties + addflag(lastrace->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_ELECTRIC, NA, NA, NULL); + // other special stuff + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "screechs^a screech"); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTJOB, 75, J_RANDOM, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); + + addrace(R_CYBORG, "cyborg", 150, 'R', C_GREY, MT_METAL, RC_HUMANOID); + // stats + addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_VLOW, NA, NULL); + // bonuses + addflag(lastrace->flags, F_EXTRAINFO, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_TECHUSAGE, PR_ADEPT, NA, NULL); + // penalties + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_WATER, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_ELECTRIC, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + // other special stuff + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "puddle of oil"); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); + 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, NA, NA, "1d4"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "bleeps^a bleep"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + + addrace(R_DWARF, "dwarf", 60, 'h', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTJOB, 75, J_RANDOM, 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_FLEEONHPPCT, 50, NA, NA, NULL); + + addrace(R_ELF, "elf", 60, '@', C_GREEN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 2, NA, NA, NULL); + addflag(lastrace->flags, F_MEDITATES, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "1-50 gold coins"); + addflag(lastrace->flags, F_STARTOBCLASS, 65, OC_WEAPON, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 65, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 65, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 65, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_SCROLL, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_SCROLL, NA, NULL); + addflag(lastrace->flags, F_STARTJOB, 75, J_RANDOM, 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_FLEEONHPPCT, 50, NA, NA, NULL); + + // human monsters... + addrace(R_BANDITLDR, "bandit leader", 75, '@', C_GREY, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_DEMANDSBRIBE, NA, 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_HITDICE, NA, NA, NA, "2d4+2"); + 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, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "1-100 gold coins"); + addflag(lastrace->flags, F_STARTOBCLASS, 100, OC_WEAPON, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 100, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 100, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_SCROLL, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, B_COVETS, 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_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MINIONS, 100, 1, 3, "bandit"); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addrace(R_BANDIT, "bandit", 75, '@', C_GREY, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, 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_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, 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, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "1-100 gold coins"); + addflag(lastrace->flags, F_STARTOBCLASS, 100, OC_WEAPON, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 100, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 15, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 15, OC_SCROLL, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, B_COVETS, 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_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOJOBTEXT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTJOB, 15, J_WIZARD, NA, NULL); + addflag(lastrace->flags, F_STARTJOB, 50, J_ROGUE, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + addrace(R_BEGGAR, "beggar", 50, '@', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_RARITY, H_VILLAGE, 80, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 70, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+2"); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-2 gold coins"); + addflag(lastrace->flags, F_STARTOB, 25, OC_POTION, NA, "potion of rum"); + addflag(lastrace->flags, F_STARTSKILL, SK_THIEVERY, PR_BEGINNER, NA, NULL); + addflag(lastrace->flags, F_RANDOMTALKPCT, 30, NA, NA, NULL); + addflag(lastrace->flags, F_RANDOMTALK, SP_BEG, SV_WHISPER, SV_TALK, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addrace(R_DRUNK, "drunkard", 90, '@', C_GREY, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_RARITY, H_VILLAGE, 90, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+2"); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "1-50 gold coins"); + addflag(lastrace->flags, F_STARTOB, 100, OC_POTION, NA, "1-5 potions of rum"); + addflag(lastrace->flags, F_STARTOB, 70, OC_POTION, NA, "1-5 empty flasks"); + addflag(lastrace->flags, F_STARTOB, 60, OC_POTION, NA, "1-2 gold coins"); + addflag(lastrace->flags, F_STARTJOB, 50, J_RANDOM, NA, NULL); // often unemployed + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts drunkenly^a drunken shout"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RANDOMTALKPCT, 30, NA, NA, NULL); + addflag(lastrace->flags, F_RANDOMTALK, SP_DRUNK, SV_WHISPER, SV_SHOUT, NULL); + f = addflag(lastrace->flags, F_DRUNK, 5, NA, NA, NULL); + addcondition(f, FC_NOCONDITION, 30); + addaltval(f, F_DRUNK, 3, NA, NA, NULL); + + addrace(R_PRISONER, "prisoner", 60, '@', C_GREY, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-2 stones"); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERARM, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_ISPRISONER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HIREPRICE, 0, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + + addrace(R_TOWNGUARD, "town guard", 100, '@', C_GREY, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "12-18"); + addflag(lastrace->flags, F_STARTASLEEPPCT, 0, NA, NA, NULL); + addflag(lastrace->flags, F_STAYINHABITAT, NA, NA, NA, NULL); + addflag(lastrace->flags, F_GUARD, NA, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_VILLAGE, 80, NA, NULL); + addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+4"); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, 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, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "good weapon"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "scale armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "good armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "good armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "good armour"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "bow"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-10 arrows"); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERARM, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL); + + // gods - kep sorted alphabetically + addrace(R_GODPURITY, "Amberon", 90, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD); + addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "20"); + addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_WIS, NA, NA, "18"); + addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "16"); + addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "16"); + addflag(lastrace->flags, F_STARTATT, A_CHA, NA, NA, "16"); + addflag(lastrace->flags, F_STARTASLEEPPCT, 0, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "50d4"); + addflag(lastrace->flags, F_UNIQUE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed +3 flaming longsword"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "10 blessed potions of water"); + //addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_RARITY, NA, NA, NULL); // ie. everything + addflag(lastrace->flags, F_STARTSKILL, SK_SS_LIFE, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_FIRSTAID, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "gestures imperiously"); + // god abilities + addflag(lastrace->flags, F_GODOF, NA, NA, NA, "Purity"); + addflag(lastrace->flags, F_FLEEONHPPCT, 10, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_LIGHT, NA, NA, "pw:10;"); + // may cast all life spells + for (ot = objecttype ; ot ; ot = ot->next) { + if ((ot->obclass->id == OC_SPELL) && (getspellschool(ot->id) == SS_LIFE)) { + addflag(lastrace->flags, F_CANWILL, ot->id, NA, NA, "pw:10;"); + } + } + + addflag(lastrace->flags, F_CANWILL, OT_S_WISHLIMITED, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_PLANESHIFT, NA, NA, "pw:1;"); + // likes/dislikes + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "destroying the undead"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "killing evil creatures"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "blessing objects"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "acts of charity"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "casting holy spells"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "sacrificing cursed objects through prayer"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "attacking good, peaceful or helpless creatures"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "the use of poison"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "cursing objects"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "eating pets"); + + + addrace(R_GODTHIEVES, "Felix", 300, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD); + addflag(lastrace->flags, F_ALIGNMENT, AL_NEUTRAL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "20"); + addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_WIS, NA, NA, "9"); + addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "8"); + addflag(lastrace->flags, F_STARTATT, A_CHA, NA, NA, "6"); + addflag(lastrace->flags, F_STARTASLEEPPCT, 0, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "30d4"); + addflag(lastrace->flags, F_UNIQUE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "+5 dagger of sharpness"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed ring of hunger"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "10 huge bags of holding"); + //addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_RARITY, NA, NA, NULL); // ie. everything + addflag(lastrace->flags, F_STARTSKILL, SK_THIEVERY, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_STEALTH, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_BACKSTAB, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_THROWING, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_CLIMBING, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "waves his hand"); + // god abilities + addflag(lastrace->flags, F_GODOF, NA, NA, NA, "Thieves"); + addflag(lastrace->flags, F_FLEEONHPPCT, 10, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HIDE, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_CALLWIND, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_CONFISCATE, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_WISHLIMITED, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_HUNGER, NA, NA, "pw:1;"); + addflag(lastrace->flags, F_CANWILL, OT_S_PLANESHIFT, NA, NA, "pw:1;"); + // likes/dislikes + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "backstabbing"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "stealing items"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "lockpicking"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "purchasing items"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "giving away or discarding money"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "opening locked objects through force"); + // sacrifices + addflag(lastrace->flags, F_SACRIFICEOBCLASS, OC_MONEY, NA, 2, "OB IS consumed in a swirl of shadowy blackness"); + + + addrace(R_GODDEATH, "Hecta", 100, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "16"); + addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "20"); + addflag(lastrace->flags, F_STARTATT, A_WIS, NA, NA, "15"); + addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "18"); + addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "6"); + addflag(lastrace->flags, F_STARTATT, A_CHA, NA, NA, "6"); + addflag(lastrace->flags, F_STARTASLEEPPCT, 0, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "30d4"); + addflag(lastrace->flags, F_UNIQUE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "2d6"); + addflag(lastrace->flags, F_HASATTACK, OT_TOUCHPARALYZE2, NA, NA, "1d6"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "cloak of shadows"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "bone helmet"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "10-20 bones"); + //addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_DEATH, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "extends a skeletal finger"); + // god abilities + addflag(lastrace->flags, F_GODOF, NA, NA, NA, "Death"); + addflag(lastrace->flags, F_FLEEONHPPCT, 10, NA, NA, NULL); + // may cast all death spells + for (ot = objecttype ; ot ; ot = ot->next) { + if ((ot->obclass->id == OC_SPELL) && (getspellschool(ot->id) == SS_DEATH)) { + addflag(lastrace->flags, F_CANWILL, ot->id, NA, NA, "pw:10;"); + } + } + addflag(lastrace->flags, F_CANWILL, OT_S_WISHLIMITED, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_PLANESHIFT, NA, NA, "pw:1;"); + // likes + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "killing (especially the good-aligned)"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "attacking the helpless"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "casting necromancy spells"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "cursing objects"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "allowing enemies to flee"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "magical healing"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "bestowing blessings"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "casting holy spells"); + // sacrifices + addflag(lastrace->flags, F_SACRIFICEOB, OT_CORPSE, NA, 2, "Bony claws rise up and drag OB underground."); + + addrace(R_GODMERCY, "Yumi", 300, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD); + addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); + addflag(lastrace->flags, F_FLEEONHPPCT, 95, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_WIS, NA, NA, "18"); + addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "17"); + addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_CHA, NA, NA, "17"); + addflag(lastrace->flags, F_STARTASLEEPPCT, 0, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "50d4"); + addflag(lastrace->flags, F_UNIQUE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "10 blessed vials of ambrosia"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "2 rings of regeneration"); + addflag(lastrace->flags, F_STARTSKILL, SK_FIRSTAID, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_MASTER, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "raises her hand"); + // god abilities + addflag(lastrace->flags, F_GODOF, B_FEMALE, NA, NA, "Mercy"); + addflag(lastrace->flags, F_FLEEONHPPCT, 10, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_CUREPOISON, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_HEALINGMAJ, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_WISHLIMITED, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_SATEHUNGER, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_DISPERSAL, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_SLEEP, NA, NA, "pw:10;"); + addflag(lastrace->flags, F_CANWILL, OT_S_PLANESHIFT, NA, NA, "pw:1;"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "the successful casting of healing spells"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "allowing fleeing creatures to escape"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "acts of charity"); + addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "natural healing"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "attacking the innocent"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "sneak attacks"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "the use of poison"); + addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "the destruction of healing potions"); + // sacrifices + addflag(lastrace->flags, F_SACRIFICEOBCLASS, OC_WEAPON, NA, 2, "OB IS destroyed in a flash of power."); + + + // monsters + addrace(R_BEHOLDER, "beholder", 5, 'e', C_MAGENTA, MT_FLESH, RC_MAGIC); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "12d4+4"); + addflag(lastrace->flags, F_ARMOURRATING, 8, NA, NA, NULL); + addflag(lastrace->flags, F_LEVITATING, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_CANWILL, OT_S_FIREDART, NA, NA, "pw:5;"); + addflag(lastrace->flags, F_CANWILL, OT_S_WEAKEN, NA, NA, "pw:2;"); + addflag(lastrace->flags, F_CANWILL, OT_S_SLEEP, NA, NA, "pw:2;"); + addflag(lastrace->flags, F_CANWILL, OT_S_SUCK, NA, NA, "pw:2;"); + addflag(lastrace->flags, F_CANWILL, OT_S_PARALYZE, NA, NA, "pw:2;"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "2d4"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "gazes"); + addflag(lastrace->flags, F_CASTTYPE, CT_GAZE, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, UNLIMITED, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_BUGBEAR, "bugbear", 120, 'G', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 63, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+5"); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "2d4+1"); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "heavy flail"); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "roars^a roar"); + addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "roars^a roar"); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HEAVYBLOW, 2, 2, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_MINIONS, 50, 1, 3, "goblin"); + addflag(lastrace->flags, F_MINIONS, 20, 1, 3, "goblin warrior"); + + addrace(R_COCKATRICE, "cockatrice", 5, 'c', C_YELLOW, MT_FLESH, RC_MAGIC); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "splash of cockatrice blood"); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "7d4+0"); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_ARMOURRATING, 8, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 2, NA, "^clucking."); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYSLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_PETRIFY, B_TRUE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d6+3"); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + // special attack handled in attack.c + + addrace(R_CREEPINGCLAW, "creeping claw", 3, 'x', C_YELLOW, MT_FLESH, RC_MAGIC); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 78, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_TINY, NA, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_EYES, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_BODY, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:1d6;"); + addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, NA, NA, "range:5;"); + + addrace(R_DARKMANTLE, "darkmantle", 70, 'U', C_BLUE, MT_FLESH, RC_MAGIC); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTHIDDENPCT, 80, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "9d4"); + addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, 15, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYSLOW, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLSPEED, SP_VERYSLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_VERYSLOW, NA, NA, ""); + addflag(lastrace->flags, F_CANWILL, OT_S_DARKNESS, 7, 7, "pw:3;"); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:0d0+5;"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "waves its tentacles"); + addflag(lastrace->flags, F_HASATTACK, OT_TENTACLE, NA, NA, "2d6"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_LIGHT, NA, NA, "0d6+5"); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + + addrace(R_EYEBAT, "eyebat", 5, 'e', C_BLUE, MT_FLESH, RC_MAGIC); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); + addflag(lastrace->flags, F_EVASION, 20, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLSPEED, SP_VERYSLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_MPDICE, 0, 25, NA, NULL); + addflag(lastrace->flags, F_MPREGEN, 12, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_DISPERSAL, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_GRAVBOOST, NA, NA, NULL); + addflag(lastrace->flags, F_CASTTYPE, CT_GAZE, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "gazes"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, UNLIMITED, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_FLY, 1, NA, "^flapping wings"); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_GIANTHILL, "hill giant", 160, 'H', C_GREY, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 55, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 55, 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_HITDICE, NA, NA, NA, "19d4"); + addflag(lastrace->flags, F_ARMOURRATING, 12, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, -20, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d5"); + addflag(lastrace->flags, F_STARTOB, 90, NA, NA, "25-100 gold coins"); + addflag(lastrace->flags, F_STARTOB, 70, NA, NA, "1-2 boulders"); + + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "great club"); + addcondition(f, FC_NOCONDITION, 70); + addaltval(f, F_STARTOB, 70, NA, NA, "club"); + + addflag(lastrace->flags, F_STARTOBCLASS, 65, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 65, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "bellows^a bellow"); + addflag(lastrace->flags, F_WANTS, OT_BOULDER, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HEAVYBLOW, NA, NA, NULL); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_GIANTFIRE, "fire giant", 160, 'H', C_RED, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 50, 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_HITDICE, NA, NA, NA, "21d4"); + addflag(lastrace->flags, F_ARMOURRATING, 13, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, -20, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d5+3"); + addflag(lastrace->flags, F_STARTOB, 90, NA, NA, "25-100 gold coins"); + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "flaming greatsword"); + addcondition(f, FC_NOCONDITION, 70); + addaltval(f, F_STARTOB, 100, NA, NA, "flaming longsword"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "javelin"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "javelin"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "javelin"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "javelin"); + addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "plate mail"); + addflag(lastrace->flags, F_STARTOBCLASS, 70, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "bellows^a bellow"); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_GIANTFIREFC, "fire giant forgecaller", 160, 'H', C_RED, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_GIANTFIRE; + 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_RARITY, H_DUNGEON, 48, 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_HITDICE, NA, NA, NA, "17d4"); + addflag(lastrace->flags, F_ARMOURRATING, 12, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, -20, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d5+3"); + addflag(lastrace->flags, F_STARTOB, 90, NA, NA, "25-100 gold coins"); + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "flaming morningstar"); + addcondition(f, FC_NOCONDITION, 70); + addaltval(f, F_STARTOB, 100, NA, NA, "flaming mace"); + addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "plate mail"); + addflag(lastrace->flags, F_STARTOBCLASS, 70, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "bellows^a bellow"); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); + addflag(lastrace->flags, F_MPDICE, 0, 9, NA, NULL); + addflag(lastrace->flags, F_MPREGEN, 1, NA, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_FIREDART, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_FLAMEPILLAR, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_FLAMEBURST, 4, 4, "pw:4;"); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_FIRE, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_GIANTFIRETITAN, "fire titan", 160, 'H', C_RED, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 40, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_ENORMOUS, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "49d4"); + addflag(lastrace->flags, F_ARMOURRATING, 20, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, -30, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d5+8"); + addflag(lastrace->flags, F_STARTOB, 90, NA, NA, "100-300 gold coins"); + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "flaming greatsword of pyromania"); + addcondition(f, FC_NOCONDITION, 65); + addaltval(f, F_STARTOB, 100, NA, NA, "flaming greatsword"); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "bellows^a bellow"); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 3, NA, "^crackling flames."); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); + addflag(lastrace->flags, F_HEAVYBLOW, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_BURNINGWAVE, 3, 3, "pw:6;"); + addflag(lastrace->flags, F_DTRESIST, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + // TODO: storm giant + // TODO: storm titan + + addrace(R_GNOLL, "gnoll", 130, 'h', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "gnoll corpse"); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 2, 3, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 72, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 72, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "8d4"); + addflag(lastrace->flags, F_ARMOURRATING, 9, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+4"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-40 gold coins"); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 2, NA, NA, NULL); + addflag(lastrace->flags, F_PACKATTACK, 3, NA, 2, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + + addrace(R_GNOLLHM, "gnoll huntmaster", 130, 'h', C_BROWN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_GNOLL; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "gnoll corpse"); + 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, 68, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 68, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "6d4"); + addflag(lastrace->flags, F_ARMOURRATING, 9, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, 0, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+4"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "longbow"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "10-20 arrows"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "hand axe"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-40 gold coins"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 2, NA, NA, NULL); + addflag(lastrace->flags, F_PACKATTACK, 3, NA, 2, NULL); + addflag(lastrace->flags, F_MINIONS, 75, 1, 2, "gnoll"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_GNOLLMR, "gnoll marauder", 130, 'h', C_BROWN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_GNOLL; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "gnoll corpse"); + 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, 65, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 65, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "10d4"); + addflag(lastrace->flags, F_ARMOURRATING, 9, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, 0, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4+2"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "spear"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "buckler"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 2, NA, NA, NULL); + addflag(lastrace->flags, F_QUICKBITE, 1, 6, 2, NULL); + addflag(lastrace->flags, F_PACKATTACK, 3, NA, 2, NULL); + addflag(lastrace->flags, F_MINIONS, 75, 1, 2, "gnoll"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + + addrace(R_GOBLIN, "goblin", 20, 'g', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_FEIGNDEATH, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 87, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 87, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-25 gold coins"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "short sword"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "sling"); + addflag(lastrace->flags, F_STARTOBCLASS, 40, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_DODGES, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_PACKATTACK, 2, DT_SLASH, 3, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTJOB, 25, J_ROGUE, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + + + addrace(R_GOBLINWAR, "goblin warrior", 30, 'g', C_BROWN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_GOBLIN; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "goblin corpse"); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+5"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4+2"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "spear"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "1-5 javelins"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-50 gold coins"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_DODGES, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_PACKATTACK, 2, DT_SLASH, 3, NULL); + addflag(lastrace->flags, F_MINIONS, 90, 1, 2, "goblin"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_GOBLINSHOOTER, "goblin sharpshooter", 20, 'g', C_BROWN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_GOBLIN; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "goblin corpse"); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 70, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+7"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "short sword"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "hand crossbow"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "1-15 bolts"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-25 gold coins"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); + addflag(lastrace->flags, F_DODGES, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_PACKATTACK, 2, DT_SLASH, 3, NULL); + addflag(lastrace->flags, F_MINIONS, 70, 1, 2, "goblin"); + addflag(lastrace->flags, F_CANWILL, OT_A_HIDE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTHIDDENPCT, 75, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_GOBLINHEXER, "goblin hexer", 20, 'g', C_BROWN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_GOBLIN; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "goblin corpse"); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 63, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 63, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "5d4+6"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "club"); + addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "leather armour"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); + addflag(lastrace->flags, F_DODGES, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_PACKATTACK, 2, DT_SLASH, 3, NULL); + addflag(lastrace->flags, F_MPDICE, 0, 10, NA, NULL); + addflag(lastrace->flags, F_MPREGEN, 3, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_BLINDNESS, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_PAIN, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MINIONS, 90, 1, 2, "goblin"); + + addrace(R_HOBGOBLIN, "hobgoblin", 90, 'g', C_GREEN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 73, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 2, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+3"); + addflag(lastrace->flags, F_ARMOURRATING, 8, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+2"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "longsword"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "buckler"); + addflag(lastrace->flags, F_STARTOBCLASS, 100, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-50 gold coins"); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 10, NA, NA, NULL); + addflag(lastrace->flags, F_PHALANX, 5, NA, 1, "hobgoblin"); + addflag(lastrace->flags, F_MINIONS, 50, 1, 2, "goblin"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_HOBGOBLINWAR, "hobgoblin warrior", 90, 'g', C_GREEN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_HOBGOBLIN; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 60, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 2, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+3"); + addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+4"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "flail"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-75 gold coins"); + addflag(lastrace->flags, F_STARTOB, 90, NA, NA, "large shield"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "scale armour"); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_ARMOUR, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 10, NA, NA, NULL); + addflag(lastrace->flags, F_PHALANX, 8, NA, 1, "hobgoblin"); + addflag(lastrace->flags, F_MINIONS, 50, 1, 4, "goblin"); + addflag(lastrace->flags, F_NOFLEE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + // TODO: hobgoblin archer + // TODO: hobgoblin warcaster + + addrace(R_KOBOLD, "kobold", 18, 'k', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 95, NA, NULL); + addflag(lastrace->flags, F_POISONOUS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_EVASION, 5, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTOBDT, 20, DT_PIERCE, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 25, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_THROWING, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-3 darts"); + addflag(lastrace->flags, F_STARTOB, 10, NA, NA, "javelin"); + addflag(lastrace->flags, F_STARTOB, 15, NA, NA, "buckler"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-10 gold coins"); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 2, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + + addrace(R_TROGLODYTE, "troglodyte", 20, 'z', C_GREY, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_POISONOUS, 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_RARITY, H_DUNGEON, 78, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_HASATTACK, OT_TAIL, NA, NA, "1d3"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "club"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "buckler"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-10 gold coins"); + addflag(lastrace->flags, F_DTVULN, DT_COLD, B_TRUE, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_FIRE, B_TRUE, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_STENCH, 3, 3, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + + addrace(R_LIZARDMAN, "lizardman", 100, 'z', C_GREEN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_COLDBLOOD, 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_RARITY, H_DUNGEON, 72, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 72, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "6d4"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d5+1"); + addflag(lastrace->flags, F_HASATTACK, OT_TAIL, NA, NA, "1d4"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-50 gold coins"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "spear"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-2 javelins"); + addflag(lastrace->flags, F_DTVULN, DT_COLD, B_TRUE, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_FIRE, B_TRUE, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "spits"); + addflag(lastrace->flags, F_CANWILL, OT_S_POISONBOLT, 5, 5, "pw:5;"); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + + addrace(R_MINOTAUR, "minotaur", 130, 'H', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_RARITY, H_DUNGEON, 62, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_HATESRACE, R_GNOLL, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "6d4+3"); + addflag(lastrace->flags, F_ARMOURRATING, 12, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STAYINROOM, NA, NA, NA, NULL); // stay in our maze + addflag(lastrace->flags, F_CARNIVORE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "5-7"); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_BUTT, NA, NA, "2d4+6"); + addflag(lastrace->flags, F_HASATTACK, OT_BUTT, NA, NA, "2d4+6"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "+2 heavy flail"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "greataxe"); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, NA, NA, "range:5;"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "roars^a roar"); + addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 20, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + + + addrace(R_OGRE, "ogre", 160, 'O', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 66, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "7d4+0"); + addflag(lastrace->flags, F_EVASION, -5, NA, NA, NULL); + addflag(lastrace->flags, F_ARMOURRATING, 11, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d4"); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d4"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VLOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "great club"); + addcondition(f, FC_NOCONDITION, 80); + addaltval(f, F_STARTOB, 100, NA, NA, "morningstar"); + addflag(lastrace->flags, F_STARTOB, 70, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-70 gold coins"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MINIONS, 50, 1, 5, "orc"); + addflag(lastrace->flags, F_MINIONS, 20, 1, 2, "orc warrior"); + addflag(lastrace->flags, F_MORALE, 20, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + + addrace(R_OGRESAVAGE, "ogre savage", 160, 'O', C_BROWN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_OGRE; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_RARITY, H_DUNGEON, 45, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 55, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "13d4+8"); + addflag(lastrace->flags, F_ARMOURRATING, 11, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "3d4"); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "3d4"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VLOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "blessed great club"); + addcondition(f, FC_NOCONDITION, 80); + addaltval(f, F_STARTOB, 100, NA, NA, "great club"); + addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-70 gold coins"); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 20, NA, NA, NULL); + addflag(lastrace->flags, F_MINIONS, 50, 1, 5, "orc"); + addflag(lastrace->flags, F_MINIONS, 50, 1, 3, "orc warrior"); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL); + + addrace(R_OGREWARHULK, "ogre warhulk", 160, 'O', C_BROWN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_OGRE; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_RARITY, H_DUNGEON, 45, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 50, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "35d4+0"); + addflag(lastrace->flags, F_ARMOURRATING, 11, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "4d4"); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "4d4"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VLOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "heavy flail"); + addcondition(f, FC_NOCONDITION, 80); + addaltval(f, F_STARTOB, 100, NA, NA, "great club"); + addflag(lastrace->flags, F_STARTOB, 70, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-100 gold coins"); + addflag(lastrace->flags, F_HEAVYBLOW, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_MINIONS, 25, 1, 8, "orc"); + addflag(lastrace->flags, F_MINIONS, 25, 1, 2, "orc warrior"); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + + addrace(R_ORC, "orc", 90, 'o', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_RARITY, H_DUNGEON, 78, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); + addflag(lastrace->flags, F_EVASION, 5, NA, NA, NULL); + addflag(lastrace->flags, F_ARMOURRATING, 5, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "club"); + addcondition(f, FC_NOCONDITION, 70); + addaltval(f, F_STARTOBDT, 50, DT_SLASH, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "bone helmet"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-50 gold coins"); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 2, NA, NA, NULL); + //addflag(lastrace->flags, F_STARTJOB, 20, J_WIZARD, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, 5, 5, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + + addrace(R_ORCWARRIOR, "orc warrior", 90, 'o', C_BROWN, MT_FLESH, RC_HUMANOID); + lastrace->baseid = R_ORC; + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+3"); + addflag(lastrace->flags, F_EVASION, 5, NA, NA, NULL); + addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "battleaxe"); + addcondition(f, FC_NOCONDITION, 70); + addaltval(f, F_STARTOBDT, 50, DT_CHOP, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); + addflag(lastrace->flags, F_STARTOB, 75, NA, NA, "buckler"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "bone helmet"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-50 gold coins"); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 2, NA, NA, NULL); + //addflag(lastrace->flags, F_STARTJOB, 20, J_WIZARD, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + + addrace(R_ORK, "ork", 90, 'o', C_BROWN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "orc corpse"); + 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, 81, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 81, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+3"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTOBDT, 100, DT_SLASH, NA, NULL); + addflag(lastrace->flags, F_STARTOBDT, 30, DT_BASH, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "flak jacket"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "leather boots"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "football helmet"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-25 gold coins"); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_POTION, NA, NULL); + addflag(lastrace->flags, F_STARTOBCLASS, 50, OC_TECH, 10, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_OPERABLE, B_COVETS, NA, NULL); // ie. tech + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + + addrace(R_PEGASUS, "pegasus", 130, 'Q', C_GREY, MT_FLESH, RC_MAGIC); + addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 57, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 57, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "6d4"); + addflag(lastrace->flags, F_HASATTACK, OT_HOOF, NA, NA, "1d8"); + addflag(lastrace->flags, F_HASATTACK, OT_HOOF, NA, NA, "1d8"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_MAXATTACKS, 3, 3, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, 2, 2, NULL); + addflag(lastrace->flags, F_SWOOPRANGE, 4, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 4, NA, "screams in pain^screams of pain"); + addflag(lastrace->flags, F_RESISTMAG, 5, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 25, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 3, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_POLTERGEIST, "poltergeist", 50, 'p', C_GREEN, MT_FLESH, RC_UNDEAD); // sPirit + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_MPDICE, 0, 4, NA, NULL); + addflag(lastrace->flags, F_MPREGEN, 4, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_TELEKINESIS, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "gestures"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, UNLIMITED, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_MENTAL, PR_EXPERT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_XPMULTIPLY, 2, NA, NA, NULL); + + addrace(R_SATYR, "satyr", 80, 'h', C_GREEN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_RARITY, H_DUNGEON, 72, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "5d4"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_BUTT, NA, NA, "2d4"); + addflag(lastrace->flags, F_STARTOBDT, 50, DT_SLASH, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "panpipes"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "bow"); + addflag(lastrace->flags, F_STARTOB, 75, NA, NA, "1-10 arrows"); + addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-30 gold coins"); + addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "plays its pipes"); + addflag(lastrace->flags, F_RESISTMAG, 10, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MPDICE, 0, 16, NA, NULL); + addflag(lastrace->flags, F_MPREGEN, 8, NA, NA, NULL); + addflag(lastrace->flags, F_NEEDOBFORSPELLS, OT_PANPIPES, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_CHARM, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_SLEEP, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_FEAR, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_MENTAL, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HIDE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTHIDDENPCT, 60, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + + addrace(R_SHADOWCAT, "shadowcat", 5, 'f', C_BLUE, MT_FLESH, RC_MAGIC); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+3"); + addflag(lastrace->flags, F_EVASION, 40, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "hisses^a hiss"); + addflag(lastrace->flags, F_SEEINDARK, 8, NA, NA, NULL); + addflag(lastrace->flags, F_CANSEETHROUGHMAT, MT_GAS, NA, NA, NULL); + addflag(lastrace->flags, F_AUTOCREATEOB, 1, NA, NA, "cloud of smoke"); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_OOZEGREY, "grey ooze", 10, 'j', C_GREY, MT_SLIME, RC_SLIME); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "pool of slime"); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "5d4+0"); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYSLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_EYES, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_ACIDATTACK, NA, NA, "1d6+5"); + addflag(lastrace->flags, F_TREMORSENSE, 5, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slurping"); + addflag(lastrace->flags, F_DTIMMUNE, DT_ACID, B_TRUE, NA, NULL); + addflag(lastrace->flags, F_AUTOCREATEOB, 0, NA, NA, "puddle of acid"); + addflag(lastrace->flags, F_DIESPLATTER, 3, NA, NA, "splash of acid"); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + + addrace(R_SPRITEFIRE, "fire sprite", 5, 'n', C_RED, MT_FIRE, RC_MAGIC); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "small fire"); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 70, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); + addflag(lastrace->flags, F_EVASION, 15, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_MPDICE, 0, 4, NA, NULL); + addflag(lastrace->flags, F_MPREGEN, 1, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_FIREDART, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "gestures"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_PRODUCESLIGHT, 2, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^crackling flames"); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_NOVICE, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_FIRE, PR_BEGINNER, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_SPRITEICE, "ice sprite", 5, 'n', C_WHITE, MT_ICE, RC_MAGIC); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "sheet of ice"); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 70, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); + addflag(lastrace->flags, F_EVASION, 15, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_MPDICE, 4, 2, NA, NULL); + addflag(lastrace->flags, F_MPREGEN, 1, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_FROSTBITE, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_FREEZEOB, NA, NA, NULL); + addflag(lastrace->flags, F_CANCAST, OT_S_ICICLE, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "gestures"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_DTIMMUNE, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SPELLCASTING, PR_NOVICE, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_SS_COLD, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + + addrace(R_TROLL, "troll", 100, 't', C_GREEN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 70, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+0"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "2d6"); + addflag(lastrace->flags, F_REGENERATES, 2, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_BEGINNER, NA, NULL); + + + addrace(R_XAT, "xat", 2, 'x', C_BROWN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 95, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ENHANCESMELL, 3, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + + // fish + addrace(R_CRAB, "giant crab", 250, ';', C_ORANGE, MT_FLESH, RC_AQUATIC); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); + addflag(lastrace->flags, F_ARMOURRATING, 20, NA, NA, NULL); // very high armour + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+4"); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYSLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_VERYSLOW, NA, NA, ""); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "2d4"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "2d4"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); + addrace(R_PIRANHA, "piranha", 0.5, ';', C_GREEN, MT_FLESH, RC_AQUATIC); + addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_TINY, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 95, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); + addflag(lastrace->flags, F_MOVESPEED, SP_FAST, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, NA, ""); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d2"); + addrace(R_PIRANHAKING, "king piranha", 1, ';', C_GREEN, MT_FLESH, RC_AQUATIC); + addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_TINY, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 78, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+2"); + addflag(lastrace->flags, F_MOVESPEED, SP_FAST, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, NA, ""); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d6"); + addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, NA, NA, "range:5;"); + addrace(R_EELELEC, "electric eel", 120, ';', C_CYAN, MT_FLESH, RC_AQUATIC); + addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+0"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_ZAPPER, NA, NA, "1d6"); + addflag(lastrace->flags, F_DTIMMUNE, DT_ELECTRIC, NA, NA, NULL); + addrace(R_EELGIANT, "giant eel", 150, ';', C_BLUE, MT_FLESH, RC_AQUATIC); + addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 68, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "5d4+0"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:2d6;"); + + // plants + addrace(R_CACTUS, "cactus", 30, 'F', C_YELLOW, MT_PLANT, RC_PLANT); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 76, NA, ""); + addflag(lastrace->flags, F_HARMLESS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_RETALIATE, 1, 4, DT_PIERCE, "sharp spines"); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "cactus fruit"); + addflag(lastrace->flags, F_DOESNTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_EYES, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addrace(R_DREAMFUNGUS, "dreamfungus", 0.5, 'F', C_MAGENTA, MT_METAL, RC_PLANT); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 70, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 70, NA, ""); + addflag(lastrace->flags, F_HARMLESS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "pile of sleeping powder"); + addflag(lastrace->flags, F_DOESNTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_EYES, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addrace(R_SAWGRASS, "sawgrass", 1, 'F', C_GREY, MT_METAL, RC_PLANT); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DOESNTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_EYES, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + // end plants + + // animals + addrace(R_BAT, "giant bat", 3, 'B', C_BROWN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 88, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 95, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYFAST, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "0d4+2"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d2"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_FLY, 1, NA, "^flapping wings"); + addrace(R_BATVAMPIRE, "vampire bat", 6, 'B', C_BLUE, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 76, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 84, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYFAST, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d2"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_MAXATTACKS, 2, 2, NA, NULL); + addflag(lastrace->flags, F_EVASION, -10, NA, NA, NULL); + addflag(lastrace->flags, F_VAMPIRIC, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_MATVULN, MT_SILVER, 200, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_FLY, 1, NA, "^flapping wings"); + addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addrace(R_BEAR, "black bear", 150, 'q', C_BLUE, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 63, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 73, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_STARTASLEEPPCT, 80, NA, NA, NULL); // hibernating + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+3"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d6"); + addflag(lastrace->flags, F_MAXATTACKS, 3, 3, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars"); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:2d4;"); + addflag(lastrace->flags, F_MINIONS, 25, 1, 2, "bear cub"); + addrace(R_BEARGRIZZLY, "grizzly bear", 200, 'q', C_YELLOW, MT_FLESH, RC_ANIMAL); + lastrace->baseid = R_BEAR; + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 52, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 62, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTASLEEPPCT, 80, NA, NA, NULL); // hibernating + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "5d4+5"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d8"); + addflag(lastrace->flags, F_MAXATTACKS, 3, 3, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars"); + addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:2d6;"); + addflag(lastrace->flags, F_CRITKNOCKDOWN, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_BLEEDABIL, OT_A_RAGE, NA, NA, NULL); + addflag(lastrace->flags, F_MINIONS, 25, 1, 2, "bear cub"); + addrace(R_BEARCUB, "bear cub", 60, 'q', C_BROWN, MT_FLESH, RC_ANIMAL); + lastrace->baseid = R_BEAR; + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 63, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 73, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+3"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_MAXATTACKS, 2, 2, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars"); + addflag(lastrace->flags, F_SEEINDARK, 4, NA, NA, NULL); + addflag(lastrace->flags, F_CRITKNOCKDOWN, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, ""); + addrace(R_ANT, "giant ant", 20, 'a', C_BROWN, MT_FLESH, RC_ANIMAL); + lastrace->baseid = R_ANT; + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 85, NA, ""); + addflag(lastrace->flags, F_ARMOURRATING, 4, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, ""); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "0d1+4"); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^scuttling"); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addrace(R_ANTS, "giant soldier ant", 25, 'a', C_BROWN, MT_FLESH, RC_ANIMAL); + lastrace->baseid = R_ANT; + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 65, NA, ""); + addflag(lastrace->flags, F_ARMOURRATING, 9, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+4"); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, ""); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "0d1+4"); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, "dam:1d8+3;"); + addflag(lastrace->flags, F_CANWILL, OT_A_STINGACID, NA, NA, "dam:1d6+3;needgrab:1;"); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^scuttling"); + addflag(lastrace->flags, F_MINIONS, 50, 1, 3, "giant worker ant"); + addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addrace(R_ANTLION, "giant antlion", 30, 'a', C_YELLOW, MT_FLESH, RC_ANIMAL); + lastrace->baseid = R_ANT; + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 60, NA, ""); + addflag(lastrace->flags, F_ARMOURRATING, 4, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "6d4+0"); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, ""); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "5d4"); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, "dam:2d4;"); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^scuttling"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "roars^a roars"); + addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addrace(R_CHICKEN, "chicken", 0.5, 'c', C_BROWN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_VILLAGE, 100, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "0d4+1"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + addflag(lastrace->flags, F_VEGETARIAN, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 1, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "squarks^squarking"); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^clucking."); + addrace(R_DOG, "dog", 35, 'd', C_BROWN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RNDHOSTILE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_VILLAGE, 100, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 82, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 6, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 2, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 6, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "barks^barking"); + addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "growls^growling"); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "whines in pain^whining"); + addflag(lastrace->flags, F_FLEEONHPPCT, 60, NA, NA, ""); + addrace(R_DOGBLINK, "blink dog", 35, 'd', C_BLUE, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 2, 4, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 77, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 77, NA, ""); + addflag(lastrace->flags, F_ENHANCESMELL, 6, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+3"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d6"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + addflag(lastrace->flags, F_VEGETARIAN, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 6, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, NULL); // don't announce spellcasting + addflag(lastrace->flags, F_CANWILL, OT_S_BLINK, 2, 2, "pw:1;"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "barks^barking"); + addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "growls^growling"); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "whines in pain^whining"); + addrace(R_DOGDEATH, "death hound", 40, 'd', C_MAGENTA, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 2, 6, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_FAST, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 60, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+1"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d10"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d10"); + addflag(lastrace->flags, F_MAXATTACKS, 2, 2, NA, NULL); + addflag(lastrace->flags, F_ARMOURRATING, 5, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 6, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "whines in pain^whining"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "howls^a howl"); + addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "growls^growling"); + addflag(lastrace->flags, F_HITCONFER, F_POISONED, SC_POISON, 24, "10-15"); + addflag(lastrace->flags, F_HITCONFERVALS, P_VENOM, 1, NA, NULL); + addflag(lastrace->flags, F_CRITKNOCKDOWN, B_TRUE, NA, NA, NULL); + addrace(R_DOGWAR, "war hound", 40, 'd', C_BROWN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 4, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_FAST, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 83, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 83, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+2"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "2d4"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); + addflag(lastrace->flags, F_EVASION, 5, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 6, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "barks^barking"); + addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 2, NA, "growls^growling"); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "whines in pain^whining"); + + addrace(R_HAWKYOUNG, "young hawk", 1, 'A', C_GREY, MT_FLESH, RC_ANIMAL); // 'A' for Avian + lastrace->baseid = R_HAWK; + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 75, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 85, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+4"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d2"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d2"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, 3, 3, NULL); + addflag(lastrace->flags, F_SWOOPRANGE, 2, NA, NA, NULL); + addflag(lastrace->flags, F_LEVRACE, 4, R_HAWK, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 3, NA, "screeches in pain^screeches of pain"); + + addrace(R_HAWK, "hawk", 1, 'A', C_GREY, MT_FLESH, RC_ANIMAL); // 'A' for Avian + lastrace->baseid = R_HAWK; + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 68, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 77, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+4"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, 3, 3, NULL); + addflag(lastrace->flags, F_SWOOPRANGE, 3, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 5, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 4, NA, NA, NULL); + addflag(lastrace->flags, F_LEVRACE, 8, R_HAWKBLOOD, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 3, NA, "screeches in pain^screeches of pain"); + + addrace(R_HAWKBLOOD, "blood hawk", 1, 'A', C_RED, MT_FLESH, RC_ANIMAL); // 'A' for Avian + lastrace->baseid = R_HAWK; + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 65, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 65, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+4"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3+3"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4+3"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, 3, 3, NULL); + addflag(lastrace->flags, F_SWOOPRANGE, 5, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 6, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 7, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 3, NA, "screeches in pain^screeches of pain"); + addrace(R_HAWKFROST, "frost hawk", 1, 'A', C_CYAN, MT_FLESH, RC_ANIMAL); // 'A' for Avian + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 63, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "10d4"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+5"); + addflag(lastrace->flags, F_EXTRADAM, DT_COLD, NA, NA, "1d6"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, 3, 3, NULL); + addflag(lastrace->flags, F_SWOOPRANGE, 8, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_COLDBURST, 2, 2, "pw:2;"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "screeches"); + addflag(lastrace->flags, F_MORALE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 3, NA, "screeches in pain^screeches of pain"); + addrace(R_LEECH, "giant leech", 10, 'j', C_MAGENTA, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 81, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 84, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+1"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, NA, NA, "range:4;"); + addflag(lastrace->flags, F_CANWILL, OT_A_SUCKBLOOD, NA, NA, "dam:0d1+4;"); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addrace(R_NEWT, "giant newt", 4, ':', C_BROWN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLEEONDAM, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_FIRE, B_TRUE, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addrace(R_PORCUPINE, "giant porcupine", 10, 'r', C_GREY, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HATESRACE, R_ANT, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+1"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RETALIATE, 1, 4, DT_PIERCE, "sharp spines"); + addflag(lastrace->flags, F_CORPSEFLAG, F_SHARP, 1, 4, NULL); + addrace(R_RAT, "giant rat", 3, 'r', C_BROWN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_FAST, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 95, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "0d4+1"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d2"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 4, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addrace(R_SNAKE, "brown snake", 3, 's', C_BROWN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 85, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 85, NA, ""); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4"); + addflag(lastrace->flags, F_HITCONFER, F_POISONED, SC_POISON, 20, "5-10"); + addflag(lastrace->flags, F_HITCONFERVALS, P_VENOM, 1, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addrace(R_SNAKECARPET, "carpet snake", 3, 's', C_GREY, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 88, NA, ""); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3+1"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addrace(R_SNAKETREE, "tree snake", 3, 's', C_GREEN, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, ""); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3+1"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^hissing"); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, 2, 2, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addrace(R_SNAKECOBRABLACK, "black cobra", 3, 's', C_BLUE, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 78, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 78, NA, ""); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3+1"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^hissing"); + addflag(lastrace->flags, F_CANWILL, OT_S_POISONBOLT, 4, 4, "pw:3;"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "spits"); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addrace(R_SNAKECOBRAGOLDEN, "golden cobra", 3, 's', C_YELLOW, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 76, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 79, NA, ""); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+2"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3+1"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^hissing"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "spits"); + addflag(lastrace->flags, F_CASTTYPE, CT_EYESPIT, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_BLINDNESS, 4, 4, "pw:3;range:2;"); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addrace(R_SNAKECONSTRICTOR, "constrictor", 3, 's', C_MAGENTA, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 68, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 68, NA, ""); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+3"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "0d1"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^hissing"); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:2d6;"); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addrace(R_SNAKEWATER, "water snake", 3, 's', C_BLUE, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 85, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 85, NA, ""); + addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_BREATHWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4+1"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addrace(R_SPIDER, "giant spider", 5, 'S', C_GREY, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 87, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 87, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+1"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, NULL); // don't announce spellcasting + addflag(lastrace->flags, F_CANWILL, OT_S_WEB, 3, 3, "pw:1;range:4;"); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_LIGHT, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, UNLIMITED, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_POISONOUS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOMEOB, NA, NA, NA, "web"); + addflag(lastrace->flags, F_HOMELEVOB, NA, NA, NA, "1-10 webs"); + addrace(R_SPIDERFUNNELWEB, "giant funnelweb", 5, 'S', C_MAGENTA, MT_FLESH, RC_ANIMAL); + lastrace->baseid = R_SPIDER; + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 63, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 63, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+1"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4"); + addflag(lastrace->flags, F_HITCONFER, F_POISONED, SC_POISON, 26, "10-20"); + addflag(lastrace->flags, F_HITCONFERVALS, P_VENOM, 3, NA, NULL); // strong! + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, NULL); // don't announce spellcasting + addflag(lastrace->flags, F_CANWILL, OT_S_WEB, 3, 3, "pw:5;range:2;"); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_LIGHT, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, UNLIMITED, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_POISONOUS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOMEOB, NA, NA, NA, "web"); + addflag(lastrace->flags, F_HOMELEVOB, NA, NA, NA, "20-30 webs"); + addrace(R_SPIDERREDBACK, "giant redback", 5, 'S', C_RED, MT_FLESH, RC_ANIMAL); + lastrace->baseid = R_SPIDER; + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 78, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 78, NA, ""); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+1"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4"); + addflag(lastrace->flags, F_HITCONFER, F_PAIN, SC_POISON, 26, "5-15"); + addflag(lastrace->flags, F_HITCONFERVALS, DT_POISON, NA, NA, "1d2"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, NULL); // don't announce spellcasting + addflag(lastrace->flags, F_CANWILL, OT_S_WEB, 3, 3, "pw:7;range:3;"); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_LIGHT, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, UNLIMITED, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_POISONOUS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOMEOB, NA, NA, NA, "web"); + addflag(lastrace->flags, F_HOMELEVOB, NA, NA, NA, "10-20 webs"); + addrace(R_WOLFYOUNG, "young wolf", 10, 'd', C_GREY, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 87, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 97, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+2"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CARNIVORE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 4, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, 8, 8, NULL); + addflag(lastrace->flags, F_LEVRACE, 5, R_WOLF, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "whines in pain^whining"); + addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "growls^growling"); + addflag(lastrace->flags, F_FLEEONHPPCT, 75, NA, NA, ""); + addrace(R_WOLF, "wolf", 25, 'd', C_GREY, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_FAST, NA, NA, ""); + addflag(lastrace->flags, F_ENHANCESMELL, 6, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 90, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+3"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d5"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d5"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CARNIVORE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, 5, 5, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "whines in pain^whining"); + addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "growls^growling"); + addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, ""); + + // insects + addrace(R_BUTTERFLY, "butterfly", 0.01, 'i', C_YELLOW, MT_FLESH, RC_ANIMAL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 100, NA, ""); + addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYFAST, NA, NA, ""); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_TINY, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "0d4+1"); + addflag(lastrace->flags, F_EVASION, 60, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addrace(R_GIANTFLY, "giant fly", 1, 'i', C_GREY, MT_FLESH, RC_INSECT); + lastrace->baseid = R_GIANTFLY; + addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 3, 3, NA, ""); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYFAST, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 85, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 85, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); + addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d2"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "buzzes angrily^an angry buzzing"); + addflag(lastrace->flags, F_NOISETEXT, N_FLY, 2, NA, "^buzzing"); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addrace(R_GIANTBLOWFLY, "giant blowfly", 2, 'i', C_WHITE, MT_FLESH, RC_INSECT); + lastrace->baseid = R_GIANTFLY; + addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "giant fly corpse"); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 2, NA, ""); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYFAST, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+1"); + addflag(lastrace->flags, F_EVASION, 5, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "buzzes angrily^an angry buzzing"); + addflag(lastrace->flags, F_NOISETEXT, N_FLY, 2, NA, "^buzzing"); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addrace(R_STIRGE, "stirge", 10, 'i', C_BROWN, MT_FLESH, RC_INSECT); + addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+1"); + addflag(lastrace->flags, F_ENHANCESMELL, 2, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "buzzes angrily^an angry buzzing"); + addflag(lastrace->flags, F_NOISETEXT, N_FLY, 2, NA, "^buzzing"); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SUCKBLOOD, NA, NA, "dam:1d4;"); + + addrace(R_CENTIPEDE, "giant centipede", 3, 'w', C_GREEN, MT_FLESH, RC_INSECT); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, ""); + addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d6"); + addflag(lastrace->flags, F_HITCONFER, F_POISONED, SC_POISON, 25, "10-15"); + addflag(lastrace->flags, F_HITCONFERVALS, P_WEAKNESS, 3, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^scuttling"); + addflag(lastrace->flags, F_TREMORSENSE, 3, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addrace(R_GLOWBUG, "glowbug", 1, 'i', C_WHITE, MT_FLESH, RC_INSECT); + addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_VERYFAST, NA, NA, ""); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 87, NA, ""); + addflag(lastrace->flags, F_RARITY, H_FOREST, 97, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); + addflag(lastrace->flags, F_EVASION, 60, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_ZAPPER, NA, NA, "1d2-1"); + addflag(lastrace->flags, F_CANWILL, OT_S_FLASH, 15, 15, "pw:4;"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "pulses"); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_PRODUCESLIGHT, 2, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_NOISETEXT, N_FLY, 2, NA, "^buzzing"); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + + // demons + addrace(R_DRETCH, "dretch", 30, '&', C_BROWN, MT_FLESH, RC_DEMON); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, 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_HITDICE, NA, NA, NA, "2d8+4"); + addflag(lastrace->flags, F_ARMOURRATING, 18, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+1"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4"); + addflag(lastrace->flags, F_SEEINDARK, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DETECTLIFE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_ACID, NA, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_COLD, NA, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_FEAR, 20, 20, "pw:1;"); + addflag(lastrace->flags, F_CANWILL, OT_S_CLOUDKILL, 20, 20, "pw:1;"); + addflag(lastrace->flags, F_CANWILL, OT_S_SUMMONDEMON, 20, 20, "pw:3;"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "narrows its eyes"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "roars^an other-wordly roar"); + + addrace(R_LURKINGHORROR, "lurking horror", 100, 'U', C_MAGENTA, MT_FLESH, RC_DEMON); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, 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_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+0"); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_EYES, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_INDUCEFEAR, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + + addrace(R_QUASIT, "quasit", 4, '&', C_BROWN, MT_FLESH, RC_DEMON); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d8"); + addflag(lastrace->flags, F_REGENERATES, 2, NA, NA, NULL); + addflag(lastrace->flags, F_ARMOURRATING, 18, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3-1"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4-1"); + addflag(lastrace->flags, F_HITCONFER, F_POISONED, SC_POISON, 28, "3-5"); + addflag(lastrace->flags, F_HITCONFERVALS, P_VENOM, 2, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_FIRE, NA, NA, NULL); + addflag(lastrace->flags, F_DETECTMAGIC, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTSKILL, SK_STEALTH, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_FEAR, 20, 20, "pw:1;"); + addflag(lastrace->flags, F_CANWILL, OT_S_INVISIBILITY, 20, 20, "pw:1;"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "narrows its eyes"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "screechs^an other-wordly screech"); + + // undead + addrace(R_ZOMBIE, "zombie", 50, 'Z', C_BLUE, MT_FLESH, RC_UNDEAD); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "6"); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); + addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, 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_HITDICE, NA, NA, NA, "2d4+4"); + addflag(lastrace->flags, F_ARMOURRATING, 5, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, -10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d5"); + addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_SKELETON, "skeleton", 20, 'Z', C_GREY, MT_BONE, RC_UNDEAD); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "5-20 bones"); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_EVASION, -10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d5"); + addflag(lastrace->flags, F_STARTOBDT, 50, DT_CHOP, NA, NULL); + addflag(lastrace->flags, F_STARTOB, 25, DT_CHOP, NA, "buckler"); + addflag(lastrace->flags, F_DTVULN, DT_BASH, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_GHAST, "ghast", 50, 'Z', C_MAGENTA, MT_FLESH, RC_UNDEAD); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 55, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+2"); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6"); + addflag(lastrace->flags, F_HASATTACK, OT_TOUCHPARALYZE2, NA, NA, "1d1"); + addflag(lastrace->flags, F_CARNIVORE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, NA, NA, NULL); + addflag(lastrace->flags, F_LEVITATING, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_GHOST, "ghost", 50, 'p', C_BLUE, MT_MAGIC, RC_UNDEAD); // p for sPirit + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 72, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+2"); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); + addflag(lastrace->flags, F_NONCORPOREAL, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_XRAYVIS, 3, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_INDUCEFEAR, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_INVISIBILITY, 40, 40, "pw:1;"); + // special: ghosts gain canwill->possession if they are near + // their previous corpse. use f_mycorpse->oid for this. + + addrace(R_GHOUL, "ghoul", 50, 'Z', C_BLUE, MT_FLESH, RC_UNDEAD); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+2"); + addflag(lastrace->flags, F_EVASION, -10, NA, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_SLOW, NA, NA, ""); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d5+3"); + addflag(lastrace->flags, F_HASATTACK, OT_TOUCHPARALYZE, NA, NA, "1d1"); + addflag(lastrace->flags, F_CARNIVORE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_VAMPIRE, "vampire", 75, 'V', C_BLUE, MT_FLESH, RC_UNDEAD); + addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_DEX, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_WIS, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_CHA, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 65, RR_RARE, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_VAMPIRIC, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); + addflag(lastrace->flags, F_DTVULN, DT_LIGHT, NA, NA, "3d6"); + addflag(lastrace->flags, F_MATVULN, MT_SILVER, 200, NA, NULL); + addflag(lastrace->flags, F_SEEINVIS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SEEINDARK, 8, NA, NA, NULL); + addflag(lastrace->flags, F_AVOIDOBTYPE, OT_GARLIC, B_TRUE, NA, NULL); + addflag(lastrace->flags, F_MOVESPEED, SP_FAST, NA, NA, NULL); + addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "8d4+3"); + addflag(lastrace->flags, F_ARMOURRATING, 5, NA, NA, NULL); + addflag(lastrace->flags, F_EVASION, -10, NA, NA, NULL); + addflag(lastrace->flags, F_HOMEOB, NA, NA, NA, "coffin"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+4"); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4+3"); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_RETAINHPMPONPOLY, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_CANWILL, OT_S_CHARM, 3, 3, "pw:6;"); + addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, 5, 5, "range:3;"); + addflag(lastrace->flags, F_CANWILL, OT_S_STUN, 5, 5, "pw:1;"); + addflag(lastrace->flags, F_CANWILL, OT_S_POLYMORPH, 3, 3, "pw:1;race:vampire bat;"); + addflag(lastrace->flags, F_DETECTOBS, 10, OT_COFFIN, NA, NULL); + addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "pile of ash"); + addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "gestures"); + addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "hisses angrily^an angry hiss"); + + // special: change to gas cloud with 1 hp on death, if not asleep + // special: flee from garlic + // TODO: can shapeshift to bat + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + // special monsters + addrace(R_GASCLOUD, "cloud of gas", 0.1, '}', C_GREY, MT_GAS, RC_OTHER); + addflag(lastrace->flags, F_MOVESPEED, SP_ULTRAFAST, NA, NA, ""); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+1"); + addflag(lastrace->flags, F_EVASION, 300, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_BODY, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 4, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_ALL, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + // special: fully heal if our origrace is a vampire, and we are resting over a coffin + + addrace(R_DANCINGWEAPON, "dancing weapon", 0, ')', C_GREY, MT_METAL, RC_OTHER); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_EVASION, 50, NA, NA, NULL); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_BODY, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NODEATHANNOUNCE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + addrace(R_FLOATINGDISC, "floating disc", 0, '_', C_BOLDGREEN, MT_METAL, RC_OTHER); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); + addflag(lastrace->flags, F_LEVITATING, B_TRUE, NA, NA, ""); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); + addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); + addflag(lastrace->flags, F_FOLLOWRANGE, 1, 1, NA, NULL); // stay right next to master + addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_INVULNERABLE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_RIGHTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_HEAD, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_BODY, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); + addflag(lastrace->flags, F_NOBODYPART, BP_FEET, NA, NA, NULL); + addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NODEATHANNOUNCE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); + + // now do final steps in race initialisation: + // - add flags based on raceclass, etc + // - fill in missing alignments + for (r = firstrace ; r ; r = r->next) { + if (r->raceclass->id == RC_AQUATIC) { + addflag(r->flags, F_HASSKILL, SK_SWIMMING, PR_MASTER, NA, NULL); + addflag(r->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); + addflag(r->flags, F_BREATHWATER, B_TRUE, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_WATER, NA, NA, NULL); + } else if (r->raceclass->id == RC_DEMON) { + addflag(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL); + addflag(r->flags, F_MATVULN, MT_SILVER, 200, NA, NULL); + } else if (r->raceclass->id == RC_GOD) { + addflag(r->flags, F_PIETY, 100, NA, NA, NULL); + addflag(r->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(r->flags, F_MORALE, 10, NA, NA, NULL); + addflag(r->flags, F_BREATHWATER, B_TRUE, NA, NA, NULL); + addflag(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_NECROTIC, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_POISONGAS, NA, NA, NULL); + addflag(r->flags, F_FLEEONHPPCT, 20, NA, NA, NULL); + addflag(r->flags, F_RESISTMAG, 15, NA, NA, NULL); + addflag(r->flags, F_MORALE, 40, NA, NA, NULL); + } else if (r->raceclass->id == RC_MAGIC) { + addflag(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL); + } else if (r->raceclass->id == RC_PLANT) { + addflag(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL); + addflag(r->flags, F_DTRESIST, DT_BASH, NA, NA, NULL); + addflag(r->flags, F_DTVULN, DT_FIRE, NA, NA, NULL); + addflag(r->flags, F_DTVULN, DT_COLD, NA, NA, NULL); + addflag(r->flags, F_DTVULN, DT_DECAY, NA, NA, NULL); + addflag(r->flags, F_FLAMMABLE, PERMENANT, NA, NA, NULL); + } else if (r->raceclass->id == RC_SLIME) { + addflag(lastrace->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL); + } else if (r->raceclass->id == RC_UNDEAD) { + addflag(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_COLD, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_POISONGAS, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_DECAY, NA, NA, NULL); + addflag(r->flags, F_DTIMMUNE, DT_NECROTIC, NA, NA, NULL); + addflag(r->flags, F_DTVULN, DT_HOLY, NA, NA, NULL); + addflag(r->flags, F_SEEINDARK, B_TRUE, NA, NA, NULL); + } + + // fill in missins alignments + if (!hasflag(r->flags, F_ALIGNMENT)) { + addflag(r->flags, F_ALIGNMENT, AL_NEUTRAL, NA, NA, NULL); + } + } +} + +void initskills(void) { + skill_t *sk; + addskill(SK_ARMOUR, "Armour", "Reduces evasion and stealth penalties from wearing armour.", 100); + addskilldesc(SK_ARMOUR, PR_INEPT, "- Reduces the noise you make when wearing metal armour.", B_FALSE); + addskilldesc(SK_ARMOUR, PR_NOVICE, "^gReduces armour evasion penalties by 10%.^n", B_FALSE); + addskilldesc(SK_ARMOUR, PR_BEGINNER, "^gReduces armour evasion penalties by 20%.^n", B_FALSE); + addskilldesc(SK_ARMOUR, PR_ADEPT, "^gReduces armour evasion penalties by 30%.^n", B_FALSE); + addskilldesc(SK_ARMOUR, PR_SKILLED, "^gReduces armour evasion penalties by 40%.^n", B_FALSE); + addskilldesc(SK_ARMOUR, PR_EXPERT, "^gReduces armour evasion penalties by 50%.^n", B_FALSE); + addskilldesc(SK_ARMOUR, PR_MASTER, "^gReduces armour evasion penalties by 60%.^n", B_FALSE); + addskill(SK_ATHLETICS, "Athletics", "Grants various athletic abilities.", 50); + addskilldesc(SK_ATHLETICS, PR_NOVICE, "^gYou gain the 'sprint' ability.^n", B_FALSE); + addskilldesc(SK_ATHLETICS, PR_ADEPT, "^gYou gain the 'tumble' ability.^n", B_FALSE); + addskilldesc(SK_ATHLETICS, PR_EXPERT, "^gYou gain the 'jump' ability.^n", B_FALSE); + addskill(SK_BACKSTAB, "Backstab", "Lets you inflict massive damage with stabs when unseen.", 50); + addskilldesc(SK_BACKSTAB, PR_NOVICE, "^gYour unseen attacks inflict double damage.^n", B_FALSE); + addskilldesc(SK_BACKSTAB, PR_BEGINNER, "^gYour unseen attacks inflict triple damage.^n", B_FALSE); + addskilldesc(SK_BACKSTAB, PR_ADEPT, "^gYour unseen attacks inflict quadruple damage.^n", B_FALSE); + addskilldesc(SK_BACKSTAB, PR_SKILLED, "^gYour unseen attacks inflict 5x damage.^n", B_FALSE); + addskilldesc(SK_BACKSTAB, PR_EXPERT, "^gYour unseen attacks inflict 6x damage.^n", B_FALSE); + addskilldesc(SK_BACKSTAB, PR_MASTER, "^gYour unseen attacks inflict 7x damage.^n", B_FALSE); + addskill(SK_CARTOGRAPHY, "Cartography", "Your ability to create and interpret maps.", 0); // untrainable + addskilldesc(SK_CARTOGRAPHY, PR_INEPT, "- Without this skill, you will quickly forget your surroundings.", B_FALSE); + addskilldesc(SK_CARTOGRAPHY, PR_NOVICE, "^gYou can now remember the basics of your surroundings.^n", B_TRUE); + addskilldesc(SK_CARTOGRAPHY, PR_BEGINNER, "^gYou can now remember the location of staircases.^n", B_TRUE); + addskilldesc(SK_CARTOGRAPHY, PR_ADEPT, "^gYour can now remember the location of doors.^n", B_TRUE); + addskilldesc(SK_CARTOGRAPHY, PR_SKILLED, "^gYou no longer forget your surroundings.^n", B_FALSE); + addskilldesc(SK_CARTOGRAPHY, PR_EXPERT, "^gYour can now remember the location of objects.^n", B_TRUE); + addskilldesc(SK_CARTOGRAPHY, PR_MASTER, "^gEvery 50 turns, you can intuitively map a small area around you.^n", B_FALSE); + addskill(SK_CHANNELING, "Channeling", "Lets you make better use of magical items.", 0); // untrainable + addskilldesc(SK_CHANNELING, PR_NOVICE, "^gThe power level of wands and scrolls is increased by 1.^n", B_FALSE); + addskilldesc(SK_CHANNELING, PR_BEGINNER, "^gThe power level of wands and scrolls is increased by 2.^n", B_FALSE); + addskilldesc(SK_CHANNELING, PR_ADEPT, "^gThe power level of wands and scrolls is increased by 4.^n", B_FALSE); + addskilldesc(SK_CHANNELING, PR_SKILLED, "^gThe power level of wands and scrolls is increased by 6.^n", B_FALSE); + addskilldesc(SK_CHANNELING, PR_EXPERT, "^gThe power level of wands and scrolls is increased by 8.^n", B_FALSE); + addskilldesc(SK_CHANNELING, PR_MASTER, "^gThe power level of wands and scrolls is increased by 10.^n", B_FALSE); + addskill(SK_CLIMBING, "Climbing", "Helps you to climb walls, mountains or other terrain.", 50); + addskilldesc(SK_CLIMBING, PR_INEPT, "- Increases you chances of successfully climbing by 10% per level.", B_FALSE); + addskill(SK_COOKING, "Cooking", "Your ability to combine foods into nutritious meals.", 50); + addskilldesc(SK_COOKING, PR_NOVICE, "^gYou now recognise water and rotting food.^n", B_TRUE); + addskilldesc(SK_COOKING, PR_BEGINNER, "^gYou can now recognise all kinds of bad food.^n", B_TRUE); + addskilldesc(SK_COOKING, PR_ADEPT, "^gYou can use the 'cook' ability to make jerky.^n", B_FALSE); + addskilldesc(SK_COOKING, PR_EXPERT, "^gYou can use the 'cook' ability to make stew.^n", B_FALSE); + addskill(SK_EVASION, "Evasion", "Your ability to dodge blows or traps.", 50); + addskilldesc(SK_EVASION, PR_NOVICE, "^gIncreases your EV by 5%.^n", B_FALSE); + addskilldesc(SK_EVASION, PR_BEGINNER, "^gIncreases your EV by 10%.^n", B_FALSE); + addskilldesc(SK_EVASION, PR_ADEPT, "^gIncreases your EV by 15%.^n", B_FALSE); + addskilldesc(SK_EVASION, PR_SKILLED, "^gIncreases your EV by 20%.^n", B_FALSE); + addskilldesc(SK_EVASION, PR_EXPERT, "^gIncreases your EV by 25%.^n", B_FALSE); + addskilldesc(SK_EVASION, PR_MASTER, "^gIncreases your EV by 30%.^n", B_FALSE); + addskill(SK_FIRSTAID, "First Aid", "Increases your healing rate and reduces duration of poison.", 0); // untrainable + addskilldesc(SK_FIRSTAID, PR_INEPT, "- Lets you recognise how healthy your opponents are.", B_FALSE); + addskilldesc(SK_FIRSTAID, PR_INEPT, "- Determines how fast you heal when resting. ", B_FALSE); + addskilldesc(SK_FIRSTAID, PR_INEPT, "- Determines how long poison effects will last.", B_FALSE); + addskilldesc(SK_FIRSTAID, PR_ADEPT, "^gYou can now recognise when poison is potentially fatal.^n", B_TRUE); + addskill(SK_LISTEN, "Listen", "How good you are at hearing and interpreting sounds.", 200); + addskilldesc(SK_LISTEN, PR_NOVICE, "^gYou now gauge the distance of sounds.^n", B_TRUE); + addskilldesc(SK_LISTEN, PR_BEGINNER, "^gYou now more accurately gauge the distance of sounds.^n", B_TRUE); + addskilldesc(SK_LISTEN, PR_ADEPT, "^gYou can now determine the direction sounds are coming from.^n", B_TRUE); + addskilldesc(SK_LISTEN, PR_EXPERT, "^gYou can now identify monsters based on sound.^n", B_TRUE); + addskilldesc(SK_LISTEN, PR_MASTER, "^gYou can now locate monsters based on sound.^n", B_TRUE); + addskill(SK_LOCKPICKING, "Lockpicking", "Enhances your ability to pick locks.", 50); + addskill(SK_METALWORK, "Metalwork", "Lets you repair metal objects.", 100); + addskilldesc(SK_METALWORK, PR_NOVICE, "^gYou can repair metal items up to 33% condition.^n", B_FALSE); + addskilldesc(SK_METALWORK, PR_BEGINNER, "^gYou can repair metal items up to 50% condition.^n", B_FALSE); + addskilldesc(SK_METALWORK, PR_ADEPT, "^gYou can repair metal items up to 60% condition.^n", B_FALSE); + addskilldesc(SK_METALWORK, PR_SKILLED, "^gYou can repair metal items up to 70% condition.^n", B_FALSE); + addskilldesc(SK_METALWORK, PR_EXPERT, "^gYou can repair metal items up to 85% condition.^n", B_FALSE); + addskilldesc(SK_METALWORK, PR_MASTER, "^gYou can fully repair metal items.^n", B_FALSE); + addskill(SK_RANGED, "Ranged Weapons", "Your ability to aim a ranged weapon like a bow or gun.", 50); + addskilldesc(SK_RANGED, PR_NOVICE, "^gYou suffer a -20% accuracy penalty when using ranged weapons.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_BEGINNER, "^gYou suffer a -10% accuracy penalty when using ranged weapons.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_ADEPT, "^gYou no longer suffer a accuracy penalty when using ranged weapons.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_SKILLED, "^gYou gain a +10% accuracy bonus when using ranged weapons.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_EXPERT, "^gYou gain a +20% accuracy bonus when using ranged weapons.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_MASTER, "^gYou gain a +30% accuracy bonus when using ranged weapons.^n", B_FALSE); + addskill(SK_SEWING, "Sewing", "Lets you repair cloth or leather objects.", 100); + addskilldesc(SK_SEWING, PR_NOVICE, "^gYou can repair cloth items up to 33% condition.^n", B_FALSE); + addskilldesc(SK_SEWING, PR_BEGINNER, "^gYou can repair cloth items up to 50% condition^n", B_FALSE); + addskilldesc(SK_SEWING, PR_ADEPT, "^gYou can repair cloth items up to 60% condition^n", B_FALSE); + addskilldesc(SK_SEWING, PR_SKILLED, "^gYou can repair cloth items up to 70% condition^n", B_FALSE); + addskilldesc(SK_SEWING, PR_EXPERT, "^gYou can repair cloth items up to 85% condition^n", B_FALSE); + addskilldesc(SK_SEWING, PR_MASTER, "^gYou can fully repair cloth items.^n", B_FALSE); + addskill(SK_SHIELDS, "Shields", "Reduces shield accuracy penalty, and raises chance to block attacks.", 50); + addskilldesc(SK_SHIELDS, PR_INEPT, "- Without this skill, shield accuracy penalties are tripled.", B_FALSE); + addskilldesc(SK_SHIELDS, PR_NOVICE, "^gShield accuracy penalties are reduced by 5%.^n", B_FALSE); + addskilldesc(SK_SHIELDS, PR_BEGINNER, "^gShield accuracy penalties are reduced by 10%.^n", B_FALSE); + addskilldesc(SK_SHIELDS, PR_ADEPT, "^gShield accuracy penalties are reduced by 15%.^n", B_FALSE); + addskilldesc(SK_SHIELDS, PR_SKILLED, "^gShield accuracy penalties are reduced by 20%.^n", B_FALSE); + addskilldesc(SK_SHIELDS, PR_EXPERT, "^gShield accuracy penalties are reduced by 25%.^n", B_FALSE); + addskilldesc(SK_SHIELDS, PR_MASTER, "^gShield accuracy penalties are reduced by 30%.^n", B_FALSE); + addskill(SK_SPEECH, "Negotiation", "Your skill at haggling prices, or swaying others through speech.", 50); + addskilldesc(SK_SPEECH, PR_NOVICE, "^gShop item prices are reduced by 5%.^n", B_FALSE); + addskilldesc(SK_SPEECH, PR_BEGINNER, "^gShop item prices are reduced by 10%.^n", B_FALSE); + addskilldesc(SK_SPEECH, PR_ADEPT, "^gShop item prices are reduced by 15%.^n", B_FALSE); + addskilldesc(SK_SPEECH, PR_SKILLED, "^gShop item prices are reduced by 20%.^n", B_FALSE); + addskilldesc(SK_SPEECH, PR_EXPERT, "^gShop item prices are reduced by 25%.^n", B_FALSE); + addskilldesc(SK_SPEECH, PR_MASTER, "^gShop item prices are reduced by 30%.^n", B_FALSE); + addskill(SK_SPELLCASTING, "Sorcery", "Increases the power of spells from all schools except Allomancy, Nature and Psionics.", 50); + addskilldesc(SK_SPELLCASTING, PR_NOVICE, "^gYou gain the 'study scrolls' ability.^n", B_FALSE); + addskill(SK_PERCEPTION, "Perception", "Your ability to notice hidden details, from simple footprints to sinister traps.", 50); + addskilldesc(SK_PERCEPTION, PR_INEPT, "- At higher levels this skill will also let you obscure your own tracks.", B_TRUE); + addskilldesc(SK_PERCEPTION, PR_NOVICE, "^gYou can now see footprints.^n", B_TRUE); + addskilldesc(SK_PERCEPTION, PR_BEGINNER, "^gYou can now determine how recently footprints were made.^n", B_TRUE); + addskilldesc(SK_PERCEPTION, PR_ADEPT, "^gYou can now identify creatures from their footprints.^n", B_TRUE); + addskilldesc(SK_PERCEPTION, PR_ADEPT, "^gYour field of vision is now wider.^n", B_TRUE); + addskilldesc(SK_PERCEPTION, PR_SKILLED, "^gYou can now recognise the direction of footprints.^n", B_TRUE); + addskilldesc(SK_PERCEPTION, PR_EXPERT, "^gYou can now move without leaving footprints.^n", B_TRUE); + addskilldesc(SK_PERCEPTION, PR_MASTER, "^gYou now have perception of your blind spots.^n", B_TRUE); + addskill(SK_STEALTH, "Stealth", "Affects your ability to move silently.", 0); // untrainable? + addskilldesc(SK_STEALTH, PR_BEGINNER, "^gYou gain the 'hide' ability.^n", B_FALSE); + addskilldesc(SK_STEALTH, PR_EXPERT, "^gYou can now hide even when monsters are nearby.^n", B_TRUE); + addskill(SK_SWIMMING, "Swimming", "Allows you to safely swim through deep water.", 50); + addskilldesc(SK_SWIMMING, PR_NOVICE, "^gYou can now swim.^n", B_TRUE); + addskilldesc(SK_SWIMMING, PR_BEGINNER, "^gYou can now swim a bit faster.^n", B_TRUE); + addskilldesc(SK_SWIMMING, PR_ADEPT, "^gYou can now swim a bit faster.^n", B_TRUE); + addskilldesc(SK_SWIMMING, PR_SKILLED, "^gYou can now swim a bit faster.^n", B_TRUE); + addskilldesc(SK_SWIMMING, PR_EXPERT, "^gYou can now attack (awkwardly) and cast spells while swimming.^n", B_TRUE); + addskilldesc(SK_SWIMMING, PR_MASTER, "^gYou can now attack while swimming with no penalty.^n", B_TRUE); + addskill(SK_TECHUSAGE, "Technology", "Determines your comprehension of modern technological items.", 0); // untrain + addskill(SK_THIEVERY, "Thievery", "Your ability to pick pockets and steal items.", 50); + addskilldesc(SK_THIEVERY, PR_NOVICE, "^gYou gain the 'steal' ability, usable on enemies or in shops.^n", B_FALSE); + addskilldesc(SK_THIEVERY, PR_BEGINNER, "^gYour accuracy penalty when stealing is reduced.^n", B_TRUE); + addskilldesc(SK_THIEVERY, PR_ADEPT, "^gYou can now choose which items to steal.^n", B_TRUE); + addskilldesc(SK_THIEVERY, PR_SKILLED, "gYou can now steal heavy items.", B_TRUE); + addskilldesc(SK_THIEVERY, PR_EXPERT, "gYou can now steal multiple items.", B_TRUE); + addskilldesc(SK_THIEVERY, PR_MASTER, "gYou can now steal equipped items.", B_TRUE); + addskill(SK_THROWING, "Throwing", "Your accuracy when throwing objects at things.", 50); + addskilldesc(SK_RANGED, PR_NOVICE, "^gYou suffer a -20% accuracy penalty when throwing items.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_BEGINNER, "^gYou suffer a -10% accuracy penalty when throwing items.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_ADEPT, "^gYou no longer suffer a accuracy penalty when throwing items.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_SKILLED, "^gYou gain a +10% accuracy bonus when throwing items.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_EXPERT, "^gYou gain a +20% accuracy bonus when throwing items.^n", B_FALSE); + addskilldesc(SK_RANGED, PR_MASTER, "^gYou gain a +30% accuracy bonus when throwing items.^n", B_FALSE); + addskill(SK_TRAPS, "Traps", "Affects your ability to locate and disarm traps.", 25); + addskilldesc(SK_TRAPS, PR_NOVICE, "^gYou gain the 'disarm traps' ability.^n", B_FALSE); + addskill(SK_TWOWEAPON, "Dual Weilding", "Allows you to weild two melee weapons at once.", 50); + addskilldesc(SK_TWOWEAPON, PR_NOVICE, "^gYou can now weild two weapons at once.^n", B_TRUE); + addskilldesc(SK_TWOWEAPON, PR_ADEPT, "^gYou no longer suffer an accuracy penalty when weilding two weapons.^n", B_TRUE); + addskilldesc(SK_TWOWEAPON, PR_SKILLED, "^gFollow-up attacks with your second weapon are now more accurate.^n", B_TRUE); + addskilldesc(SK_TWOWEAPON, PR_EXPERT, "^gYou gain the 'flurry attack' ability.^n", B_FALSE); + addskilldesc(SK_TWOWEAPON, PR_MASTER, "^gYou can now deflect attacks with your second weapon.^n", B_TRUE); + // knowledge + addskill(SK_LORE_ARCANA, "Lore:Arcana", "Allows you a chance of recognising magical objects and creatures.", 0); + addskilldesc(SK_LORE_ARCANA, PR_NOVICE, "^gYou can attempt to identify objects with the 'inspect' ability.^n", B_FALSE); + addskill(SK_LORE_DEMONS, "Lore:Demonology", "Determines your knowledge about demons.", 0); + addskill(SK_LORE_HUMANOID, "Lore:Humanoid", "Determines your knowledge about humanoid (bipedal) creatures.", 0); + addskill(SK_LORE_NATURE, "Lore:Nature", "Determines your knowledge of plants, animals and insects.", 0); + addskill(SK_LORE_UNDEAD, "Lore:Undead", "Determines your knowledge of the undead.", 0); + + + // weaponry + addskill(SK_AXES, "Axes", "Helps you use chopping weapons like axes.", 50); + addskill(SK_CLUBS, "Clubs", "Helps you use bashing weapons like maces or clubs.", 50); + addskill(SK_LONGBLADES, "Long Blades", "Helps you use long swords, scimitars, etc.", 50); + addskill(SK_POLEARMS, "Polearms", "Helps you use long bladed weapons like halberds.", 50); + addskill(SK_SHORTBLADES, "Short Blades", "Helps you use daggers, short swords, etc.", 50); + addskill(SK_STAVES, "Staves", "Helps you use quarterstaffs, staffs, etc.", 50); + addskill(SK_UNARMED, "Unarmed Combat", "Helps you fight using your bare hands.", 50); + addskilldesc(SK_UNARMED, PR_ADEPT, "^gYour unarmed attacks can now smash wooden objects.^n", B_TRUE); + addskilldesc(SK_UNARMED, PR_SKILLED, "^gYou can now make melee attacks with your off-hand.^n", B_TRUE); + + // spell schools + addskill(SK_SS_ALLOMANCY, "Allomancy", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_ALLOMANCY, PR_NOVICE, "You gain knowledge of all Allomancy spells.", B_FALSE); + addskilldesc(SK_SS_ALLOMANCY, PR_NOVICE, "Allows you to cast Allomancy spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_ALLOMANCY, PR_BEGINNER, "Allows you to cast Allomancy spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_ALLOMANCY, PR_ADEPT, "Allows you to cast Allomancy spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_ALLOMANCY, PR_SKILLED, "Allows you to cast Allomancy spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_ALLOMANCY, PR_EXPERT, "Allows you to cast Allomancy spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_ALLOMANCY, PR_MASTER, "Allows you to cast Allomancy spells up to level 6.", B_FALSE); + addskill(SK_SS_MENTAL, "Psionics", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_MENTAL, PR_INEPT, "- Each rank gives you a 10%% chance to learn a new psionic ability when levelling up.", B_FALSE); + addskilldesc(SK_SS_MENTAL, PR_NOVICE, "Allows you to cast Psionic spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_MENTAL, PR_BEGINNER, "Allows you to cast Psionic spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_MENTAL, PR_ADEPT, "Allows you to cast Psionic spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_MENTAL, PR_SKILLED, "Allows you to cast Psionic spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_MENTAL, PR_EXPERT, "Allows you to cast Psionic spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_MENTAL, PR_MASTER, "Allows you to cast Psionic spells up to level 6.", B_FALSE); + addskill(SK_SS_NATURE, "Enviromancy", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_NATURE, PR_NOVICE, "Allows you to cast Nature spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_NATURE, PR_BEGINNER, "Allows you to cast Nature spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_NATURE, PR_ADEPT, "Allows you to cast Nature spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_NATURE, PR_SKILLED, "Allows you to cast Nature spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_NATURE, PR_EXPERT, "Allows you to cast Nature spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_NATURE, PR_MASTER, "Allows you to cast Nature spells up to level 6.", B_FALSE); + addskill(SK_SS_AIR, "Magic:Air Magic", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_AIR, PR_NOVICE, "Allows you to cast Air Magic spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_AIR, PR_BEGINNER, "Allows you to cast Air Magic spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_AIR, PR_ADEPT, "Allows you to cast Air Magic spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_AIR, PR_SKILLED, "Allows you to cast Air Magic spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_AIR, PR_EXPERT, "Allows you to cast Air Magic spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_AIR, PR_MASTER, "Allows you to cast Air Magic spells up to level 6.", B_FALSE); + addskill(SK_SS_DEATH, "Magic:Necromancy", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_DEATH, PR_NOVICE, "Allows you to cast Necromancy spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_DEATH, PR_BEGINNER, "Allows you to cast Necromancy spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_DEATH, PR_ADEPT, "Allows you to cast Necromancy spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_DEATH, PR_SKILLED, "Allows you to cast Necromancy spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_DEATH, PR_EXPERT, "Allows you to cast Necromancy spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_DEATH, PR_MASTER, "Allows you to cast Necromancy spells up to level 6.", B_FALSE); + addskill(SK_SS_DIVINATION, "Magic:Divination", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_DIVINATION, PR_NOVICE, "Allows you to cast Divination spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_DIVINATION, PR_BEGINNER, "Allows you to cast Divination spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_DIVINATION, PR_ADEPT, "Allows you to cast Divination spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_DIVINATION, PR_SKILLED, "Allows you to cast Divination spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_DIVINATION, PR_EXPERT, "Allows you to cast Divination spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_DIVINATION, PR_MASTER, "Allows you to cast Divination spells up to level 6.", B_FALSE); + addskill(SK_SS_ENCHANTMENT, "Magic:Enchantment", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_ENCHANTMENT, PR_NOVICE, "Allows you to cast Enchantment spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_ENCHANTMENT, PR_BEGINNER, "Allows you to cast Enchantment spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_ENCHANTMENT, PR_ADEPT, "Allows you to cast Enchantment spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_ENCHANTMENT, PR_SKILLED, "Allows you to cast Enchantment spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_ENCHANTMENT, PR_EXPERT, "Allows you to cast Enchantment spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_ENCHANTMENT, PR_MASTER, "Allows you to cast Enchantment spells up to level 6.", B_FALSE); + addskill(SK_SS_FIRE, "Magic:Fire Magic", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_FIRE, PR_NOVICE, "Allows you to cast Fire Magic spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_FIRE, PR_BEGINNER, "Allows you to cast Fire Magic spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_FIRE, PR_ADEPT, "Allows you to cast Fire Magic spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_FIRE, PR_SKILLED, "Allows you to cast Fire Magic spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_FIRE, PR_EXPERT, "Allows you to cast Fire Magic spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_FIRE, PR_MASTER, "Allows you to cast Fire Magic spells up to level 6.", B_FALSE); + addskill(SK_SS_COLD, "Magic:Cold Magic", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_COLD, PR_NOVICE, "Allows you to cast Cold Magic spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_COLD, PR_BEGINNER, "Allows you to cast Cold Magic spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_COLD, PR_ADEPT, "Allows you to cast Cold Magic spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_COLD, PR_SKILLED, "Allows you to cast Cold Magic spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_COLD, PR_EXPERT, "Allows you to cast Cold Magic spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_COLD, PR_MASTER, "Allows you to cast Cold Magic spells up to level 6.", B_FALSE); + addskill(SK_SS_GRAVITY, "Magic:Gravitation Magic", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_GRAVITY, PR_NOVICE, "Allows you to cast Gravitation Magic spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_GRAVITY, PR_BEGINNER, "Allows you to cast Gravitation Magic spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_GRAVITY, PR_ADEPT, "Allows you to cast Gravitation Magic spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_GRAVITY, PR_SKILLED, "Allows you to cast Gravitation Magic spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_GRAVITY, PR_EXPERT, "Allows you to cast Gravitation Magic spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_GRAVITY, PR_MASTER, "Allows you to cast Gravitation Magic spells up to level 6.", B_FALSE); + addskill(SK_SS_LIFE, "Magic:Life Magic", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_LIFE, PR_NOVICE, "Allows you to cast Life Magic spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_LIFE, PR_BEGINNER, "Allows you to cast Life Magic spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_LIFE, PR_ADEPT, "Allows you to cast Life Magic spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_LIFE, PR_SKILLED, "Allows you to cast Life Magic spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_LIFE, PR_EXPERT, "Allows you to cast Life Magic spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_LIFE, PR_MASTER, "Allows you to cast Life Magic spells up to level 6.", B_FALSE); + addskill(SK_SS_MODIFICATION, "Magic:Modification", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_MODIFICATION, PR_NOVICE, "Allows you to cast Modification spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_MODIFICATION, PR_BEGINNER, "Allows you to cast Modification spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_MODIFICATION, PR_ADEPT, "Allows you to cast Modification spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_MODIFICATION, PR_SKILLED, "Allows you to cast Modification spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_MODIFICATION, PR_EXPERT, "Allows you to cast Modification spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_MODIFICATION, PR_MASTER, "Allows you to cast Modification spells up to level 6.", B_FALSE); + addskill(SK_SS_SUMMONING, "Magic:Summoning", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_SUMMONING, PR_NOVICE, "Allows you to cast Summoning spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_SUMMONING, PR_BEGINNER, "Allows you to cast Summoning spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_SUMMONING, PR_ADEPT, "Allows you to cast Summoning spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_SUMMONING, PR_SKILLED, "Allows you to cast Summoning spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_SUMMONING, PR_EXPERT, "Allows you to cast Summoning spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_SUMMONING, PR_MASTER, "Allows you to cast Summoning spells up to level 6.", B_FALSE); + addskill(SK_SS_TRANSLOCATION, "Magic:Translocation", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_TRANSLOCATION, PR_NOVICE, "Allows you to cast Translocation spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_TRANSLOCATION, PR_BEGINNER, "Allows you to cast Translocation spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_TRANSLOCATION, PR_ADEPT, "Allows you to cast Translocation spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_TRANSLOCATION, PR_SKILLED, "Allows you to cast Translocation spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_TRANSLOCATION, PR_EXPERT, "Allows you to cast Translocation spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_TRANSLOCATION, PR_MASTER, "Allows you to cast Translocation spells up to level 6.", B_FALSE); + addskill(SK_SS_WILD, "Magic:Wild Magic", "Boosts casting of spells from this school.", 50); + addskilldesc(SK_SS_WILD, PR_NOVICE, "Allows you to cast Wild Magic spells up to level 1.", B_FALSE); + addskilldesc(SK_SS_WILD, PR_BEGINNER, "Allows you to cast Wild Magic spells up to level 2.", B_FALSE); + addskilldesc(SK_SS_WILD, PR_ADEPT, "Allows you to cast Wild Magic spells up to level 3.", B_FALSE); + addskilldesc(SK_SS_WILD, PR_SKILLED, "Allows you to cast Wild Magic spells up to level 4.", B_FALSE); + addskilldesc(SK_SS_WILD, PR_EXPERT, "Allows you to cast Wild Magic spells up to level 5.", B_FALSE); + addskilldesc(SK_SS_WILD, PR_MASTER, "Allows you to cast Wild Magic spells up to level 6.", B_FALSE); + + for (sk = firstskill ; sk ; sk = sk->next) { + if (isloreskill(sk->id)) { + raceclass_t *rc; + // find raceclass for this one + for (rc = firstraceclass ; rc ; rc = rc->next) { + if (rc->skill == sk->id) { + break; + } + } + if (rc) { + char buf[BUFLEN]; + snprintf(buf, BUFLEN, "^gYou now know basic information about %s.", rc->pluralname); + addskilldesc(sk->id, PR_NOVICE, buf, B_TRUE); + snprintf(buf, BUFLEN, "^gYou can now determine how much damage %s will deal.", rc->pluralname); + addskilldesc(sk->id, PR_BEGINNER, buf, B_TRUE); + snprintf(buf, BUFLEN, "^gYou can now determine how dangerous %s are.", rc->pluralname); + addskilldesc(sk->id, PR_ADEPT, buf, B_TRUE); + snprintf(buf, BUFLEN, "^gYou can now anticipate how %s will react.", rc->pluralname); + addskilldesc(sk->id, PR_SKILLED, buf, B_TRUE); + snprintf(buf, BUFLEN, "^gYou now know everything there is to know about %s.", rc->pluralname); + addskilldesc(sk->id, PR_MASTER, buf, B_TRUE); + } + } + + if (isweaponskill(sk->id) || (sk->id == SK_UNARMED)) { + addskilldesc(sk->id, PR_INEPT, "This skill increases your accuracy and damage when using matching weapons.", B_FALSE); + addskilldesc(sk->id, PR_NOVICE, "^g-10% accuracy penalty.^n", B_FALSE); + addskilldesc(sk->id, PR_BEGINNER, "^g-5% accuracy penalty, +10% damage bonus^n", B_FALSE); + addskilldesc(sk->id, PR_ADEPT, "^gNo accuracy penalty, +20% damage bonus.^n", B_FALSE); + addskilldesc(sk->id, PR_SKILLED, "^g+25% accuracy bonus, +30% damage bonus.^n", B_FALSE); + addskilldesc(sk->id, PR_EXPERT, "^g+50% accuracy bonus, +40% damage bonus.^n", B_FALSE); + addskilldesc(sk->id, PR_MASTER, "^g+50% damage bonus, and you can perform combination strikes.^n", B_FALSE); + } + } +} + +void sortcommands(void) { + command_t *c; + int donesomething = B_TRUE; + while (donesomething) { + donesomething = B_FALSE; + for (c = firstcommand ; c->next ; c = c->next) { + // move up one position if required. + if (c->ch > c->next->ch) { + command_t *temp; + + // remember next element + temp = c->next; + + // remove this element from list + if (c->prev == NULL) { + // first + firstcommand = c->next; + c->next->prev = NULL; + } else { + // not first + c->prev->next = c->next; + c->next->prev = c->prev; + } + + // re-add element afterwards + c->next = temp->next; + c->prev = temp; + temp->next = c; + if (c->next == NULL) { + lastcommand = c; + } else { + c->next->prev = c; + } + + // mark as done. + donesomething = B_TRUE; + break; + } + } + } +} + diff --git a/data.h b/data.h new file mode 100644 index 0000000..2c75192 --- /dev/null +++ b/data.h @@ -0,0 +1,9 @@ +#include "defs.h" + +command_t *addcommand(enum COMMAND id, char c, char *desc); +void initcommands(void); +void initjobs(void); +void initobjects(void); +void initrace(void); +void initskills(void); +void sortcommands(void); diff --git a/data/hiscores.db b/data/hiscores.db index 3f1e4c4a61239b933f62640604358fc1db1a107b..b745cf05a39ff0955eaae087a119d34ef4ebc52c 100644 GIT binary patch delta 274 zcmZqBXfT){%^1B=<^?kk6Z1C)AYfzu&HQb%0LwFGK_HJs7f7&*aREtvX3@#)9Kk%y zdd!;4D$MfCQp}VpV95TOeqbU=hQh|rpB%zcqroWXZ8JCBC?MTX@J zRSdoiT2gEbOu~xhoN7h+Nj_yJ3gMYmiACDFYz&OTn#TN-x!I+KQi}4+^D^_&^|W;$ z!puNn6;2IpFi$rW$djF{z{kR=t_2cNG-jB*kX2#xFCI2_9$uh(nV6R_FkfU|va#?g i)5M0uoZ9*jV|c;F=<0!a<_sWXICC@e@=Fp+i}V0HGc$Jp delta 204 zcmZoLXwaA-%^12-<^?kkBlB+tAYfts&8)v!faMvpphBWTaS2d}Rg4QrYBC#7X6Fdr zEGTl5X|gf*MP^}!Uz6E+G;I4Bk{Qf_3bdry7?^|=%{kSI@{@eZOccU1s}hS+yfbrh zQd1O?DuIS27L_HIWaj7TX-Tp%FbXSL`c7WRDk+klnV46iP?T7rry&70!= 'hungry' @@ -2038,6 +2045,7 @@ enum FLAG { // v0 is accuracy penalty, v1 is evasion penalty. F_LEVRACE, // at level v0, this race is promoted to race v1 // must apply this to the BASE race. + F_JOBATTRMOD, // add v1 to attr v0. only used in jobs. F_ATTRMOD, // modify attribute val0 by val1. ie. 0=A_STR,1=-3 F_ATTRSET, // forces attribute val0 to be val1. ie. 0=A_STR,1=18 F_SIZE, // val0 = lf size (enum LFSIZE) @@ -2212,6 +2220,7 @@ enum FLAG { F_NUMAPPEAR, // when randomly appearing, can have > 1. val[0] = min, val[1] = max F_MINIONS, // val0 % chance of appearing with v1-v2 lf of type text F_HITDICE, // text = xdy+z to roll for maxhp per level. + F_MAXHPMOD, // maxhp = pctof(v0, maxhp) F_MPDICE, // val0: # d4 to roll for maxmp per level. val1: +xx F_JOB, // val0 = player's class/job F_GODOF, // text = what this lf is the god of. use capitals. @@ -2276,7 +2285,9 @@ enum FLAG { F_MAGICARMOUR,// armour is magically boosted. f->text is the description // ie 'magic armour', 'force field' // v0 is power left. - F_ASLEEP, // is asleep. if v2 is set, means we are sleeping on + F_ASLEEP, // lf is asleep. + // if v1 is set, means we are 'meditating' instead + // if v2 is set, means we are sleeping on // purpose and will wake up when at full hp/mp/etc. F_ATTACHEDTO, // you are attached to lf id v0, and will move with it F_AWARENESS, // you can see 360 degrees around yourself @@ -2352,6 +2363,7 @@ enum FLAG { // (bypasses armour) F_GRAVBOOSTED,// cannot walk or throw stuff F_GRAVLESSENED,// knockback maeks you go further, can jump further + F_MEDITATES, // meditates instead of sleeping. F_NEEDSWATER, // cannot survive out of deep water F_PAIN, // take damage if you walk. v0=damtype,text is damage (xdy+z). // if text not set, default dam is 1d2 @@ -3202,8 +3214,9 @@ typedef struct obmod_s { typedef struct choice_s { char ch; - char *text; - char *desc; + char *text; // what you type to select this one + char *desc; // what is displayed on the screen + char *longdesc; // what to display once you've selected this void *data; int heading; int valid; // used in askchoicestr diff --git a/doc/glyphs.txt b/doc/glyphs.txt index 9b606ae..d8ab5f0 100644 --- a/doc/glyphs.txt +++ b/doc/glyphs.txt @@ -27,6 +27,7 @@ x = small creature/monster q = quadraped Q = large quadraped r = rodent +R = robot s = snake S = spider h = humanoid @@ -37,6 +38,7 @@ V = vampire z = lizard-like creature Z = undead + --- C hybrid human animal? diff --git a/io.c b/io.c index 459a7cf..1431afc 100644 --- a/io.c +++ b/io.c @@ -83,15 +83,14 @@ int vieww,viewh; int msgmod = B_FALSE; -void addchoice(prompt_t *p, char ch, char *text, char *desc, void *data) { +void addchoice(prompt_t *p, char ch, char *text, char *desc, void *data, char *longdesc) { assert(p->choice[p->nchoices].text == NULL); p->choice[p->nchoices].ch = ch; p->choice[p->nchoices].text = strdup(text); - if (desc) { - p->choice[p->nchoices].desc = strdup(desc); - } else { - p->choice[p->nchoices].desc = strdup(text); - } + if (desc) p->choice[p->nchoices].desc = strdup(desc); + else p->choice[p->nchoices].desc = strdup(text); + if (longdesc) p->choice[p->nchoices].longdesc = strdup(longdesc); + else p->choice[p->nchoices].longdesc = strdup(""); p->choice[p->nchoices].data = data; p->choice[p->nchoices].heading = B_FALSE; p->choice[p->nchoices].valid = B_TRUE; @@ -518,7 +517,7 @@ char askchar(char *prompt, char *validchars, char *def, int showchars) { return ch; } -cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *srclf, int maxrange, enum LOFTYPE loftype, int wanttrail) { +cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *srclf, int maxrange, enum LOFTYPE LOFTYPE, int wanttrail) { static int startlf = -1; int finished = B_FALSE; int moved = B_FALSE; @@ -642,15 +641,15 @@ cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *src } else if (c->lf->race->raceclass->id == RC_GOD) { f = lfhasflag(c->lf, F_GODOF); if (f->val[0] == B_FEMALE) { - strcat(buf, " the Goddess of "); + strcat(buf, " the goddess of "); } else { - strcat(buf, " the God of "); + strcat(buf, " the god of "); } strcat(buf, f->text); } // level /* - if (lfhasflag(player, F_EXTRAINFO) || lfhasflag(player, F_OMNIPOTENT)) { + if (lfhasflag(player, f_extrainfo) || lfhasflag(player, F_OMNIPOTENT)) { snprintf(extrainfo, BUFLEN, "level %d, ",c->lf->level); } */ @@ -691,13 +690,15 @@ cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *src f = lfhasflag(c->lf, F_ASLEEP); if (f) { if (strlen(extrainfo)) strcat(extrainfo, ", "); - if (f->val[2] == NA) { + if (f->val[1] != B_TRUE) { + strcat(extrainfo, "meditating"); + } else if (f->val[2] == NA) { strcat(extrainfo, "sleeping"); } else { strcat(extrainfo, "resting"); } } else if (lfhasflag(c->lf, F_PRONE)) { - // prevent showing 'prone' AND 'asleep' + // prevent showing 'prone' and 'asleep' if (strlen(extrainfo)) strcat(extrainfo, ", "); strcat(extrainfo, "prone"); } else if (isairborne(c->lf)) { @@ -909,9 +910,9 @@ cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *src trailtarg = c; - if (loftype != LOF_DONTNEED) { + if (LOFTYPE != LOF_DONTNEED) { cell_t *newcell; - if (!haslof(srclf->cell, c, loftype, &newcell)) { + if (!haslof(srclf->cell, c, LOFTYPE, &newcell)) { inlof = B_FALSE; strcat(buf, " [no-lof]"); } @@ -970,7 +971,7 @@ cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *src } return c; } else if (ch == 'v') { // view - // TODO: show obpile or view lf + // todo: show obpile or view lf if (c->lf && cansee(player, c->lf)) { showlfstats(c->lf, B_FALSE); } else if (haslos(player, c)) { @@ -982,7 +983,7 @@ cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *src o = doaskobject(c->obpile, "Describe which object", NULL, B_FALSE, B_FALSE, AO_NONE, F_NONE); } } - } else if (ch == 27) { // ESC - cancel + } else if (ch == 27) { // esc - cancel finished = B_TRUE; } else if ((ch == '\'') && (ntargets > 0)) { // cycle targets if (curtarget != -1) { // -1 means no targets @@ -1009,7 +1010,7 @@ cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *src // retbuf must already be allocated // "def" is optional -char *askstring(char *prompt, char punc, char *retbuf, int retbuflen, char *def) { +char *askstring(char *prompt, char punc, char *retbuf, int retBUFLEN, char *def) { char buf[BUFLEN]; char *ending; @@ -1031,7 +1032,7 @@ char *askstring(char *prompt, char punc, char *retbuf, int retbuflen, char *def) mvwprintw(msgwin, 0, 0, buf); wrefresh(msgwin); echo(); - wgetnstr(msgwin, retbuf, retbuflen); + wgetnstr(msgwin, retbuf, retBUFLEN); noecho(); clearmsg(); if (def && (strlen(retbuf) == 0)) { @@ -1041,18 +1042,6 @@ char *askstring(char *prompt, char punc, char *retbuf, int retbuflen, char *def) return retbuf; } -/* -void announceob(enum OBTYPE oid) { - switch (oid) { - case OT_RING_INVULN: - msg("You feel indestructable!"); - break; - default: - break; - } -} -*/ - void announcearrival(lifeform_t *lf, map_t *newmap) { if (isplayer(lf)) { if (newmap->region == RG_WORLDMAP) { @@ -1092,7 +1081,7 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { if (isdead(player)) return B_FALSE; // player can't see this? - // We need to check "!isplayer(lf)" as well, otherwise + // we need to check "!isplayer(lf)" as well, otherwise // we'll get no announcement when the player turns // invisible and doesn't have see invisible. if (!isplayer(lf) && !cansee(player, lf)) { @@ -1151,19 +1140,21 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { donesomething = B_TRUE; break; case F_MAGICARMOUR: - msg("%s %s appears around %s!",needan(f->text) ? "An" : "A", f->text, lfname); + msg("%s %s appears around %s!",needan(f->text) ? "an" : "a", f->text, lfname); donesomething = B_TRUE; break; case F_ASLEEP: - if (isplayer(lf) && (f->val[2] != NA)) { // ie. resting + if (isplayer(lf) && (f->val[2] != NA)) { // ie. resting, not forced asleep object_t *restob; + int meditating = B_FALSE; + if (f->val[1] != NA) meditating = B_TRUE; restob = getrestob(lf); if (restob) { char restobname[BUFLEN]; getobname(restob, restobname, 1); - msg("You start resting (in your %s)...",noprefix(restobname)); + msg("You start %s (in your %s)...",meditating ? "meditating" : "resting", noprefix(restobname)); } else { - msg("You start resting (on the ground)..."); + msg("You start %s (on the ground)...", meditating ? "meditating" : "resting" ); } } else { msg("%s fall%s asleep.",lfname, isplayer(lf) ? "" : "s"); @@ -1174,12 +1165,12 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { lf2 = findlf(NULL, f->val[0]); if (lf2) { getlfname(lf2, buf); - msg("^%c%s %s on to %s!",isplayer(lf2) ? 'B' : 'n', lfname, isplayer(lf) ? "latch" : "latches", buf); + msg("^%c%s %s on to %s!",isplayer(lf2) ? 'b' : 'n', lfname, isplayer(lf) ? "latch" : "latches", buf); donesomething = B_TRUE; } break; case F_BEINGSTONED: - msg("^%c%s begin%s to turn to stone!",isplayer(lf) ? 'B' : 'n', lfname, isplayer(lf) ? "" : "s"); + msg("^%c%s begin%s to turn to stone!",isplayer(lf) ? 'b' : 'n', lfname, isplayer(lf) ? "" : "s"); donesomething = B_TRUE; break; case F_AWARENESS: @@ -1189,7 +1180,7 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { break; case F_BLIND: if (isplayer(lf)) { - msg("^WYou cannot see!"); + msg("^wYou cannot see!"); } else { msg("%s is blinded!",lfname); } @@ -1256,7 +1247,7 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { break; case F_CONFUSED: if (isplayer(lf)) { - msg("^WYou feel woozy..."); + msg("^wYou feel woozy..."); } else { msg("^%c%s looks woozy...", getlfcol(lf, CC_BAD), lfname); } @@ -1264,7 +1255,7 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { break; case F_DEAF: if (isplayer(lf)) { - msg("^WYou cannot hear anything!"); + msg("^wYou cannot hear anything!"); } donesomething = B_TRUE; break; @@ -1428,7 +1419,7 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { break; case F_FASTMETAB: if (isplayer(lf)) { // don't know if monsters get it - msg("^BYou feel ravenous!"); + msg("^bYou feel ravenous!"); donesomething = B_TRUE; } break; @@ -1483,9 +1474,15 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { msg("^%c%s %s surrounded by a magnetic shield!",getlfcol(lf, CC_GOOD), lfname, is(lf)); donesomething = B_TRUE; break; + case F_MEDITATES: + if (isplayer(lf)) { + msg("You now meditate instead of sleeping."); + donesomething = B_TRUE; + } + break; case F_NAUSEATED: if (isplayer(lf)) { - msg("^WYou are nauseated by a disgusting stench!"); + msg("^wYou are nauseated by a disgusting stench!"); donesomething = B_TRUE; } else { msg("%s looks very unwell.",lfname); @@ -1497,12 +1494,12 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { donesomething = B_TRUE; break; case F_PAIN: - msg("^%c%s%s skin erupts in stings and burns!",isplayer(lf) ? 'W' : 'n', lfname, getpossessive(lfname)); + msg("^%c%s%s skin erupts in stings and burns!",isplayer(lf) ? 'w' : 'n', lfname, getpossessive(lfname)); donesomething = B_TRUE; break; case F_PARALYZED: if (isplayer(lf)) { - msg("^WYou cannot move!"); + msg("^wYou cannot move!"); } else { msg("%s stops moving!",lfname); } @@ -1743,7 +1740,11 @@ int announceflagloss(lifeform_t *lf, flag_t *f) { } break; case F_ASLEEP: - msg("%s wake%s up.",lfname, isplayer(lf) ? "" : "s"); + if (f->val[1] == NA) { + msg("%s wake%s up.",lfname, isplayer(lf) ? "" : "s"); + } else { + msg("%s stop%s meditating.",lfname, isplayer(lf) ? "" : "s"); + } donesomething = B_TRUE; break; case F_BEINGSTONED: @@ -2025,6 +2026,12 @@ int announceflagloss(lifeform_t *lf, flag_t *f) { donesomething = B_TRUE; } break; + case F_MEDITATES: + if (isplayer(lf)) { + msg("You can no longer meditate instead of sleeping."); + donesomething = B_TRUE; + } + break; case F_NAUSEATED: if (isplayer(lf)) { // don't know if monsters lose it msg("You no longer feel nauseated."); @@ -2086,7 +2093,7 @@ int announceflagloss(lifeform_t *lf, flag_t *f) { /* case F_RESTCOUNT: if (isplayer(lf)) { - msg("Restcount expired."); + msg("restcount expired."); } break; */ @@ -2311,6 +2318,8 @@ int confirm_badfeeling(void) { lifeform_t *askgod(char *prompttext) { lifeform_t *lf = NULL; int i; + char *longdesc; + longdesc = malloc(HUGEBUFLEN * sizeof(char)); initprompt(&prompt, prompttext); prompt.maycancel = B_TRUE; @@ -2320,11 +2329,16 @@ lifeform_t *askgod(char *prompttext) { lf = godlf[i]; real_getlfname(lf, buf, B_FALSE); f = hasflag(lf->flags, F_GODOF); - snprintf(godof, BUFLEN, " (%s of %s)", (f->val[0] == B_FEMALE) ? "Goddess" : "God", f->text); + snprintf(godof, BUFLEN, " (%s of %s)", (f->val[0] == B_FEMALE) ? "goddess" : "god", f->text); strcat(buf, godof); - addchoice(&prompt, tolower(buf[0]), buf, NULL, lf); + + + makedesc_god(lf, longdesc); + addchoice(&prompt, tolower(buf[0]), buf, NULL, lf, longdesc); } + free(longdesc); + getchoice(&prompt); lf = (lifeform_t *)prompt.result; return lf; @@ -2469,7 +2483,7 @@ object_t *doaskobject(obpile_t *op, char *prompt, int *count, int forpickup, int mvwprintw(mainwin, 2, 0, "There is nothing here."); } // wait for key - centre(mainwin, C_WHITE, getmaxy(mainwin)-1, "[Press any key]"); + centre(mainwin, C_WHITE, getmaxy(mainwin)-1, "[press any key]"); getch(); restoregamewindows(); @@ -2520,7 +2534,7 @@ object_t *doaskobject(obpile_t *op, char *prompt, int *count, int forpickup, int if (ok) { mylist[i] = o; myletters[i] = nextlet; - if (++nextlet > 'z') nextlet = 'A'; + if (++nextlet > 'z') nextlet = 'a'; i++; } } // end if ob matches sortorder @@ -2552,11 +2566,11 @@ object_t *doaskobject(obpile_t *op, char *prompt, int *count, int forpickup, int } // draw prompt if (strlen(numstring) > 0) { - mvwprintw(mainwin, 0, 0, "%s (%sESC to quit) [%s]: ",prompt, + mvwprintw(mainwin, 0, 0, "%s (%sesc to quit) [%s]: ",prompt, (opts & AO_INCLUDENOTHING) ? "- for nothing, " : "", numstring); } else { - mvwprintw(mainwin, 0, 0, "%s (%sESC to quit): ", prompt, + mvwprintw(mainwin, 0, 0, "%s (%sesc to quit): ", prompt, (opts & AO_INCLUDENOTHING) ? "- for nothing, " : ""); } if (nextpage != -1) { @@ -2566,7 +2580,7 @@ object_t *doaskobject(obpile_t *op, char *prompt, int *count, int forpickup, int wrefresh(mainwin); // wait for keypess ch = getch(); - if (ch == 27) { // ESCAPE + if (ch == 27) { // escape finished = B_TRUE; break; } @@ -2660,7 +2674,7 @@ int askobjectmulti(obpile_t *op, char *prompt, long opts) { cls(); mvwprintw(mainwin, 2, 0, "You have no possessions."); // wait for key - centre(mainwin,C_WHITE, getmaxy(mainwin)-1, "[Press any key]"); + centre(mainwin,C_WHITE, getmaxy(mainwin)-1, "[press any key]"); getch(); restoregamewindows(); @@ -2702,7 +2716,7 @@ int askobjectmulti(obpile_t *op, char *prompt, long opts) { myletters[i] = nextlet; selected[i] = B_FALSE; selcount[i] = 0; - if (++nextlet > 'z') nextlet = 'A'; + if (++nextlet > 'z') nextlet = 'a'; i++; } } @@ -2749,11 +2763,11 @@ int askobjectmulti(obpile_t *op, char *prompt, long opts) { mvwprintw(mainwin, y, 0, MORESTRING); } if (strlen(numstring) > 0) { - snprintf(pbuf, BUFLEN,"%s (%s','=all, ESC to quit) [%s]: ",prompt, + snprintf(pbuf, BUFLEN,"%s (%s','=all, esc to quit) [%s]: ",prompt, (opts & AO_INCLUDENOTHING) ? "- for nothing, " : "", numstring); } else { - snprintf(pbuf, BUFLEN,"%s (%sESC to quit): ", prompt, + snprintf(pbuf, BUFLEN,"%s (%sesc to quit): ", prompt, (opts & AO_INCLUDENOTHING) ? "- for nothing, " : ""); } @@ -2774,7 +2788,7 @@ int askobjectmulti(obpile_t *op, char *prompt, long opts) { wrefresh(mainwin); // wait for keypess ch = getch(); - if (ch == 27) { // ESCAPE + if (ch == 27) { // escape finished = B_TRUE; break; } @@ -2891,10 +2905,10 @@ vault_t *askvault(char *prompttext) { // make list of all vaults initprompt(&prompt, prompttext); for (v = firstvault ; v ; v = v->next) { - addchoice(&prompt, 'a', v->id, NULL, v); + addchoice(&prompt, 'a', v->id, NULL, v, NULL); } if (prompt.nchoices == 0) { - msg("Error - no vaults found."); + msg("error - no vaults found."); return NULL; } getchoicestr(&prompt, B_FALSE, B_TRUE); @@ -2949,9 +2963,9 @@ int chartodir(char c) { char checkforkey(void) { char ch; - nodelay(mainwin, TRUE); + nodelay(mainwin, true); ch = getch(); - nodelay(mainwin, FALSE); + nodelay(mainwin, false); if (ch == ERR) ch = '\0'; if (ch == ' ') ch = '\0'; @@ -3071,18 +3085,17 @@ void cls(void) { } void describegod(lifeform_t *god) { - char buf[BUFLEN]; + char buf[BUFLEN], *buf2; char godname[BUFLEN]; char goddesc[BUFLEN]; - int i; - flag_t *f, *retflag[MAXCANDIDATES]; - int nretflags; + flag_t *f; + cls(); assert(god); f = hasflag(god->flags, F_GODOF); real_getlfname(god, godname, B_FALSE); - snprintf(goddesc, BUFLEN, "(%s of %s)", (f->val[0] == B_FEMALE) ? "Goddess" : "God", f->text); + snprintf(goddesc, BUFLEN, "(%s of %s)", (f->val[0] == B_FEMALE) ? "goddess" : "god", f->text); // title snprintf(buf, BUFLEN, "God::%s %s",godname, goddesc); @@ -3091,54 +3104,11 @@ void describegod(lifeform_t *god) { wattroff(mainwin, A_BOLD); wmove(mainwin, 2, 0); - wprintw(mainwin, "%s likes ", godname); - getflags(god->flags, retflag, &nretflags, F_GODLIKES, F_NONE); - for (i = 0; i < nretflags; i++) { - f = retflag[i]; - if (i == 0) { - wprintw(mainwin, "%s", f->text); - } else if (i == nretflags - 1) { - wprintw(mainwin, " and %s", f->text); - } else { - wprintw(mainwin, ", %s", f->text); - } - } - wprintw(mainwin, ".\n\n"); - wprintw(mainwin, "%s dislikes ", godname); - getflags(god->flags, retflag, &nretflags, F_GODDISLIKES, F_NONE); - for (i = 0; i < nretflags; i++) { - f = retflag[i]; - if (i == 0) { - wprintw(mainwin, "%s", f->text); - } else if (i == nretflags - 1) { - wprintw(mainwin, " and %s", f->text); - } else { - wprintw(mainwin, ", %s", f->text); - } - } - wprintw(mainwin, ".\n\n"); - getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_SACRIFICEOBCLASS, F_NONE); - if (nretflags == 0) { - wprintw(mainwin, "%s does not accept sacrifices.\n", godname); - } else { - int i; - getflags(god->flags, retflag, &nretflags, F_SACRIFICEOBCLASS, F_NONE); - for (i = 0; i < nretflags; i++) { - objectclass_t *oc; - oc = findoc(retflag[i]->val[0]); - wprintw(mainwin, "%s accepts the sacrifice of all %s.\n",godname, oc->name); - } - getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_NONE); - for (i = 0; i < nretflags; i++) { - objecttype_t *ot; - if (i == 0) { - wprintw(mainwin, "%s accepts the sacrifice of:\n", godname); - } - ot = findot(retflag[i]->val[0]); - wprintw(mainwin, "- %s\n", ot->name); - } - } + buf2 = malloc(HUGEBUFLEN * sizeof(char)); + makedesc_god(god, buf2); + textwithcol(mainwin, buf2); + free(buf2); wrefresh(mainwin); @@ -3150,873 +3120,22 @@ void describegod(lifeform_t *god) { void describeob(object_t *o) { char buf[BIGBUFLEN]; - char buf2[BUFLEN]; - int y; - flag_t *f; - int obknown; - int i; - int throwrange; - flag_t *retflag[MAXCANDIDATES]; - int nretflags; + char *buf2; cls(); - obknown = isknown(o); // title getobname(o, buf,o->amt); wattron(mainwin, A_BOLD); mvwprintw(mainwin, 0, 0, buf); wattroff(mainwin, A_BOLD); - // description - getobdesc(o, buf); - mvwprintw(mainwin, 2, 0, buf); - - // append masterwork etc onto description - f = hasflag(o->flags, F_MASTERWORK); - if (f && f->known) { - wprintw(mainwin, " It is extremely well crafted."); - } - f = hasflag(o->flags, F_SHODDY); - if (f && f->known) { - wprintw(mainwin, " It is very poorly crafted."); - } - - - // weight - y = 4; - if (o->material->id != MT_NOTHING) { - if (o->material->id == MT_FOOD) { - snprintf(buf, BUFLEN, "%s %s food product%s, ",(o->amt == 1) ? "It is a" : "They are", - getsizetext(getobsize(o)), - (o->amt == 1) ? "" : "s"); - } else { - snprintf(buf, BUFLEN, "%s %s sized, made from %s, ",(o->amt == 1) ? "It is" : "They are", - getsizetext(getobsize(o)), - o->material->name); - } - - if (o->amt == 1) { - char wbuf[BUFLEN]; - getweighttext(getobweight(o), wbuf, B_FALSE); - snprintf(buf2, BUFLEN, "and weighs %s.",wbuf); - strcat(buf, buf2); - } else { - char wbuf[BUFLEN]; - char wbuf2[BUFLEN]; - getweighttext(getobweight(o), wbuf, B_FALSE); - getweighttext(getobunitweight(o), wbuf2, B_FALSE); - snprintf(buf2, BUFLEN, "and weigh %s (%s each).",wbuf, wbuf2); - strcat(buf, buf2); - } - mvwprintw(mainwin, y, 0, "%s",buf); - y++; - - throwrange = getmaxthrowrange(player, o); - if (throwrange >= 1) { - mvwprintw(mainwin, y, 0, " You could throw %s %d metres.",(o->amt == 1) ? "it" : "one", throwrange); - } else { - mvwprintw(mainwin, y, 0, " It is too heavy for you to throw."); - } - y++; - - f = hasflag(o->flags, F_THROWMISSILE); - if (f) { - if (lfhasflag(player, F_EXTRAINFO) || lfhasflag(player, F_OMNIPOTENT)) { - int dam; - dam = getthrowdam(o); - mvwprintw(mainwin, y, 0, " %s good for throwing [base damage %d].",(o->amt == 1) ? "It is" : "They are", dam); - } else { - mvwprintw(mainwin, y, 0, " %s good for throwing.", (o->amt == 1) ? "It is" : "They are"); - } - y++; - } - } - - if (isedible(o)) { - int basenutr; - basenutr = getnutritionbase(o); - mvwprintw(mainwin, y, 0, "%s edible, and %s %s.", - (o->amt == 1) ? "It is" : "They are", - (o->amt == 1) ? "is" : "are each", - getfillingname(basenutr)); - y++; - if (hasflagval(o->flags, F_OBHPDRAIN, NA, DT_DECAY, NA, NULL)) { - // don't show "it will rot" if it's already rotten (and you know this) - if (isrotting(o) && ( (getattrbracket(getattr(player, A_IQ), A_IQ, NULL) >= AT_GTAVERAGE) || getskill(player, SK_COOKING)) ) { - } else { - mvwprintw(mainwin, y, 0, "%s will decay and go bad over time.", (o->amt == 1) ? "It" : "They" ); - y++; - } - } - } - - - // weapons? - if (isfirearm(o)) { - flag_t *ff, *ff2; - mvwprintw(mainwin, y, 0, "It is a %s firearm.", hasflag(o->flags, F_TWOHANDED) ? "two-handed" : "single handed"); - y++; - f = hasflag(o->flags, F_ACCURACY); - if (f) { - int acc; - acc = getobaccuracy(o, NULL); - mvwprintw(mainwin, y, 0, " It has %s accuracy.",getaccuracyname(acc)); - y++; - } - f = hasflag(o->flags, F_RANGE); - if (f) { - mvwprintw(mainwin, y, 0, " Its maximum range is %d.",f->val[0]); - y++; - } - f = hasflag(o->flags, F_AMMOCAPACITY); - if (f) { - mvwprintw(mainwin, y, 0, " It can hold up to %d of the following kind(s) of ammo:",f->val[0]); - y++; - strcpy(buf, ""); - - getflags(o->flags, retflag, &nretflags, F_AMMOOB, F_NONE); - for (i = 0; i < nretflags; i++) { - objecttype_t *ot; - ff = retflag[i]; - ot = findot(ff->val[0]); - if (ot) { - if (streq(buf, "")) { - snprintf(buf, BUFLEN, " %s",ot->name); - } else { - if (strlen(buf) >= 60) { - mvwprintw(mainwin, y, 0, "%s",buf); y++; - snprintf(buf, BUFLEN, " %s",ot->name); - } else { - strcat(buf, ", "); - strcat(buf, ot->name); - } - } - } - } - if (strlen(buf)) { - mvwprintw(mainwin, y, 0, "%s",buf); y++; - } - } - ff = hasflag(o->flags, F_FIRESPEED); - if (ff) { - mvwprintw(mainwin, y, 0, " It fires at a speed of %d km/h.",speedtokph(ff->val[0])); - y++; - } - ff = hasflag(o->flags, F_FIRETURNS); - ff2 = hasflag(o->flags, F_RELOADTURNS); - mvwprintw(mainwin, y, 0, " It takes %d turn%s to fire, and %d turn%s to reload.", - ff->val[0], (ff->val[0] == 1) ? "" : "s", - ff2->val[0], (ff2->val[0] == 1) ? "" : "s"); - y++; - } else if (o->type->obclass->id == OC_WEAPON) { - flag_t *damflag; - int delay; - int critchance; - snprintf(buf, BUFLEN, "It is a %s weapon", hasflag(o->flags, F_TWOHANDED) ? "two-handed" : "single handed"); - damflag = hasflag(o->flags, F_DAM); - if (damflag) { - int bonus = 0; - char buf2[BUFLEN]; - int mindam,maxdam; - enum DAMTYPE damtype; - - f = hasflag(o->flags, F_BONUS); - if (f && f->known) { - // only tell player about bonuses if they are known.! - bonus = f->val[0]; - } - - damtype = damflag->val[0]; - getdamrange(damflag, &mindam, &maxdam); - mindam += bonus; - maxdam += bonus; - if (mindam < 0) mindam = 0; - if (maxdam < 0) maxdam = 0; - - if (mindam == maxdam) { - snprintf(buf2, BUFLEN, " which inflicts %d %s damage",maxdam, getdamname(damtype)); - } else { - snprintf(buf2, BUFLEN, " which inflicts %d-%d %s damage",mindam,maxdam, getdamname(damtype)); - } - strcat(buf, buf2); - - //dicetotext(f->val[0], f->val[1], f->val[2], NULL, NULL, dicebuf, NULL); - - strcat(buf, " ("); - strcat(buf, damflag->text); // ie. 2d6 - strcat(buf, ")."); - - mvwprintw(mainwin, y, 0, "%s",buf); - y++; - - // other extra damage or effects? - f = hasflag(o->flags, F_ONFIRE); - if (f) { - if (f->text) { - mvwprintw(mainwin, y, 0, " It also inflicts %s extra burning damage.", f->text); - } else { - mvwprintw(mainwin, y, 0, " It also inflicts extra burning damage."); - } - y++; - } - } else { - mvwprintw(mainwin, y, 0, "%s.", buf); - y++; - } - - delay = 100; - f = hasflag(o->flags, F_OBATTACKDELAY); - if (f) { - delay = f->val[0]; - } - mvwprintw(mainwin, y, 0, " Its attack delay is %d%%.",delay - 100); - y++; - - critchance = getcritchance(player, o, NULL); - if (critchance > 0) { - mvwprintw(mainwin, y, 0, " You have a %d%% critical hit chance with it.", critchance); - y++; - } - - f = hasflag(o->flags, F_ACCURACY); - if (f) { - int acc; - acc = getobaccuracy(o, NULL); - mvwprintw(mainwin, y, 0, " It has %s accuracy.",getaccuracyname(acc)); - y++; - } - f = hasflag(o->flags, F_DISARMATTACK); - if (f) { - mvwprintw(mainwin, y, 0, " A skilled weilder can disarm opponents with it."); - y++; - } - f = hasflag(o->flags, F_TRIPATTACK); - if (f) { - mvwprintw(mainwin, y, 0, " A skilled weilder can trip opponents with it."); - y++; - } - f = hasflag(o->flags, F_ARMOURPIERCE); - if (f && f->known) { - mvwprintw(mainwin, y, 0, " Armour will not reduce %s damage.",(o->amt == 1) ? "its" : "their"); - y++; - } - - - } - // damage - if (isarmour(o)) { - f = hasflag(o->flags, F_GOESON); - if (f) { - snprintf(buf, BUFLEN, "It is worn %s your %s, ",getbodypartequipname(f->val[0]), getbodypartname(f->val[0])); - } else { - strcpy(buf, ""); - } - f = hasflag(o->flags, F_ARMOURRATING); - if (f) { - if (strlen(buf)) { - snprintf(buf2, BUFLEN, "and has an Armour Rating of %d.",f->val[0] + getobbonus(o)); - strcat(buf, buf2); - } else { - snprintf(buf, BUFLEN, "It has an Armour Rating of %d.",f->val[0] + getobbonus(o)); - } - } else { - if (strlen(buf)) { - snprintf(buf2, BUFLEN, "and provides no protection."); - strcat(buf, buf2); - } - } - mvwprintw(mainwin, y, 0, "%s",buf); - y++; - - f = hasflag(o->flags, F_EVASION); - if (f) { - int evmod; - evmod = adjustarmourpenalty(player, f->val[0]); - if (evmod != 0) { - snprintf(buf, BUFLEN, " When worn, it %s your evasion chance by %d%%.", (evmod < 0) ? "reduces" : "increases", abs(evmod)); - mvwprintw(mainwin, y, 0, "%s",buf); - y++; - } - } - - f = hasflag(o->flags, F_ACCURACYMOD); - if (f) { - mvwprintw(mainwin, y, 0, " It will %s your evasion chance by %d%%.", - (f->val[0] < 0) ? "lower" : "raise", abs(f->val[0])); - y++; - } - - f = hasflag(o->flags, F_SCARY); - if (f) { - mvwprintw(mainwin, y, 0, " It may unnerve others when worn."); - y++; - } - } else { - // non armour, but still wearable. - f = hasflag(o->flags, F_GOESON); - if (f) { - snprintf(buf, BUFLEN, "It is worn %s your %s. ",getbodypartequipname(f->val[0]), getbodypartname(f->val[0])); - mvwprintw(mainwin, y, 0, "%s",buf); - y++; - } - } - - if (hasflag(o->flags, F_DAMAGABLE) && isarmour(o) ) { - int showfullhp = B_FALSE; - char hpbuf[BUFLEN]; - f = hasflag(o->flags, F_OBHP); - if (isarmour(o) && getskill(player, SK_ARMOUR)) { - showfullhp = B_TRUE; - } else if (isshield(o) && getskill(player, SK_SHIELDS)) { - showfullhp = B_TRUE; - } else if ((o->type->material->id == MT_METAL) && getskill(player, SK_METALWORK)) { - showfullhp = B_TRUE; - } else if ( ((o->type->material->id == MT_LEATHER) || (o->type->material->id == MT_CLOTH)) && - getskill(player, SK_SEWING)) { - showfullhp = B_TRUE; - } - - if (isdamaged(o)) { - snprintf(buf, BUFLEN, "It has been damaged."); - } else { - snprintf(buf, BUFLEN, "It is in perfect condition."); - } - if (showfullhp) { - int pct; - pct = (int)(((float)f->val[0] / (float)f->val[1]) * 100.0); - snprintf(hpbuf, BUFLEN, " [%d%%, %d/%d hp]", pct, f->val[0], f->val[1]); - } else if (isdamaged(o)) { - int pct; - pct = (int)(((float)f->val[0] / (float)f->val[1]) * 100.0); - snprintf(hpbuf, BUFLEN, " [%d%% hp]", pct); - } else { - strcpy(hpbuf, ""); - } - strcat(buf, hpbuf); - mvwprintw(mainwin, y, 0, "%s", buf); - y++; - } - - // charges remaining - if (o->type->obclass->id == OC_WAND) { - if (isidentified(o)) { - int charges; - charges = getcharges(o); - if (charges) { - mvwprintw(mainwin, y, 0, "It has %d charges left.",charges); - } else { - mvwprintw(mainwin, y, 0, "It has no charges left."); - } - y++; - } - } else if (o->type->obclass->id == OC_GODSTONE) { - if (isidentified(o)) { - int charges,max; - getchargeinfo(o, &charges, &max); - if (charges == max) { - mvwprintw(mainwin, y, 0, "It is fully charged."); - } else { - mvwprintw(mainwin, y, 0, "It is depleted."); - } - y++; - } - } - - f = hasflag(o->flags, F_PICKLOCKS); - if (f) { - mvwprintw(mainwin, y, 0, "You can use it to pick locks."); - y++; - } - - f = hasflag(o->flags, F_HELPSCLIMB); - if (f) { - mvwprintw(mainwin, y, 0, "It can be used to assist in climbing."); - y++; - } - - - // skip line - y++; - - // been made invulnerable ? - if (hasflagknown(o->type->flags, F_INVULNERABLE) && !hasflag(o->flags, F_DAMAGABLE)) { - mvwprintw(mainwin, y, 0, "It is invulnerable to most damage."); - y++; - } else { - // immunities - strcpy(buf, ""); - f = hasflagval(o->flags, F_DTIMMUNE, DT_ALL, NA, NA, NULL); - if (f) { - snprintf(buf, BUFLEN, "It is immune to %s", getdamname(DT_ALL)); - } else { - int first = B_TRUE; - for (i = 0; i < MAXDAMTYPE; i++) { - f = isimmuneto(o->flags, i); - if (f) { - char buf2[BUFLEN]; - if (first) { - snprintf(buf2, BUFLEN, "It is immune to: %s", getdamname(i)); - first = B_FALSE; - } else { - snprintf(buf2, BUFLEN, ", %s", getdamname(i)); - } - strcat(buf, buf2); - } - } - } - if (strlen(buf) > 0) { - strcat(buf, "."); - mvwprintw(mainwin, y, 0, buf); - y++; - } - - // resistances - strcpy(buf, ""); - f = hasflagval(o->flags, F_DTRESIST, DT_ALL, NA, NA, NULL); - if (f) { - snprintf(buf, BUFLEN, "It is resistant to %s", getdamname(DT_ALL)); - } else { - int first = B_TRUE; - for (i = 0; i < MAXDAMTYPE; i++) { - f = isresistantto(o->flags, i); - if (f) { - char buf2[BUFLEN]; - if (first) { - snprintf(buf2, BUFLEN, "It is resistant to: %s", getdamname(i)); - first = B_FALSE; - } else { - snprintf(buf2, BUFLEN, ", %s", getdamname(i)); - } - strcat(buf, buf2); - } - } - } - if (strlen(buf) > 0) { - strcat(buf, "."); - mvwprintw(mainwin, y, 0, buf); - y++; - } - - // vulnerabilities - strcpy(buf, ""); - f = hasflagval(o->flags, F_DTVULN, DT_ALL, NA, NA, NULL); - if (f) { - snprintf(buf, BUFLEN, "It is vulnerable to %s", getdamname(DT_ALL)); - } else { - int first = B_TRUE; - for (i = 0; i < MAXDAMTYPE; i++) { - f = isvulnto(o->flags, i); - if (f) { - char buf2[BUFLEN]; - if (first) { - snprintf(buf2, BUFLEN, "It is vulnerable to: %s", getdamname(i)); - first = B_FALSE; - } else { - snprintf(buf2, BUFLEN, ", %s", getdamname(i)); - } - strcat(buf, buf2); - } - } - } - if (strlen(buf) > 0) { - strcat(buf, "."); - mvwprintw(mainwin, y, 0, buf); - y++; - } - } - - - for (f = o->flags->first ; f ; f = f->next) { - if ((f->id == F_HITCONFER) && (f->val[0] == F_POISONED) && (f->lifetime == FROMOBMOD)) { - mvwprintw(mainwin, y, 0, "It has been coated with poison."); - y++; - } - } - - - // skip line - y++; - - - // physical properties - - f = hasflag(o->flags, F_ONFIRE); - if (f) { - mvwprintw(mainwin, y, 0, "It is on fire."); - y++; - } - - if (obproduceslight(o)) { - mvwprintw(mainwin, y, 0, "It is producing light."); - y++; - } - - f = hasflag(o->flags, F_RUSTED); - if (f) { - mvwprintw(mainwin, y, 0, "It is rusty."); - y++; - } - - f = hasflag(o->flags, F_WATERPROOF); - if (f) { - mvwprintw(mainwin, y, 0, "It is waterproof."); - y++; - } - f = hasflag(o->flags, F_WET); - if (f) { - mvwprintw(mainwin, y, 0, "It is wet."); - y++; - } - - f = hasflag(o->flags, F_ACTIVATED); - if (f) { - mvwprintw(mainwin, y, 0, "It is activated."); - y++; - } - - - // if known, show what it confers - for (f = o->flags->first ; f ; f = f->next) { - if ((f->id == F_HOLDCONFER) || (f->id == F_EQUIPCONFER) || (f->id == F_ACTIVATECONFER)) { - if (obknown) { - objecttype_t *ot; - if (f->id == F_HOLDCONFER) strcpy(buf, "When held, it"); - else if (f->id == F_ACTIVATECONFER) strcpy(buf, "When activated, it"); - else if (f->id == F_HITCONFER) strcpy(buf, "When hit by it, it"); - else strcpy(buf, "When equipped, it"); - - // conferred intrinsics - switch (f->val[0]) { - int amt,amt2; - case F_ARMOURPENALTY: - amt = adjustarmourpenalty(player, f->val[1]); - amt2 = adjustarmourpenalty(player, f->val[2]); - if (amt > 0) { - setcol(mainwin, C_RED); - mvwprintw(mainwin, y, 0, "%s lowers your accuracy by %d%%. (Armour skill penalty)", buf, amt); y++; - unsetcol(mainwin, C_RED); - } - if (amt2 > 0) { - setcol(mainwin, C_RED); - mvwprintw(mainwin, y, 0, "%s lowers your evasion by %d%%. (Armour skill penalty)", buf, amt2); y++; - unsetcol(mainwin, C_RED); - } - break; - case F_SHIELDPENALTY: - amt = adjustshieldpenalty(player, f->val[1]); - amt2 = adjustshieldpenalty(player, f->val[2]); - if (amt > 0) { - setcol(mainwin, C_RED); - mvwprintw(mainwin, y, 0, "%s lowers your attack accuracy by %d%%. (Shields skill too low)", buf, amt); y++; - unsetcol(mainwin, C_RED); - } - if (amt2 > 0) { - setcol(mainwin, C_RED); - mvwprintw(mainwin, y, 0, "%s lowers your evasion by %d%%. (Shields skill penalty)", buf, amt2); y++; - unsetcol(mainwin, C_RED); - } - break; - case F_ATTRMOD: - mvwprintw(mainwin, y, 0, "%s %s your %s.", buf, (f->val[2] > 0) ? "increases" : "decreases", getattrname(f->val[1])); y++; - break; - case F_ATTRSET: - mvwprintw(mainwin, y, 0, "%s modifies your %s.", buf, getattrname(f->val[1])); y++; - break; - case F_AWARENESS: - mvwprintw(mainwin, y, 0, "%s grants you enhanced awareness.", buf); y++; - break; - case F_BLIND: - mvwprintw(mainwin, y, 0, "%s prevents you from seeing anything.", buf); y++; - break; - case F_BREATHWATER: - mvwprintw(mainwin, y, 0, "%s allows you to breath normally while underwater.", buf); y++; - break; - case F_CONTROL: - mvwprintw(mainwin, y, 0, "%s lets you control teleportation and polymorphic effects.", buf); y++; - break; - case F_DEAF: - mvwprintw(mainwin, y, 0, "%s prevents you from hearing anything.", buf); y++; - break; - case F_DETECTLIFE: - mvwprintw(mainwin, y, 0, "%s will detect nearby lifeforms.", buf); y++; - break; - case F_DETECTOBS: - mvwprintw(mainwin, y, 0, "%s will detect nearby objects.", buf); y++; - break; - case F_DETECTMAGIC: - mvwprintw(mainwin, y, 0, "%s will detect magical enchantments on objects.", buf); y++; - break; - case F_DETECTMETAL: - mvwprintw(mainwin, y, 0, "%s will detect nearby metal.", buf); y++; - break; - case F_ENHANCESEARCH: - mvwprintw(mainwin, y, 0, "%s enhances your searching ability.", buf); y++; - break; - case F_ENHANCESMELL: - mvwprintw(mainwin, y, 0, "%s enhances your sense of smell.", buf); y++; - break; - case F_DISEASEIMMUNE: - mvwprintw(mainwin, y, 0, "%s makes you immune to disease.", buf); y++; - break; - case F_DRUNK: - mvwprintw(mainwin, y, 0, "%s makes you tipsy.", buf); y++; - break; - case F_EXTRAINFO: - mvwprintw(mainwin, y, 0, "%s provides enhanced knowledge to you.", buf); y++; - break; - case F_EXTRADAM: - mvwprintw(mainwin, y, 0, "%s will cause you to deal more damage.", buf); y++; - break; - case F_EXTRALUCK: - mvwprintw(mainwin, y, 0, "%s will give you a bonus to all skill checks.", buf); y++; - break; - case F_EXTRAMP: - mvwprintw(mainwin, y, 0, "%s will increase your mana pool by %d%%.", buf, f->val[0]); y++; - break; - case F_FASTACT: - mvwprintw(mainwin, y, 0, "%s will speed up your actions.", buf); y++; - break; - case F_FASTMETAB: - mvwprintw(mainwin, y, 0, "%s will increase your metabolic rate.", buf); y++; - break; - case F_FASTMOVE: - mvwprintw(mainwin, y, 0, "%s will speed up your movement.", buf); y++; - break; - case F_FLYING: - mvwprintw(mainwin, y, 0, "%s will allow you to fly.", buf); y++; - break; - case F_FREEZINGTOUCH: - mvwprintw(mainwin, y, 0, "%s will cause objects you touch to turn to ice.", buf); y++; - break; - case F_FROZEN: - mvwprintw(mainwin, y, 0, "%s turns you to ice.", buf); y++; - break; - case F_GRAVBOOSTED: - mvwprintw(mainwin, y, 0, "%s increases gravity around you.", buf); y++; - break; - case F_GRAVLESSENED: - mvwprintw(mainwin, y, 0, "%s decreases gravity around you.", buf); y++; - break; - case F_DODGES: - mvwprintw(mainwin, y, 0, "%s allows you to dodge attacks.", buf); y++; - break; - case F_INVISIBLE: - mvwprintw(mainwin, y, 0, "%s renders you invisible to normal sight.", buf); y++; - break; - case F_INVULNERABLE: - mvwprintw(mainwin, y, 0, "%s protects you from all physical harm.", buf); y++; - break; - case F_CANWILL: - ot = findot(f->val[1]); - if (ot) { - strcpy(buf2, ot->name); - capitalise(buf2); - mvwprintw(mainwin, y, 0, "%s allows you to cast '%s' at will.", buf, buf2); y++; - } - break; - case F_CAFFEINATED: - mvwprintw(mainwin, y, 0, "%s acts as a stimulant.", buf); y++; - break; - case F_CANCAST: - ot = findot(f->val[1]); - if (ot) { - strcpy(buf2, ot->name); - capitalise(buf2); - mvwprintw(mainwin, y, 0, "%s allows you to cast '%s'.", buf, buf2); y++; - } - break; - case F_DETECTAURAS: - mvwprintw(mainwin, y, 0, "%s allows you to detect blessings or curses.", buf); y++; - break; - case F_HOLYAURA: - mvwprintw(mainwin, y, 0, "%s surrounds you with a holy aura.", buf); y++; - break; - case F_LEVITATING: - mvwprintw(mainwin, y, 0, "%s causes you to levitate.", buf); y++; - break; - case F_MAGSHIELD: - mvwprintw(mainwin, y, 0, "%s surrounds you with a magnetic shield.", buf); y++; - break; - case F_NAUSEATED: - mvwprintw(mainwin, y, 0, "%s causes you to feel nauseated.", buf); y++; - break; - case F_NONCORPOREAL: - mvwprintw(mainwin, y, 0, "%s makes you non-corporeal.", buf); y++; - break; - case F_PAIN: - mvwprintw(mainwin, y, 0, "%s causes you intense pain.", buf); y++; - break; - case F_PARALYZED: - mvwprintw(mainwin, y, 0, "%s paralyzes you.", buf); y++; - break; - case F_PHOTOMEM: - mvwprintw(mainwin, y, 0, "%s prevents you from forgetting your surroundings.", buf); y++; - break; - case F_STABILITY: - mvwprintw(mainwin, y, 0, "%s prevents you from slipping over.", buf); y++; - break; - case F_STENCH: - mvwprintw(mainwin, y, 0, "%s makes you smell bad.", buf); y++; - break; - case F_PRODUCESLIGHT: - mvwprintw(mainwin, y, 0, "%s produces light.", buf); y++; - break; - case F_RETALIATE: - mvwprintw(mainwin, y, 0, "%s protects you with %s.", buf, f->text); y++; - break; - case F_RAGE: - mvwprintw(mainwin, y, 0, "%s makes you enraged.", buf); y++; - break; - case F_REGENERATES: - if (f->val[1] == 1) { - strcpy(buf2, ""); - } else if (f->val[1] == 2) { - strcpy(buf2, "quickly"); - } else if (f->val[1] == 3) { - strcpy(buf2, "very quickly"); - } else { // >= 4 - strcpy(buf2, "extremely quickly"); - } - mvwprintw(mainwin, y, 0, "%s allows you to regenerate health%s.", buf,buf2); y++; - break; - case F_RESISTMAG: - mvwprintw(mainwin, y, 0, "%s grants you %s immunity to magic.", buf, - (f->val[0] >= 10) ? "strong" : "minor"); y++; - break; - case F_RISEASGHOST: - mvwprintw(mainwin, y, 0, "%s cause you to rise as a ghost after death.", buf); y++; - break; - case F_SEEINVIS: - mvwprintw(mainwin, y, 0, "%s allows you to see invisible things.", buf); y++; - break; - case F_SEEINDARK: - mvwprintw(mainwin, y, 0, "%s allows you to see in the dark.", buf); y++; - break; - case F_SILENTMOVE: - mvwprintw(mainwin, y, 0, "%s allows you to move silently.", buf); y++; - break; - case F_SLOWACT: - mvwprintw(mainwin, y, 0, "%s will slow down your actions.", buf); y++; - break; - case F_SLOWMETAB: - mvwprintw(mainwin, y, 0, "%s will decrease your metabolic rate.", buf); y++; - break; - case F_SLOWMOVE: - mvwprintw(mainwin, y, 0, "%s will slow down your movement.", buf); y++; - break; - case F_TREMORSENSE: - mvwprintw(mainwin, y, 0, "%s allows you to 'see' by sensing vibrations around you.", buf); y++; - break; - case F_TRUESTRIKE: - mvwprintw(mainwin, y, 0, "%s makes your attacks automatically hit.", buf); y++; - break; - case F_WINDSHIELD: - mvwprintw(mainwin, y, 0, "%s will surround you with a cyclonic shield.", buf); y++; - break; - case F_VISRANGEMOD: - mvwprintw(mainwin, y, 0, "%s %s your vision range.", buf, (f->val[1] > 0) ? "increases" : "descreases"); y++; - break; - case F_XRAYVIS: - mvwprintw(mainwin, y, 0, "%s allows you to see through walls.", buf); y++; - break; - } - } - } - } - - // show special properties where known - f = hasflag(o->flags, F_BALANCE); - if (f && f->known) { - mvwprintw(mainwin, y, 0, "It heals weaker enemies, and does extra damage to stronger ones."); - y++; - } - f = hasflag(o->flags, F_FLAMESTRIKE); - if (f && f->known) { - mvwprintw(mainwin, y, 0, "It ignites fires wherever it hits."); - y++; - } - f = hasflag(o->flags, F_HEAVYBLOW); - if (f && f->known) { - mvwprintw(mainwin, y, 0, "Its powerful blows knock enemies backwards."); - y++; - } - f = hasflag(o->flags, F_REVENGE); - if (f && f->known) { - mvwprintw(mainwin, y, 0, "It does more damage as your HP are lowered."); - y++; - } - - // requirements - i = B_FALSE; - for (f = o->flags->first ; f ; f = f->next) { - if (f->id == F_ATTREQ) { - int usable = B_TRUE; - if (!meetsattreq(player, f, o)) { - usable = B_FALSE; - } - if (!usable) setcol(mainwin, C_RED); - mvwprintw(mainwin, y, 0, "It requires at least %d %s to use.", f->val[1], getattrname(f->val[0])); - y++; - if (!usable) unsetcol(mainwin, C_RED); - i = B_TRUE; - } - } - - // blank line - y++; - - - // skill type? - f = hasflag(o->flags, F_USESSKILL); - if (f && (f->val[0] != SK_NONE)) { - enum SKILLLEVEL slev; - enum COLOUR col; - slev = getskill(player, f->val[0]); - mvwprintw(mainwin, y, 0, "It falls into the '%s' category (your skill: ",getskillname(f->val[0])); - col = getskilllevelcolour(slev); - setcol(mainwin, col); - wprintw(mainwin, "%s", getskilllevelname(getskill(player, f->val[0])) ); - unsetcol(mainwin, col); - wprintw(mainwin, ")"); - y++; - } - - if (hasflag(o->flags, F_NOBLESS)) { - mvwprintw(mainwin, y, 0, "%s cannot be blessed or cursed.", (o->amt == 1) ? "It" : "They" ); - y++; - } else { - if (isblessknown(o)) { - if (o->blessed == B_BLESSED) { - mvwprintw(mainwin, y, 0, "%s a blessing bestowed upon %s.", - (o->amt == 1) ? "It has" : "They have", - (o->amt == 1) ? "it" : "them"); - y++; - } else if (o->blessed == B_CURSED) { - mvwprintw(mainwin, y, 0, "%s cursed.", - (o->amt == 1) ? "It is" : "They are"); - y++; - } - } else { - mvwprintw(mainwin, y, 0, "%s might be blessed or cursed.", - (o->amt == 1) ? "It" : "They"); - y++; - } - } - - if (o->contents->first) { - object_t *oo; - y++; // skip line - mvwprintw(mainwin, y, 0, "%s currently contain%s:", - (o->amt == 1) ? "It" : "They", - (o->amt == 1) ? "s" : ""); - y++; - for (oo = o->contents->first ;oo ; oo = oo->next) { - getobname(oo, buf, oo->amt); - mvwprintw(mainwin, y, 0, " - %s", buf); y++; - } - } + wmove(mainwin, 2, 0); + buf2 = malloc(HUGEBUFLEN * sizeof(char)); + makedesc_ob(o, buf2); + textwithcol(mainwin, buf2); + free(buf2); wrefresh(mainwin); @@ -4026,10 +3145,9 @@ void describeob(object_t *o) { } void describeskill(enum SKILL skid) { - skill_t *sk; - enum SKILLLEVEL slev; char buf[BUFLEN]; - int i; + char *buf2; + skill_t *sk; cls(); sk = findskill(skid); if (!sk) return; @@ -4037,25 +3155,15 @@ void describeskill(enum SKILL skid) { // title snprintf(buf, BUFLEN, "Skill::%s",sk->name); wattron(mainwin, A_BOLD); - mvwprintw(mainwin, 0, 0, buf); + mvwprintw(mainwin, 0, 0, "%s", buf); wattroff(mainwin, A_BOLD); - mvwprintw(mainwin, 2, 0,"%s\n\n", sk->desc); + wmove(mainwin, 2, 0); - // descriptions - wmove(mainwin, 4, 0); - for (slev = PR_INEPT; slev <= PR_MASTER; slev++) { - for (i = 0; i < sk->nskilldesc; i++) { - if (sk->skilldesclev[i] == slev) { - if (slev == PR_INEPT) { - snprintf(buf, BUFLEN, "%s\n",sk->skilldesctext[i]); - } else { - snprintf(buf, BUFLEN, "At %s level: %s\n",getskilllevelname(sk->skilldesclev[i]), sk->skilldesctext[i]); - } - textwithcol(mainwin, buf); - } - } - } + buf2 = malloc(HUGEBUFLEN * sizeof(char)); + makedesc_skill(skid, buf2); + textwithcol(mainwin, buf2); + free(buf2); wrefresh(mainwin); @@ -4066,75 +3174,22 @@ void describeskill(enum SKILL skid) { } void describespell(objecttype_t *ot) { + char *buf2; char buf[BUFLEN]; - flag_t *retflag[MAXCANDIDATES], *f; - int nretflags,i,power,range; cls(); - if (ot->obclass->id == OC_SPELL) { - power = getspellpower(player, ot->id); - } else { - power = -1; - } - - range = getspellrange(player, ot->id, power); - // title snprintf(buf, BUFLEN, "%s",ot->name); capitalise(buf); mvwprintw(mainwin, 0, 0, buf); wmove(mainwin, 2, 0); - snprintf(buf, BUFLEN, "%s\n", ot->desc); - textwithcol(mainwin, buf); - getflags(ot->flags, retflag, &nretflags, F_EXTRADESC, F_NONE); - for (i = 0; i < nretflags; i++) { - f = retflag[i]; - snprintf(buf, BUFLEN, "%s\n", f->text); - textwithcol(mainwin, buf); - } - wprintw(mainwin, "\n"); - - // properties - f = hasflag(ot->flags, F_SPELLLEVEL); - if (f) { - flag_t *sf; - sf = hasflag(ot->flags, F_SPELLSCHOOL); - assert(sf); - wprintw(mainwin, "It is a level %d %s spell.\n",f->val[0], getschoolname(sf->val[0])); - } - - i = getmpcost(NULL, ot->id); - if (i > 0) { - if (hasflag(ot->flags, F_ONGOING)) { - wprintw(mainwin, "It takes %d MP to keep active - this is an ongoing cost.\n",i); - } else { - wprintw(mainwin, "It costs %d MP to cast.\n",i); - } - } - - f = hasflag(ot->flags, F_CASTINGTIME); - if (f) { - wprintw(mainwin, "It takes %d turns to cast.\n",f->val[0]); - } else { - wprintw(mainwin, "It takes effect instantly.\n"); - } - - wprintw(mainwin, "\n"); - - if (ot->obclass->id == OC_SPELL) { - if (power > 0) { - wprintw(mainwin, "You can cast it at power level %d (maximum %d).\n",power, getspellmaxpower(ot->id)); - } else { - wprintw(mainwin, "It is too powerful for you to cast (maximum power %d).\n",power, getspellmaxpower(ot->id)); - } - - if (range != UNLIMITED) { - wprintw(mainwin, "At this power, it has a range of %d cell%s.",range, (range == 1) ? "" : "s"); - } - } + buf2 = malloc(HUGEBUFLEN * sizeof(char)); + makedesc_spell(ot, buf2); + textwithcol(mainwin, buf2); + free(buf2); wrefresh(mainwin); @@ -4263,39 +3318,39 @@ void docomms(lifeform_t *lf) { // are they friendly? if (ispetof(lf, player)) { if ((iqb >= IQ_ANIMAL) || isundead(lf)) { - addchoice(&prompt, 'a', "Attack something", NULL, NULL); + addchoice(&prompt, 'a', "Attack something", NULL, NULL, NULL); } if (!isadjacent(lf->cell, player->cell)) { - addchoice(&prompt, 'c', "Come here", NULL, NULL); + addchoice(&prompt, 'c', "Come here", NULL, NULL, NULL); } - addchoice(&prompt, 'g', "Go somewhere", NULL, NULL); + addchoice(&prompt, 'g', "Go somewhere", NULL, NULL, NULL); if (isadjacent(lf->cell, player->cell) && !lfhasflag(lf, F_NOPACK)) { - addchoice(&prompt, 't', "Trade items with me", NULL, NULL); + addchoice(&prompt, 't', "Trade items with me", NULL, NULL, NULL); } if (iqb >= IQ_ANIMAL) { f = isresting(lf); if (f) { - addchoice(&prompt, 'r', "Stop resting.", NULL, NULL); + addchoice(&prompt, 'r', "Stop resting.", NULL, NULL, NULL); } else { - addchoice(&prompt, 'r', "Rest until you are healed.", NULL, NULL); + addchoice(&prompt, 'r', "Rest until you are healed.", NULL, NULL, NULL); } - addchoice(&prompt, '<', "Stay close.", NULL, NULL); - addchoice(&prompt, '>', "Keep your distance.", NULL, NULL); + addchoice(&prompt, '<', "Stay close.", NULL, NULL, NULL); + addchoice(&prompt, '>', "Keep your distance.", NULL, NULL, NULL); } } else if (ishirable(lf) ) { if (lfhasflag(lf, F_ISPRISONER)) { - addchoice(&prompt, 'j', "Join me, and I will help you escape.", NULL, NULL); + addchoice(&prompt, 'j', "Join me, and I will help you escape.", NULL, NULL, NULL); } else { - addchoice(&prompt, 'j', "Join me on my quest!", NULL, NULL); + addchoice(&prompt, 'j', "Join me on my quest!", NULL, NULL, NULL); } } if (isadjacent(lf->cell, player->cell)) { - addchoice(&prompt, 'd', "(donate an item)", NULL, NULL); + addchoice(&prompt, 'd', "(donate an item)", NULL, NULL, NULL); } f = lfhasflag(lf, F_OWNSSHOP); @@ -4305,11 +3360,11 @@ void docomms(lifeform_t *lf) { moneyowing = getowing(player, shopid, NULL); if (moneyowing > 0) { snprintf(buf, BUFLEN, "(pay $%d to the shopkeeper)",moneyowing); - addchoice(&prompt, 'p', buf, NULL, NULL); + addchoice(&prompt, 'p', buf, NULL, NULL, NULL); } } - addchoice(&prompt, 'y', "Yeeeeeaaaargh!", NULL, NULL); - addchoice(&prompt, 'n', "(nothing)", NULL, NULL); + addchoice(&prompt, 'y', "Yeeeeeaaaargh!", NULL, NULL, NULL); + addchoice(&prompt, 'n', "(nothing)", NULL, NULL, NULL); ch = getchoice(&prompt); switch (ch) { @@ -4533,13 +3588,13 @@ void docomms(lifeform_t *lf) { // ask whtehr to give/take initprompt(&prompt, "How will you trade?"); snprintf(buf, BUFLEN, "Give items to %s",lfname); - addchoice(&prompt, 'i', buf, NULL, NULL); + addchoice(&prompt, 'i', buf, NULL, NULL, NULL); snprintf(buf, BUFLEN, "Take items from %s",lfname); - addchoice(&prompt, 'o', buf, NULL, NULL); + addchoice(&prompt, 'o', buf, NULL, NULL, NULL); snprintf(buf, BUFLEN, "Both"); - addchoice(&prompt, 'b', buf, NULL, NULL); + addchoice(&prompt, 'b', buf, NULL, NULL, NULL); snprintf(buf, BUFLEN, "Neither"); - addchoice(&prompt, 'n', buf, NULL, NULL); + addchoice(&prompt, 'n', buf, NULL, NULL, NULL); ch = getchoice(&prompt); switch (ch) { case 'i': @@ -5051,6 +4106,1091 @@ void dolook(cell_t *where, int onpurpose) { } } +char *makedesc_god(lifeform_t *god, char *retbuf) { + char thisline[BUFLEN]; + char godname[BUFLEN]; + flag_t *f, *retflag[MAXCANDIDATES]; + int nretflags,i; + + f = hasflag(god->flags, F_GODOF); + real_getlfname(god, godname, B_FALSE); + + strcpy(retbuf, ""); + + // title + sprintf(thisline, "%s likes ", godname); + getflags(god->flags, retflag, &nretflags, F_GODLIKES, F_NONE); + for (i = 0; i < nretflags; i++) { + f = retflag[i]; + if (i == 0) { + strcat(thisline, f->text); + } else if (i == nretflags - 1) { + strcat(thisline, " and "); + strcat(thisline, f->text); + } else { + strcat(thisline, ", "); + strcat(thisline, f->text); + } + } + strcat(thisline, ".\n\n"); + strncat(retbuf, thisline, HUGEBUFLEN); + + sprintf(thisline, "%s dislikes ", godname); + getflags(god->flags, retflag, &nretflags, F_GODDISLIKES, F_NONE); + for (i = 0; i < nretflags; i++) { + f = retflag[i]; + if (i == 0) { + strcat(thisline, f->text); + } else if (i == nretflags - 1) { + strcat(thisline, " and "); + strcat(thisline, f->text); + } else { + strcat(thisline, ", "); + strcat(thisline, f->text); + } + } + strcat(thisline, ".\n\n"); + strncat(retbuf, thisline, HUGEBUFLEN); + + getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_SACRIFICEOBCLASS, F_NONE); + if (nretflags == 0) { + sprintf(thisline, "%s does not accept sacrifices.\n", godname); + strncat(retbuf, thisline, HUGEBUFLEN); + } else { + int i; + getflags(god->flags, retflag, &nretflags, F_SACRIFICEOBCLASS, F_NONE); + for (i = 0; i < nretflags; i++) { + objectclass_t *oc; + oc = findoc(retflag[i]->val[0]); + sprintf(thisline, "%s accepts the sacrifice of all %s.\n",godname, oc->name); + strncat(retbuf, thisline, HUGEBUFLEN); + } + getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_NONE); + for (i = 0; i < nretflags; i++) { + objecttype_t *ot; + if (i == 0) { + sprintf(thisline, "%s accepts the sacrifice of:\n", godname); + strncat(retbuf, thisline, HUGEBUFLEN); + } + ot = findot(retflag[i]->val[0]); + sprintf(thisline, "- %s\n", ot->name); + strncat(retbuf, thisline, HUGEBUFLEN); + } + } + + return retbuf; +} + +char *makedesc_ob(object_t *o, char *retbuf) { + char buf[BIGBUFLEN]; + char buf2[BUFLEN]; + char buf3[BUFLEN]; + flag_t *f; + int obknown,i,throwrange; + flag_t *retflag[MAXCANDIDATES]; + int nretflags; + + strcpy(retbuf, ""); + + obknown = isknown(o); + + // description + getobdesc(o, buf); + strncat(retbuf, buf, HUGEBUFLEN); + strncat(retbuf, "\n\n", HUGEBUFLEN); + + // append masterwork etc onto description + f = hasflag(o->flags, F_MASTERWORK); + if (f && f->known) { + strncat(retbuf, " It is extremely well crafted.\n", HUGEBUFLEN); + } + f = hasflag(o->flags, F_SHODDY); + if (f && f->known) { + strncat(retbuf, " It is very poorly crafted.\n", HUGEBUFLEN); + } + + // weight + if (o->material->id != MT_NOTHING) { + if (o->material->id == MT_FOOD) { + snprintf(buf, BUFLEN, "%s %s food product%s, ",(o->amt == 1) ? "It is a" : "They are", + getsizetext(getobsize(o)), + (o->amt == 1) ? "" : "s"); + } else { + snprintf(buf, BUFLEN, "%s %s sized, made from %s, ",(o->amt == 1) ? "It is" : "They are", + getsizetext(getobsize(o)), + o->material->name); + } + + if (o->amt == 1) { + char wbuf[BUFLEN]; + getweighttext(getobweight(o), wbuf, B_FALSE); + snprintf(buf2, BUFLEN, "and weighs %s.",wbuf); + strcat(buf, buf2); + } else { + char wbuf[BUFLEN]; + char wbuf2[BUFLEN]; + getweighttext(getobweight(o), wbuf, B_FALSE); + getweighttext(getobunitweight(o), wbuf2, B_FALSE); + snprintf(buf2, BUFLEN, "and weigh %s (%s each).",wbuf, wbuf2); + strcat(buf, buf2); + } + strncat(retbuf, buf, HUGEBUFLEN); strncat(retbuf, "\n", HUGEBUFLEN); + + throwrange = getmaxthrowrange(player, o); + if (throwrange >= 1) { + sprintf(buf, " You could throw %s %d metres.",(o->amt == 1) ? "it" : "one", throwrange); + } else { + sprintf(buf, " It is too heavy for you to throw."); + } + strncat(retbuf, buf, HUGEBUFLEN); strncat(retbuf, "\n", HUGEBUFLEN); + + f = hasflag(o->flags, F_THROWMISSILE); + if (f) { + if (lfhasflag(player, F_EXTRAINFO) || lfhasflag(player, F_OMNIPOTENT)) { + int dam; + dam = getthrowdam(o); + sprintf(buf, " %s good for throwing [base damage %d].",(o->amt == 1) ? "It is" : "They are", dam); + } else { + sprintf(buf, " %s good for throwing.", (o->amt == 1) ? "It is" : "They are"); + } + strncat(retbuf, buf, HUGEBUFLEN); strncat(retbuf, "\n", HUGEBUFLEN); + } + } + + if (isedible(o)) { + int basenutr; + basenutr = getnutritionbase(o); + sprintf(buf, "%s edible, and %s %s.\n", + (o->amt == 1) ? "It is" : "They are", + (o->amt == 1) ? "is" : "are each", + getfillingname(basenutr)); + strncat(retbuf, buf, HUGEBUFLEN); + if (hasflagval(o->flags, F_OBHPDRAIN, NA, DT_DECAY, NA, NULL)) { + // don't show "it will rot" if it's already rotten (and you know this) + if (isrotting(o) && ( (getattrbracket(getattr(player, A_IQ), A_IQ, NULL) >= AT_GTAVERAGE) || getskill(player, SK_COOKING)) ) { + } else { + sprintf(buf, "%s will decay and go bad over time.\n", (o->amt == 1) ? "It" : "They" ); + strncat(retbuf, buf, HUGEBUFLEN); + } + } + } + + + // weapons? + if (isfirearm(o)) { + flag_t *ff, *ff2; + sprintf(buf, "It is a %s firearm.\n", hasflag(o->flags, F_TWOHANDED) ? "two-handed" : "single handed"); + strncat(retbuf, buf, HUGEBUFLEN); + f = hasflag(o->flags, F_ACCURACY); + if (f) { + int acc; + acc = getobaccuracy(o, NULL); + sprintf(buf, " It has %s accuracy.\n",getaccuracyname(acc)); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_RANGE); + if (f) { + sprintf(buf, " Its maximum range is %d.\n",f->val[0]); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_AMMOCAPACITY); + if (f) { + sprintf(buf, " It can hold up to %d of the following kind(s) of ammo:\n",f->val[0]); + strncat(retbuf, buf, HUGEBUFLEN); + + strcpy(buf, ""); + + getflags(o->flags, retflag, &nretflags, F_AMMOOB, F_NONE); + for (i = 0; i < nretflags; i++) { + objecttype_t *ot; + ff = retflag[i]; + ot = findot(ff->val[0]); + if (ot) { + if (streq(buf, "")) { + snprintf(buf, BUFLEN, " %s",ot->name); + } else { + if (strlen(buf) >= 60) { + strncat(retbuf, buf, HUGEBUFLEN); + snprintf(buf, BUFLEN, "\n %s",ot->name); + } else { + strcat(buf, ", "); + strcat(buf, ot->name); + } + } + } + } + if (strlen(buf)) { + strncat(retbuf, buf, HUGEBUFLEN); + strncat(retbuf, "\n", HUGEBUFLEN); + } + } + ff = hasflag(o->flags, F_FIRESPEED); + if (ff) { + sprintf(buf, " It fires at a speed of %d km/h.\n",speedtokph(ff->val[0])); + strncat(retbuf, buf, HUGEBUFLEN); + } + ff = hasflag(o->flags, F_FIRETURNS); + ff2 = hasflag(o->flags, F_RELOADTURNS); + sprintf(buf, " It takes %d turn%s to fire, and %d turn%s to reload.\n", + ff->val[0], (ff->val[0] == 1) ? "" : "s", + ff2->val[0], (ff2->val[0] == 1) ? "" : "s"); + strncat(retbuf, buf, HUGEBUFLEN); + } else if (o->type->obclass->id == OC_WEAPON) { + flag_t *damflag; + int delay; + int critchance; + snprintf(buf, BUFLEN, "It is a %s weapon", hasflag(o->flags, F_TWOHANDED) ? "two-handed" : "single handed"); + damflag = hasflag(o->flags, F_DAM); + if (damflag) { + int bonus = 0; + char buf2[BUFLEN]; + int mindam,maxdam; + enum DAMTYPE damtype; + + f = hasflag(o->flags, F_BONUS); + if (f && f->known) { + // only tell player about bonuses if they are known.! + bonus = f->val[0]; + } + + damtype = damflag->val[0]; + getdamrange(damflag, &mindam, &maxdam); + mindam += bonus; + maxdam += bonus; + if (mindam < 0) mindam = 0; + if (maxdam < 0) maxdam = 0; + + if (mindam == maxdam) { + snprintf(buf2, BUFLEN, " which inflicts %d %s damage",maxdam, getdamname(damtype)); + } else { + snprintf(buf2, BUFLEN, " which inflicts %d-%d %s damage",mindam,maxdam, getdamname(damtype)); + } + strcat(buf, buf2); + + //dicetotext(f->val[0], f->val[1], f->val[2], NULL, NULL, dicebuf, NULL); + + strcat(buf, " ("); + strcat(buf, damflag->text); // ie. 2d6 + strcat(buf, ").\n"); + + strncat(retbuf, buf, HUGEBUFLEN); + + // other extra damage or effects? + f = hasflag(o->flags, F_ONFIRE); + if (f) { + if (f->text) { + sprintf(buf," It also inflicts %s extra burning damage.\n", f->text); + } else { + sprintf(buf," It also inflicts extra burning damage.\n"); + } + strncat(retbuf, buf, HUGEBUFLEN); + } + } else { + strncat(retbuf, buf, HUGEBUFLEN); + strncat(retbuf, "\n", HUGEBUFLEN); + } + + delay = 100; + f = hasflag(o->flags, F_OBATTACKDELAY); + if (f) { + delay = f->val[0]; + } + sprintf(buf, " Its attack delay is %d%%.\n",delay - 100); + strncat(retbuf, buf, HUGEBUFLEN); + + critchance = getcritchance(player, o, NULL); + if (critchance > 0) { + sprintf(buf, " You have a %d%% critical hit chance with it.\n", critchance); + strncat(retbuf, buf, HUGEBUFLEN); + } + + f = hasflag(o->flags, F_ACCURACY); + if (f) { + int acc; + acc = getobaccuracy(o, NULL); + sprintf(buf, " It has %s accuracy.\n",getaccuracyname(acc)); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_DISARMATTACK); + if (f) { + sprintf(buf, " A skilled weilder can disarm opponents with it.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_TRIPATTACK); + if (f) { + sprintf(buf, " A skilled weilder can trip opponents with it.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_ARMOURPIERCE); + if (f && f->known) { + sprintf(buf, " Armour will not reduce %s damage.\n",(o->amt == 1) ? "its" : "their"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + + } + // damage + if (isarmour(o)) { + f = hasflag(o->flags, F_GOESON); + if (f) { + snprintf(buf, BUFLEN, "It is worn %s your %s, ",getbodypartequipname(f->val[0]), getbodypartname(f->val[0])); + } else { + strcpy(buf, ""); + } + f = hasflag(o->flags, F_ARMOURRATING); + if (f) { + if (strlen(buf)) { + snprintf(buf2, BUFLEN, "and has an Armour Rating of %d.",f->val[0] + getobbonus(o)); + strcat(buf, buf2); + } else { + snprintf(buf, BUFLEN, "It has an Armour Rating of %d.",f->val[0] + getobbonus(o)); + } + } else { + if (strlen(buf)) { + snprintf(buf2, BUFLEN, "and provides no protection."); + strcat(buf, buf2); + } + } + strncat(retbuf, buf, HUGEBUFLEN); + strncat(retbuf, "\n", HUGEBUFLEN); + + f = hasflag(o->flags, F_EVASION); + if (f) { + int evmod; + evmod = adjustarmourpenalty(player, f->val[0]); + if (evmod != 0) { + snprintf(buf, BUFLEN, " When worn, it %s your evasion chance by %d%%\n.", (evmod < 0) ? "reduces" : "increases", abs(evmod)); + strncat(retbuf, buf, HUGEBUFLEN); + } + } + + f = hasflag(o->flags, F_ACCURACYMOD); + if (f) { + sprintf(buf, " It will %s your evasion chance by %d%%.\n", + (f->val[0] < 0) ? "lower" : "raise", abs(f->val[0])); + strncat(retbuf, buf, HUGEBUFLEN); + } + + f = hasflag(o->flags, F_SCARY); + if (f) { + sprintf(buf, " It may unnerve others when worn.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + } else { + // non armour, but still wearable. + f = hasflag(o->flags, F_GOESON); + if (f) { + snprintf(buf, BUFLEN, "It is worn %s your %s.\n",getbodypartequipname(f->val[0]), getbodypartname(f->val[0])); + strncat(retbuf, buf, HUGEBUFLEN); + } + } + + if (hasflag(o->flags, F_DAMAGABLE) && isarmour(o) ) { + int showfullhp = B_FALSE; + char hpbuf[BUFLEN]; + f = hasflag(o->flags, F_OBHP); + if (isarmour(o) && getskill(player, SK_ARMOUR)) { + showfullhp = B_TRUE; + } else if (isshield(o) && getskill(player, SK_SHIELDS)) { + showfullhp = B_TRUE; + } else if ((o->type->material->id == MT_METAL) && getskill(player, SK_METALWORK)) { + showfullhp = B_TRUE; + } else if ( ((o->type->material->id == MT_LEATHER) || (o->type->material->id == MT_CLOTH)) && + getskill(player, SK_SEWING)) { + showfullhp = B_TRUE; + } + + if (isdamaged(o)) { + snprintf(buf, BUFLEN, "It has been damaged."); + } else { + snprintf(buf, BUFLEN, "It is in perfect condition."); + } + if (showfullhp) { + int pct; + pct = (int)(((float)f->val[0] / (float)f->val[1]) * 100.0); + snprintf(hpbuf, BUFLEN, " [%d%%, %d/%d hp]", pct, f->val[0], f->val[1]); + } else if (isdamaged(o)) { + int pct; + pct = (int)(((float)f->val[0] / (float)f->val[1]) * 100.0); + snprintf(hpbuf, BUFLEN, " [%d%% hp]", pct); + } else { + strcpy(hpbuf, ""); + } + strncat(retbuf, buf, HUGEBUFLEN); + strncat(retbuf, "\n", HUGEBUFLEN); + } + + // charges remaining + if (o->type->obclass->id == OC_WAND) { + if (isidentified(o)) { + int charges; + charges = getcharges(o); + if (charges) { + sprintf(buf, "It has %d charges left.\n",charges); + } else { + sprintf(buf, "It has no charges left.\n"); + } + strncat(retbuf, buf, HUGEBUFLEN); + } + } else if (o->type->obclass->id == OC_GODSTONE) { + if (isidentified(o)) { + int charges,max; + getchargeinfo(o, &charges, &max); + if (charges == max) { + sprintf(buf, "It is fully charged.\n"); + } else { + sprintf(buf, "It is depleted.\n"); + } + strncat(retbuf, buf, HUGEBUFLEN); + } + } + + f = hasflag(o->flags, F_PICKLOCKS); + if (f) { + sprintf(buf, "You can use it to pick locks.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + f = hasflag(o->flags, F_HELPSCLIMB); + if (f) { + sprintf(buf, "It can be used to assist in climbing.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + + // skip line + strncat(retbuf, "\n", HUGEBUFLEN); + + // been made invulnerable ? + if (hasflagknown(o->type->flags, F_INVULNERABLE) && !hasflag(o->flags, F_DAMAGABLE)) { + strncat(retbuf, "It is invulnerable to most damage.\n", HUGEBUFLEN); + } else { + // immunities + strcpy(buf, ""); + f = hasflagval(o->flags, F_DTIMMUNE, DT_ALL, NA, NA, NULL); + if (f) { + snprintf(buf, BUFLEN, "It is immune to %s", getdamname(DT_ALL)); + } else { + int first = B_TRUE; + for (i = 0; i < MAXDAMTYPE; i++) { + f = isimmuneto(o->flags, i); + if (f) { + char buf2[BUFLEN]; + if (first) { + snprintf(buf2, BUFLEN, "It is immune to: %s", getdamname(i)); + first = B_FALSE; + } else { + snprintf(buf2, BUFLEN, ", %s", getdamname(i)); + } + strcat(buf, buf2); + } + } + } + if (strlen(buf) > 0) { + strcat(buf, ".\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + // resistances + strcpy(buf, ""); + f = hasflagval(o->flags, F_DTRESIST, DT_ALL, NA, NA, NULL); + if (f) { + snprintf(buf, BUFLEN, "It is resistant to %s", getdamname(DT_ALL)); + } else { + int first = B_TRUE; + for (i = 0; i < MAXDAMTYPE; i++) { + f = isresistantto(o->flags, i); + if (f) { + char buf2[BUFLEN]; + if (first) { + snprintf(buf2, BUFLEN, "It is resistant to: %s", getdamname(i)); + first = B_FALSE; + } else { + snprintf(buf2, BUFLEN, ", %s", getdamname(i)); + } + strcat(buf, buf2); + } + } + } + if (strlen(buf) > 0) { + strcat(buf, ".\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + // vulnerabilities + strcpy(buf, ""); + f = hasflagval(o->flags, F_DTVULN, DT_ALL, NA, NA, NULL); + if (f) { + snprintf(buf, BUFLEN, "It is vulnerable to %s", getdamname(DT_ALL)); + } else { + int first = B_TRUE; + for (i = 0; i < MAXDAMTYPE; i++) { + f = isvulnto(o->flags, i); + if (f) { + char buf2[BUFLEN]; + if (first) { + snprintf(buf2, BUFLEN, "It is vulnerable to: %s", getdamname(i)); + first = B_FALSE; + } else { + snprintf(buf2, BUFLEN, ", %s", getdamname(i)); + } + strcat(buf, buf2); + } + } + } + if (strlen(buf) > 0) { + strcat(buf, ".\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + } + + + for (f = o->flags->first ; f ; f = f->next) { + if ((f->id == F_HITCONFER) && (f->val[0] == F_POISONED) && (f->lifetime == FROMOBMOD)) { + sprintf(buf, "It has been coated with poison.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + } + + + // skip line + strncat(retbuf, "\n", HUGEBUFLEN); + + // physical properties + f = hasflag(o->flags, F_ONFIRE); + if (f) { + sprintf(buf, "It is on fire.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + if (obproduceslight(o)) { + sprintf(buf, "It is producing light.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + f = hasflag(o->flags, F_RUSTED); + if (f) { + sprintf(buf, "It is rusty.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + f = hasflag(o->flags, F_WATERPROOF); + if (f) { + sprintf(buf, "It is waterproof.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_WET); + if (f) { + sprintf(buf, "It is wet.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + f = hasflag(o->flags, F_ACTIVATED); + if (f) { + sprintf(buf, "It is activated.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + + // if known, show what it confers + for (f = o->flags->first ; f ; f = f->next) { + if ((f->id == F_HOLDCONFER) || (f->id == F_EQUIPCONFER) || (f->id == F_ACTIVATECONFER)) { + if (obknown) { + objecttype_t *ot; + if (f->id == F_HOLDCONFER) strcpy(buf, "When held, it"); + else if (f->id == F_ACTIVATECONFER) strcpy(buf, "When activated, it"); + else if (f->id == F_HITCONFER) strcpy(buf, "When hit by it, it"); + else strcpy(buf, "When equipped, it"); + + // conferred intrinsics + switch (f->val[0]) { + int amt,amt2; + case F_ARMOURPENALTY: + amt = adjustarmourpenalty(player, f->val[1]); + amt2 = adjustarmourpenalty(player, f->val[2]); + if (amt > 0) { + sprintf(buf2, "^B%s lowers your accuracy by %d%%. (Armour skill penalty)^n\n", buf, amt); + strncat(retbuf, buf2, HUGEBUFLEN); + } + if (amt2 > 0) { + sprintf(buf2, "^B%s lowers your evasion by %d%%. (Armour skill penalty)^n\n", buf, amt2); + strncat(retbuf, buf2, HUGEBUFLEN); + } + break; + case F_SHIELDPENALTY: + amt = adjustshieldpenalty(player, f->val[1]); + amt2 = adjustshieldpenalty(player, f->val[2]); + if (amt > 0) { + sprintf(buf2, "^B%s lowers your attack accuracy by %d%%. (Shields skill too low)^n\n", buf, amt); + strncat(retbuf, buf2, HUGEBUFLEN); + } + if (amt2 > 0) { + sprintf(buf2, "^B%s lowers your evasion by %d%%. (Shields skill penalty)^n\n", buf, amt2); + strncat(retbuf, buf2, HUGEBUFLEN); + } + break; + case F_ATTRMOD: + sprintf(buf2, "%s %s your %s.\n", buf, (f->val[2] > 0) ? "increases" : "decreases", getattrname(f->val[1])); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_ATTRSET: + sprintf(buf2, "%s modifies your %s.\n", buf, getattrname(f->val[1])); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_AWARENESS: + sprintf(buf2, "%s grants you enhanced awareness.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_BLIND: + sprintf(buf2, "%s prevents you from seeing anything.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_BREATHWATER: + sprintf(buf2, "%s allows you to breath normally while underwater.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_CONTROL: + sprintf(buf2, "%s lets you control teleportation and polymorphic effects.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_DEAF: + sprintf(buf2, "%s prevents you from hearing anything.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_DETECTLIFE: + sprintf(buf2, "%s will detect nearby lifeforms.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_DETECTOBS: + sprintf(buf2, "%s will detect nearby objects.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_DETECTMAGIC: + sprintf(buf2, "%s will detect magical enchantments on objects.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_DETECTMETAL: + sprintf(buf2, "%s will detect nearby metal.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_ENHANCESEARCH: + sprintf(buf2, "%s enhances your searching ability.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_ENHANCESMELL: + sprintf(buf2, "%s enhances your sense of smell.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_DISEASEIMMUNE: + sprintf(buf2, "%s makes you immune to disease.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_DRUNK: + sprintf(buf2, "%s makes you tipsy.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_EXTRAINFO: + sprintf(buf2, "%s provides enhanced knowledge to you.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_EXTRADAM: + sprintf(buf2, "%s will cause you to deal more damage.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_EXTRALUCK: + sprintf(buf2, "%s will give you a bonus to all skill checks.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_EXTRAMP: + sprintf(buf2, "%s will increase your mana pool by %d%%.\n", buf, f->val[0]); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_FASTACT: + sprintf(buf2, "%s will speed up your actions.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_FASTMETAB: + sprintf(buf2, "%s will increase your metabolic rate.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_FASTMOVE: + sprintf(buf2, "%s will speed up your movement.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_FLYING: + sprintf(buf2, "%s will allow you to fly.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_FREEZINGTOUCH: + sprintf(buf2, "%s will cause objects you touch to turn to ice.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_FROZEN: + sprintf(buf2, "%s turns you to ice.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_GRAVBOOSTED: + sprintf(buf2, "%s increases gravity around you.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_GRAVLESSENED: + sprintf(buf2, "%s decreases gravity around you.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_DODGES: + sprintf(buf2, "%s allows you to dodge attacks.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_INVISIBLE: + sprintf(buf2, "%s renders you invisible to normal sight.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_INVULNERABLE: + sprintf(buf2, "%s protects you from all physical harm.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_CANWILL: + ot = findot(f->val[1]); + if (ot) { + char sname[BUFLEN]; + strcpy(sname, ot->name); + capitalise(sname); + sprintf(buf2, "%s allows you to cast '%s' at will.\n", buf, sname); + strncat(retbuf, buf2, HUGEBUFLEN); + } + break; + case F_CAFFEINATED: + sprintf(buf2, "%s acts as a stimulant.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_CANCAST: + ot = findot(f->val[1]); + if (ot) { + char sname[BUFLEN]; + strcpy(sname, ot->name); + capitalise(sname); + sprintf(buf2, "%s allows you to cast '%s'.\n", buf, sname); + strncat(retbuf, buf2, HUGEBUFLEN); + } + break; + case F_DETECTAURAS: + sprintf(buf2, "%s allows you to detect blessings or curses.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_HOLYAURA: + sprintf(buf2, "%s surrounds you with a holy aura.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_LEVITATING: + sprintf(buf2, "%s causes you to levitate.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_MAGSHIELD: + sprintf(buf2, "%s surrounds you with a magnetic shield.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_NAUSEATED: + sprintf(buf2, "%s causes you to feel nauseated.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_NONCORPOREAL: + sprintf(buf2, "%s makes you non-corporeal.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_PAIN: + sprintf(buf2, "%s causes you intense pain.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_PARALYZED: + sprintf(buf2, "%s paralyzes you.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_PHOTOMEM: + sprintf(buf2, "%s prevents you from forgetting your surroundings.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_STABILITY: + sprintf(buf2, "%s prevents you from slipping over.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_STENCH: + sprintf(buf2, "%s makes you smell bad.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_PRODUCESLIGHT: + sprintf(buf2, "%s produces light.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_RETALIATE: + sprintf(buf2, "%s protects you with %s.\n", buf, f->text); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_RAGE: + sprintf(buf2, "%s makes you enraged.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_REGENERATES: + if (f->val[1] == 1) { + strcpy(buf3, ""); + } else if (f->val[1] == 2) { + strcpy(buf3, "quickly"); + } else if (f->val[1] == 3) { + strcpy(buf3, "very quickly"); + } else { // >= 4 + strcpy(buf3, "extremely quickly"); + } + sprintf(buf2, "%s allows you to regenerate health%s.\n", buf,buf3); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_RESISTMAG: + sprintf(buf2, "%s grants you %s immunity to magic.\n", buf, + (f->val[0] >= 10) ? "strong" : "minor"); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_RISEASGHOST: + sprintf(buf2, "%s cause you to rise as a ghost after death.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_SEEINVIS: + sprintf(buf2, "%s allows you to see invisible things.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_SEEINDARK: + sprintf(buf2, "%s allows you to see in the dark.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_SILENTMOVE: + sprintf(buf2, "%s allows you to move silently.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_SLOWACT: + sprintf(buf2, "%s will slow down your actions.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_SLOWMETAB: + sprintf(buf2, "%s will decrease your metabolic rate.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_SLOWMOVE: + sprintf(buf2, "%s will slow down your movement.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_TREMORSENSE: + sprintf(buf2, "%s allows you to 'see' by sensing vibrations around you.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_TRUESTRIKE: + sprintf(buf2, "%s makes your attacks automatically hit.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_WINDSHIELD: + sprintf(buf2, "%s will surround you with a cyclonic shield.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_VISRANGEMOD: + sprintf(buf2, "%s %s your vision range.\n", buf, (f->val[1] > 0) ? "increases" : "descreases"); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + case F_XRAYVIS: + sprintf(buf2, "%s allows you to see through walls.\n", buf); + strncat(retbuf, buf2, HUGEBUFLEN); + break; + } + } + } + } + + // show special properties where known + f = hasflag(o->flags, F_BALANCE); + if (f && f->known) { + sprintf(buf, "It heals weaker enemies, and does extra damage to stronger ones.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_FLAMESTRIKE); + if (f && f->known) { + sprintf(buf, "It ignites fires wherever it hits.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_HEAVYBLOW); + if (f && f->known) { + sprintf(buf, "Its powerful blows knock enemies backwards.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + f = hasflag(o->flags, F_REVENGE); + if (f && f->known) { + sprintf(buf, "It does more damage as your HP are lowered.\n"); + strncat(retbuf, buf, HUGEBUFLEN); + } + + // requirements + i = B_FALSE; + for (f = o->flags->first ; f ; f = f->next) { + if (f->id == F_ATTREQ) { + int usable = B_TRUE; + if (!meetsattreq(player, f, o)) { + usable = B_FALSE; + } + if (!usable) setcol(mainwin, C_RED); + sprintf(buf, "It requires at least %d %s to use.\n", f->val[1], getattrname(f->val[0])); + strncat(retbuf, buf, HUGEBUFLEN); + if (!usable) unsetcol(mainwin, C_RED); + i = B_TRUE; + } + } + + // blank line + strncat(retbuf, "\n", HUGEBUFLEN); + + + // skill type? + f = hasflag(o->flags, F_USESSKILL); + if (f && (f->val[0] != SK_NONE)) { + enum SKILLLEVEL slev; + slev = getskill(player, f->val[0]); + sprintf(buf, "It falls into the '%s' category (your skill: ",getskillname(f->val[0])); + strncat(retbuf, buf, HUGEBUFLEN); + sprintf(buf, "^%d%s^n)\n", getskilllevelcolour(slev), getskilllevelname(getskill(player, f->val[0])) ); + strncat(retbuf, buf, HUGEBUFLEN); + } + + if (hasflag(o->flags, F_NOBLESS)) { + sprintf(buf, "%s cannot be blessed or cursed.\n", (o->amt == 1) ? "It" : "They" ); + strncat(retbuf, buf, HUGEBUFLEN); + } else { + if (isblessknown(o)) { + if (o->blessed == B_BLESSED) { + sprintf(buf, "%s a blessing bestowed upon %s.\n", + (o->amt == 1) ? "It has" : "They have", + (o->amt == 1) ? "it" : "them"); + strncat(retbuf, buf, HUGEBUFLEN); + } else if (o->blessed == B_CURSED) { + sprintf(buf, "%s cursed.\n", (o->amt == 1) ? "It is" : "They are"); + strncat(retbuf, buf, HUGEBUFLEN); + } + } else { + sprintf(buf, "%s might be blessed or cursed.\n", (o->amt == 1) ? "It" : "They"); + strncat(retbuf, buf, HUGEBUFLEN); + } + } + + if (o->contents->first) { + object_t *oo; + + sprintf(buf, "\n%s currently contain%s:\n", (o->amt == 1) ? "It" : "They", (o->amt == 1) ? "s" : ""); + strncat(retbuf, buf, HUGEBUFLEN); + + for (oo = o->contents->first ;oo ; oo = oo->next) { + getobname(oo, buf, oo->amt); + sprintf(buf, " - %s\n", buf); + strncat(retbuf, buf, HUGEBUFLEN); + } + } + + return retbuf; +} + +char *makedesc_skill(enum SKILL skid, char *retbuf) { + skill_t *sk; + enum SKILLLEVEL slev; + char buf[BUFLEN]; + int i; + + strcpy(retbuf, ""); + + sk = findskill(skid); + + // title + sprintf(buf, "%s\n\n", sk->desc); + strncat(retbuf, buf, HUGEBUFLEN); + + // descriptions + for (slev = PR_INEPT; slev <= PR_MASTER; slev++) { + for (i = 0; i < sk->nskilldesc; i++) { + if (sk->skilldesclev[i] == slev) { + if (slev == PR_INEPT) { + snprintf(buf, BUFLEN, "%s\n",sk->skilldesctext[i]); + } else { + snprintf(buf, BUFLEN, "At %s level: %s\n",getskilllevelname(sk->skilldesclev[i]), sk->skilldesctext[i]); + } + strncat(retbuf, buf, HUGEBUFLEN); + } + } + } + return retbuf; +} + +char *makedesc_spell(objecttype_t *ot, char *retbuf) { + char buf[BUFLEN]; + flag_t *retflag[MAXCANDIDATES], *f; + int nretflags,i,power,range; + + strcpy(retbuf, ""); + + if (ot->obclass->id == OC_SPELL) { + power = getspellpower(player, ot->id); + } else { + power = -1; + } + + + range = getspellrange(player, ot->id, power); + + snprintf(buf, BUFLEN, "%s\n", ot->desc); + strncat(retbuf, buf, BUFLEN); + + getflags(ot->flags, retflag, &nretflags, F_EXTRADESC, F_NONE); + for (i = 0; i < nretflags; i++) { + f = retflag[i]; + snprintf(buf, BUFLEN, "%s\n", f->text); + strncat(retbuf, buf, BUFLEN); + } + strcat(retbuf, "\n"); + + // properties + f = hasflag(ot->flags, F_SPELLLEVEL); + if (f) { + flag_t *sf; + sf = hasflag(ot->flags, F_SPELLSCHOOL); + assert(sf); + sprintf(buf, "It is a level %d %s spell.\n",f->val[0], getschoolname(sf->val[0])); + strncat(retbuf, buf, BUFLEN); + } + + i = getmpcost(NULL, ot->id); + if (i > 0) { + if (hasflag(ot->flags, F_ONGOING)) { + sprintf(buf, "It takes %d MP to keep active - this is an ongoing cost.\n",i); + } else { + sprintf(buf, "It costs %d MP to cast.\n",i); + } + strncat(retbuf, buf, BUFLEN); + } + + f = hasflag(ot->flags, F_CASTINGTIME); + if (f) { + sprintf(buf, "It takes %d turns to cast.\n",f->val[0]); + } else { + sprintf(buf, "It takes effect instantly.\n"); + } + strncat(retbuf, buf, HUGEBUFLEN); + strncat(retbuf, "\n", HUGEBUFLEN); + + if (ot->obclass->id == OC_SPELL) { + if (power > 0) { + sprintf(buf, "You can cast it at power level %d (maximum %d).\n",power, getspellmaxpower(ot->id)); + } else { + sprintf(buf, "It is too powerful for you to cast (maximum power %d).\n", getspellmaxpower(ot->id)); + } + strncat(retbuf, buf, BUFLEN); + + if (range != UNLIMITED) { + sprintf(buf, "At this power, it has a range of %d cell%s.\n",range, (range == 1) ? "" : "s"); + strncat(retbuf, buf, BUFLEN); + } + } + return retbuf; +} + // if wantunknown is set, lsit spells we DONT know. // otherwise list spells we DO know. // only include spells which cost <= mpcutoff @@ -5064,7 +5204,7 @@ void makespellchoicelist(prompt_t *pr, lifeform_t *lf, char *ques, char *ques2, int mpcost[MAXCANDIDATES]; char mpdesc[MAXCANDIDATES][BUFLEN]; int validspell[MAXCANDIDATES]; - int err[MAXCANDIDATES]; // will be e_ok, e_notready, e_toopowerful, e_nomp + int err[MAXCANDIDATES]; // will be E_OK, e_notready, e_toopowerful, e_nomp int deactspell[MAXCANDIDATES]; int nposs = 0; int i,n,lev; @@ -5090,25 +5230,36 @@ void makespellchoicelist(prompt_t *pr, lifeform_t *lf, char *ques, char *ques2, f = lfhasflagval(lf, F_CANWILL, ot->id, NA, NA, NULL); if (!wantunknown && f) { if (hasflagval(ot->flags, F_SPELLSCHOOL, i, NA, NA, NULL)) { - poss[nposs] = ot->id; - deactspell[nposs] = B_FALSE; // default - mpcost[nposs] = -1; - if (f->val[2] == NA) { - snprintf(mpdesc[nposs], BUFLEN, "(ready)"); - validspell[nposs] = B_TRUE; - err[nposs] = E_OK; - } else { - if (f->val[1] == f->val[2]) { + // make sure we don't already have it. + int found = B_FALSE; + for (n = 0; n < nposs; n++) { + if (poss[n] == ot->id) { + found = B_TRUE; + break; + } + } + if (!found) { + // add to list + poss[nposs] = ot->id; + deactspell[nposs] = B_FALSE; // default + mpcost[nposs] = -1; + if (f->val[2] == NA) { snprintf(mpdesc[nposs], BUFLEN, "(ready)"); validspell[nposs] = B_TRUE; err[nposs] = E_OK; } else { - snprintf(mpdesc[nposs], BUFLEN, "(%d/%d)",f->val[1],f->val[2]); - validspell[nposs] = B_FALSE; - err[nposs] = E_NOTREADY; + if (f->val[1] == f->val[2]) { + snprintf(mpdesc[nposs], BUFLEN, "(ready)"); + validspell[nposs] = B_TRUE; + err[nposs] = E_OK; + } else { + snprintf(mpdesc[nposs], BUFLEN, "(%d/%d)",f->val[1],f->val[2]); + validspell[nposs] = B_FALSE; + err[nposs] = E_NOTREADY; + } } + nposs++; } - nposs++; } } } // end if level ok @@ -5233,8 +5384,12 @@ void makespellchoicelist(prompt_t *pr, lifeform_t *lf, char *ques, char *ques2, } if (addit) { + char *longdesc; // letter doesn't matter - addchoice(pr, 'a', buf2, buf, ot); + longdesc = malloc(HUGEBUFLEN * sizeof(char)); + makedesc_spell(ot, longdesc); + addchoice(pr, 'a', buf2, buf, ot, longdesc); + free(longdesc); } } } @@ -5544,10 +5699,10 @@ void dohelp(char helpmode) { cls(); if (helpmode == '?') { initprompt(&prompt, "What would you like help with (ESC when done)?"); - addchoice(&prompt, '?', "Keyboard Commands", NULL, NULL); - addchoice(&prompt, 's', "Skill Descriptions", NULL, NULL); - addchoice(&prompt, 'g', "God Descriptions", NULL, NULL); - addchoice(&prompt, '-', "(done)", NULL, NULL); + addchoice(&prompt, '?', "Keyboard Commands", NULL, NULL, NULL); + addchoice(&prompt, 's', "Skill Descriptions", NULL, NULL, NULL); + addchoice(&prompt, 'g', "God Descriptions", NULL, NULL, NULL); + addchoice(&prompt, '-', "(done)", NULL, NULL, NULL); prompt.maycancel = B_TRUE; ch = getchoice(&prompt); switch (ch) { @@ -5583,9 +5738,9 @@ void dohelp(char helpmode) { initprompt(&prompt, "Describe which skill (ESC when done)?"); for (sk = firstskill ; sk ; sk = sk->next) { - addchoice(&prompt, 'a', sk->name, NULL, sk); + addchoice(&prompt, 'a', sk->name, NULL, sk, sk->desc); } - addchoice(&prompt, '\0', "(done)", NULL, NULL); + addchoice(&prompt, '\0', "(done)", NULL, NULL, NULL); prompt.maycancel = B_TRUE; ch = getchoicestr(&prompt, B_FALSE, B_TRUE); if (!ch) { @@ -6547,6 +6702,8 @@ char getchoicestr(prompt_t *prompt, int useshortcuts, int showallatstart) { char promptstr[BUFLEN]; int showall; int autochar = 0; + int descendy = -1; + int validchoice = -1; showall = showallatstart; @@ -6661,6 +6818,35 @@ char getchoicestr(prompt_t *prompt, int useshortcuts, int showallatstart) { } + // if there is not only one valid choice, clear to bottom of screen (ie overwrite any + // previous descriptions). + validchoice = -1; + + // if we only ahve 1 valid choice, show description (if we have it) + if (nvalid == 1) { + // find the valid one + for (i = 0; i < prompt->nchoices; i++) { + if (prompt->choice[i].valid) { + validchoice = i; + break; + } + } + if (strlen(prompt->choice[validchoice].longdesc)) { + int dummy; + wmove(mainwin, 5, 0); + textwithcol(mainwin, prompt->choice[validchoice].longdesc); + getyx(mainwin, descendy, dummy); // remember bottom of description + } + } else if ((descendy != -1) && showall) { + int yy; + // clear to bottom of screen + for (yy = y ; yy < lastline; yy++) { + wmove(mainwin, yy, 0); + wclrtoeol(mainwin); + } + descendy = -1; + } + // display prompt question snprintf(promptstr, BUFLEN, "%s [%s%s] %s", prompt->q[prompt->whichq], @@ -6673,33 +6859,22 @@ char getchoicestr(prompt_t *prompt, int useshortcuts, int showallatstart) { // if there's only one match, complete it if (nvalid == 1) { int cx,cy; - int validone = -1; // remember cursor pos getyx(mainwin, cy, cx); - - // find the valid one - for (i = 0; i < prompt->nchoices; i++) { - if (prompt->choice[i].valid) { - validone = i; - break; - } - } - // fill in the name of the completed choice /* snprintf(promptstr, BUFLEN, "%s %s %s", prompt->q[prompt->whichq], prompt->maycancel ? "[ESC=cancel, '=next page] " : "", prompt->choice[validone].text); */ + + // 'validchoice' was calculated earlier snprintf(promptstr, BUFLEN, "%s [%s%s] %s", prompt->q[prompt->whichq], prompt->maycancel ? "ESC," : "", showall ? "'=next page,?=toggle" : "?=list", - prompt->choice[validone].text); + prompt->choice[validchoice].text); mvwprintw(mainwin, 0, 0, "%s", promptstr); - - // move the cursor back - wmove(mainwin, cy, cx); } wrefresh(mainwin); @@ -7286,6 +7461,10 @@ void initprompt(prompt_t *p, char *q1) { free(c->desc); c->desc = NULL; } + if (c->longdesc) { + free(c->longdesc); + c->longdesc = NULL; + } c->data = NULL; } } @@ -7426,7 +7605,7 @@ void msg_real(char *format, ... ) { if (db) dblog("adding to msgbuf: [%s]",buf); - if (strstr(buf, "(null)")) { + if (strstr(buf, "(NULL)")) { assert(2 == 3); } @@ -7482,14 +7661,13 @@ void drawstatus(void) { char buf2[BUFLEN]; //char mpbuf[BUFLEN]; char waitbuf[BUFLEN]; - char pname[BUFLEN]; + //char pname[BUFLEN]; char maxmpstr[BUFLEN]; flag_t *f; enum ATTRIB a; int myatt[MAXATTS]; int xpleft; - getplayernamefull(pname); curs_set(0); wclear(statwin); @@ -7498,9 +7676,12 @@ void drawstatus(void) { xpleft = (int) (((float)player->xp / (float)getxpforlev(player->level + 1)) * 100.0); wmove(statwin, 0, 0); + /* + getplayername(pname); wattron(statwin, A_BOLD); wprintw(statwin, "["); wattroff(statwin, A_BOLD); - wprintw(statwin, "%s", pname); + wprintw(statwin, "%-12s", pname); wattron(statwin, A_BOLD); wprintw(statwin, "] "); wattroff(statwin, A_BOLD); + */ // HP wattron(statwin, A_BOLD); wprintw(statwin, "HP:"); wattroff(statwin, A_BOLD); @@ -7549,6 +7730,10 @@ void drawstatus(void) { wprintw(statwin, "%d%%",xpleft); } + wattron(statwin, A_BOLD); wprintw(statwin, " Trn:"); wattroff(statwin, A_BOLD); + wprintw(statwin, "%d/%d%%", player->skillpoints, + (int) ((float)player->skillxp / (float)getspforpoint(player) * 100.0) ); + // blinded? if (isblind(player) && !lfhasflag(player, F_ASLEEP)) { setcol(statwin, C_RED); @@ -7607,9 +7792,13 @@ void drawstatus(void) { } // paralysed somehow? - if (isresting(player)) { + if ((f = isresting(player)) != NULL) { setcol(statwin, C_CYAN); - wprintw(statwin, " Resting"); + if (f->val[1] == NA) { + wprintw(statwin, " Resting"); + } else { + wprintw(statwin, " Meditating"); + } unsetcol(statwin, C_CYAN); } else if (lfhasflag(player, F_ASLEEP)) { setcol(statwin, C_MAGENTA); @@ -7989,70 +8178,89 @@ int showhiscoreline(void *hilitescore, int ncols, char **argv, char **colname) { void showlfarmour(lifeform_t *lf) { enum BODYPART bp; object_t *o; + object_t *arm[MAXBODYPARTS]; int y; - char buf[BUFLEN]; + char buf[BUFLEN],ch; + int keepgoing = B_TRUE; - cls(); - if (isplayer(lf)) { - centre(mainwin, C_WHITE, 0, "CHARACTER EQUIPMENT"); - } else{ - centre(mainwin, C_WHITE, 0, "MONSTER EQUIPMENT"); - } - y = 2; + while (keepgoing) { + cls(); + if (isplayer(lf)) { + centre(mainwin, C_WHITE, 0, "CHARACTER EQUIPMENT"); + } else{ + centre(mainwin, C_WHITE, 0, "MONSTER EQUIPMENT"); + } + y = 2; - - for (bp = BP_WEAPON; bp < MAXBODYPARTS; bp++) { - char rhs[BUFLEN]; - // default - strcpy(rhs, ""); + + for (bp = BP_WEAPON; bp < MAXBODYPARTS; bp++) { + char rhs[BUFLEN]; + // default + strcpy(rhs, ""); - if (!lfhasflagval(lf, F_NOBODYPART, bp, NA, NA, NULL)) { - object_t *outerob; - snprintf(buf, BUFLEN, "%15s:%3s",getbodypartname(bp), " "); - o = getequippedob(lf->pack, bp); - outerob = getouterequippedob(lf, bp); - if (o) { - flag_t *f; - char obname[BUFLEN]; - getobname(o, obname, o->amt); - strcpy(rhs, obname); - - if (outerob && (outerob != o)) { - char outerobname[BUFLEN]; - getobname(outerob, outerobname, outerob->amt); - if (strlen(rhs)) strcat(rhs, " "); - strcat(rhs, "(covered) "); - } - f = hasflag(o->flags, F_ARMOURRATING); - if (f && (f->val[0])) { - char numbuf[BUFLENSMALL]; - snprintf(numbuf, BUFLENSMALL, " ^g[AR:%d]^n",f->val[0]); - strcat(rhs, numbuf); - } - f = hasflag(o->flags, F_OBHP); - if (f && (f->val[0] != f->val[1])) { - char numbuf[BUFLENSMALL]; - int pct; - pct = (int)(((float)f->val[0] / (float)f->val[1]) * 100.0); - snprintf(numbuf, BUFLENSMALL, " ^w[%d%%]^n",pct); - strcat(rhs, numbuf); - } - } else { - strcpy(rhs, "-"); + if (!lfhasflagval(lf, F_NOBODYPART, bp, NA, NA, NULL)) { + object_t *outerob; + snprintf(buf, BUFLEN, "%15s:%3s",getbodypartname(bp), " "); + o = getequippedob(lf->pack, bp); + arm[bp] = o; // remember for later + outerob = getouterequippedob(lf, bp); + if (o) { + flag_t *f; + char obname[BUFLEN]; + getobname(o, obname, o->amt); + sprintf(rhs, "%c - %s",o->letter, obname); + + if (outerob && (outerob != o)) { + char outerobname[BUFLEN]; + getobname(outerob, outerobname, outerob->amt); + if (strlen(rhs)) strcat(rhs, " "); + strcat(rhs, "(covered) "); + } + f = hasflag(o->flags, F_ARMOURRATING); + if (f && (f->val[0])) { + char numbuf[BUFLENSMALL]; + snprintf(numbuf, BUFLENSMALL, " ^g[AR:%d]^n",f->val[0]); + strcat(rhs, numbuf); + } + f = hasflag(o->flags, F_OBHP); + if (f && (f->val[0] != f->val[1])) { + char numbuf[BUFLENSMALL]; + int pct; + pct = (int)(((float)f->val[0] / (float)f->val[1]) * 100.0); + snprintf(numbuf, BUFLENSMALL, " ^w[%d%%]^n",pct); + strcat(rhs, numbuf); + } + } else { + strcpy(rhs, "-"); + } + + mvwprintw(mainwin, y, 0, "%s", buf); + if (o) setobcolour(mainwin, o, B_TRUE); + //wprintw(mainwin, "%s", rhs); + textwithcol(mainwin, rhs); + if (o) setobcolour(mainwin, o, B_FALSE); + y++; } + } - mvwprintw(mainwin, y, 0, "%s", buf); - if (o) setobcolour(mainwin, o, B_TRUE); - //wprintw(mainwin, "%s", rhs); - textwithcol(mainwin, rhs); - if (o) setobcolour(mainwin, o, B_FALSE); - y++; + y = getmaxy(mainwin); + centre(mainwin, C_WHITE, y-1, "[Press letter to view armour, ESC to exit]"); + + ch = getch(); + keepgoing = B_FALSE; + if (ch == 27) { // ESC + keepgoing = B_FALSE; + } else { + // does it match an object? + for (bp = BP_WEAPON; bp < MAXBODYPARTS; bp++) { + if (arm[bp] && (arm[bp]->letter == ch)) { + describeob(arm[bp]); + } + } + keepgoing = B_TRUE; } } - y = getmaxy(mainwin); - centre(mainwin, C_WHITE, y-1, "[Press any key]"); - - getch(); + restoregamewindows(); } @@ -8239,7 +8447,7 @@ void showlfstats(lifeform_t *lf, int showall) { doheadingsmall(mainwin, y, 0, ftext, "Skill Pts"); pct = ((float)lf->skillxp / (float)amtneeded) * 100.0; limit(&pct, 0, 100); - if (lf->skillpoints || attpoints ) { + if (lf->skillpoints ) { /* wprintw(mainwin, "%d skill%s, %d attrib%s", lf->skillpoints, (lf->skillpoints == 1) ? "" : "s", @@ -8659,10 +8867,9 @@ void showlfstats(lifeform_t *lf, int showall) { } // obvious physical effects here. - // try to use the whole horizontal space here. f = lfhasknownflag(lf, F_ASLEEP); if (f) { - wrapprint(mainwin, &y, &x, "%s %s sleeping.", you(lf), is(lf)); + wrapprint(mainwin, &y, &x, "%s %s %s.", you(lf), is(lf), (f->val[1] == NA) ? "sleeping" : "meditating"); } f = lfhasknownflag(lf, F_ATTACHEDTO); if (f && (f->known)) { @@ -8963,53 +9170,51 @@ void showlfstats(lifeform_t *lf, int showall) { y = 2; for (ot = objecttype ; ot ; ot = ot->next) { - if (ot->obclass->id == OC_ABILITY) { - f = lfhasknownflagval(lf, F_CANWILL, ot->id, NA, NA, NULL); - if (f && (f->known)) { - char expirebuf[BUFLEN]; - char eb2[BUFLEN],racestr[BUFLEN]; - int needgrab = B_FALSE; - int range; - - if (f->val[2] == NA) { - snprintf(expirebuf, BUFLEN, "at will"); - } else { - snprintf(expirebuf, BUFLEN, "every %d turn%s",f->val[2], - (f->val[2] == 1) ? "" : "s"); - } + f = lfhasknownflagval(lf, F_CANWILL, ot->id, NA, NA, NULL); + if (f && (f->known)) { + char expirebuf[BUFLEN]; + char eb2[BUFLEN],racestr[BUFLEN]; + int needgrab = B_FALSE; + int range; + + if (f->val[2] == NA) { + snprintf(expirebuf, BUFLEN, "at will"); + } else { + snprintf(expirebuf, BUFLEN, "every %d turn%s",f->val[2], + (f->val[2] == 1) ? "" : "s"); + } - // extra options? - texttospellopts(f->text, "needgrab:", &needgrab, "range:", &range, "race:", racestr, NULL); - if (needgrab) { - strcat(expirebuf, ",after grab"); - } - if (range) { - char rbuf[BUFLEN]; - snprintf(rbuf, BUFLEN, ",range:%d",range); - strcat(expirebuf, rbuf); - } - if (strlen(racestr)) { - char rbuf[BUFLEN]; - snprintf(rbuf, BUFLEN, ",race:%s",racestr); - strcat(expirebuf, rbuf); - } + // extra options? + texttospellopts(f->text, "needgrab:", &needgrab, "range:", &range, "race:", racestr, NULL); + if (needgrab) { + strcat(expirebuf, ",after grab"); + } + if (range) { + char rbuf[BUFLEN]; + snprintf(rbuf, BUFLEN, ",range:%d",range); + strcat(expirebuf, rbuf); + } + if (strlen(racestr)) { + char rbuf[BUFLEN]; + snprintf(rbuf, BUFLEN, ",race:%s",racestr); + strcat(expirebuf, rbuf); + } - if (strlen(expirebuf)) { - snprintf(eb2, BUFLEN,"(%s)",expirebuf); - } else { - strcpy(eb2, ""); - } - setcol(mainwin, C_GREEN); - snprintf(buf, BUFLEN, "%-12s", ot->name); - mvwprintw(mainwin, y, 0, buf); - unsetcol(mainwin, C_GREEN); + if (strlen(expirebuf)) { + snprintf(eb2, BUFLEN,"(%s)",expirebuf); + } else { + strcpy(eb2, ""); + } + setcol(mainwin, C_GREEN); + snprintf(buf, BUFLEN, "%-12s", ot->name); + mvwprintw(mainwin, y, 0, buf); + unsetcol(mainwin, C_GREEN); - snprintf(buf, BUFLEN, "%s%s", ot->desc, eb2); - wprintw(mainwin, buf); + snprintf(buf, BUFLEN, "%s%s", ot->desc, eb2); + wprintw(mainwin, buf); - if (downline(&y, h, "ABILITIES", NULL, promptstr, cmdchars, &ch)) { - break; - } + if (downline(&y, h, "ABILITIES", NULL, promptstr, cmdchars, &ch)) { + break; } } } @@ -9084,10 +9289,7 @@ void showlfstats(lifeform_t *lf, int showall) { int thislev; thislev = getspelllevel(ot->id); if (thislev == lev) { - f = lfhasknownflagval(lf, F_CANWILL, ot->id, NA, NA, NULL); - if (!f) { - f = lfhasknownflagval(lf, F_CANCAST, ot->id, NA, NA, NULL); - } + f = lfhasknownflagval(lf, F_CANCAST, ot->id, NA, NA, NULL); if (f && (f->known)) { char spellname[BUFLEN]; char mpbuf[BUFLEN]; @@ -9212,7 +9414,7 @@ void showlfstats(lifeform_t *lf, int showall) { // show racial effects if (hasjob(lf, J_PIRATE)) { - mvwprintw(mainwin, y, 0, "%s can hold %s liquor well.", you(lf), isplayer(lf) ? "your" : "its"); + mvwprintw(mainwin, y, 0, "%s can hold %s liquor well.", you(lf), isplayer(lf) ? "Your" : "its"); y++; mvwprintw(mainwin, y, 0, "%s %s missing one eye.", you(lf), is(lf)); y++; @@ -9532,6 +9734,11 @@ void showlfstats(lifeform_t *lf, int showall) { mvwprintw(mainwin, y, 0, "%s %s surrounded by a magnetic shield.", you(lf), is(lf)); y++; } + f = lfhasflag(lf, F_MEDITATES); + if (f && (f->known)) { + mvwprintw(mainwin, y, 0, "%s retain awareness via 'sleeping' through meditation.", you(lf), is(lf)); + y++; + } f = lfhasflag(lf, F_NEEDSWATER); if (f && (f->known)) { @@ -9542,9 +9749,9 @@ void showlfstats(lifeform_t *lf, int showall) { f = lfhasflag(lf, F_PAIN); if (f && (f->known)) { if (lfhasflag(lf, F_DRUNK)) { - mvwprintw(mainwin, y, 0, "%s %s in extreme pain, somewhat mitigated by %s inebriation.", you(lf), is(lf), isplayer(lf) ? "your" : "its"); + mvwprintw(mainwin, y, 0, "%s %s in extreme pain, somewhat mitigated by %s inebriation.", you(lf), is(lf), isplayer(lf) ? "Your" : "its"); } else { - mvwprintw(mainwin, y, 0, "%s %s in extreme pain, and movement will cause %s damage.", you(lf), is(lf), isplayer(lf) ? "you" : "it"); + mvwprintw(mainwin, y, 0, "%s %s in extreme pain, and movement will cause %s damage.", you(lf), is(lf), isplayer(lf) ? "You" : "it"); } y++; } @@ -9860,9 +10067,21 @@ void textwithcol(WINDOW *win, char *buf) { done = B_TRUE; break; } - col = chartocol(*p); + if (isdigit(*p)) { // direct enum COLOUR number + char numbuf[4]; + char *np = numbuf; + while (isdigit(*p)) { + *np = *p; + p++; + np++; + } + *np = '\0'; + col = (enum COLOUR) atoi(numbuf); + } else { // descriptive colour, ie 'W'arning + col = chartocol(*p); + p++; + } setcol(win, col); - p++; if (!(*p)) { done = B_TRUE; break; diff --git a/io.h b/io.h index d743f93..d4ee687 100644 --- a/io.h +++ b/io.h @@ -1,6 +1,6 @@ #include #include "defs.h" -void addchoice(prompt_t *p, char ch, char *text, char *desc, void *data); +void addchoice(prompt_t *p, char ch, char *text, char *desc, void *data, char *longdesc); void addheading(prompt_t *p, char *text); void addmsghist(char *text); void addpromptq(prompt_t *p, char *q); @@ -96,6 +96,10 @@ void initgfx(void); void initprompt(prompt_t *p, char *q1); int keycodetokey(int keycode); void listobs(WINDOW *win, object_t **mylist, int *sellist, int *selcount, int firstob, int *counter, int lastline, int *y, char *myletters, int forpickup, int showpoints); +char *makedesc_god(lifeform_t *god, char *retbuf); +char *makedesc_ob(object_t *o, char *retbuf); +char *makedesc_skill(enum SKILL skid, char *retbuf); +char *makedesc_spell(objecttype_t *ot, char *retbuf); void makespellchoicelist(prompt_t *pr, lifeform_t *lf, char *ques, char *ques2, enum SPELLSCHOOL wantschool, int wantunknown, int wantlowmp, int wanttoohard,int mpcutoff); void more(void); void warn(char *format, ... ); diff --git a/lf.c b/lf.c index 9a1cf1b..afca6f8 100644 --- a/lf.c +++ b/lf.c @@ -1266,7 +1266,7 @@ int castspell(lifeform_t *lf, enum OBTYPE sid, lifeform_t *targlf, object_t *tar strcat(buf, "\t"); strcat(buf, desc); } - addchoice(&prompt, '0' + i, buf, buf, NULL); + addchoice(&prompt, '0' + i, buf, buf, NULL, NULL); } ch = getchoice(&prompt); power = ch - '0'; @@ -1506,6 +1506,10 @@ int checkfordrowning(lifeform_t *lf, object_t *o) { flag_t *f; enum SKILLLEVEL slev; + if (!isairborne(lf)) { + return B_FALSE; + } + i = getskill(lf, SK_SWIMMING) - isburdened(lf); limit(&i, 0, NA); slev = i; @@ -1593,44 +1597,6 @@ int checkfordrowning(lifeform_t *lf, object_t *o) { return didsomething; } -/* -void checkxp(enum RACE rid) { - int i,xp; - race_t *r; - - r = findrace(rid); - if (!r) { - dblog("checkxp(): can't find race for rid %d",rid); - return; - } - xp = calcxprace(rid); - - - if (xp < xpposs[0]) { - dblog("** Recommended rarity for %s: 100 (before %s/%d)", - r->name, - raceposs[0]->name, getracerarity(raceposs[0]->id)); - } else if (xp > xpposs[xplistlen-1]) { - dblog("** Recommended rarity for %s: above %d (after %s/%d)", - r->name, getracerarity(raceposs[xplistlen-1]->id), - raceposs[xplistlen-1]->name, getracerarity(raceposs[xplistlen-1]->id)); - } else { - for (i = 0; i < xplistlen-1; i++) { - if ((raceposs[i]->d != r->id) && (raceposs[i+1] != r->id)) - if ((xp >= xpposs[i]) && (xp <= xpposs[i+1])) { - dblog("** Recommended rarity for %s: %d (between %s/%d and %s/%d)", - r->name, (int)((float)xpposs[i] + (float)xpposs[i+1])/2, - raceposs[i]->name, getracerarity(raceposs[i]->id), - raceposs[i+1]->name, getracerarity(raceposs[i+1]->id) - ); - break; - } - } - } - } -} -*/ - int check_rest_ok(lifeform_t *lf) { if (!safetorest(lf)) { if (isplayer(lf)) { @@ -2675,12 +2641,6 @@ int eat(lifeform_t *lf, object_t *o) { pcteaten = (eateachturn / nutrition) * 100; // announce - /* - msg("totnutr:%0.0lf,startpcteaten:%0.0lf,endpcteaten:%0.0f,eatperturn:%0.0f,turnstoeat:%0.0lf,fullyeaten:%s", - nutrition, - startpcteaten,pcteaten, - eateachturn,turnstoeat,fullyeaten ? "YES" : "NO"); - */ snprintf(buf, BUFLEN, "%ld",o->id); alreadyeating = lfhasflagval(lf, F_EATING, NA, NA, NA, buf); @@ -3032,13 +2992,15 @@ void enhanceskills(lifeform_t *lf) { cost = getskilllevcost(f->val[1] + 1); if (lf->skillpoints >= cost) { char buf[BUFLEN]; + char buf2[HUGEBUFLEN]; snprintf(buf, BUFLEN, "%s (%s, cost:%d points)", getskillname(f->val[0]), getskilllevelname(f->val[1] + 1), cost); - addchoice(&prompt, ch++, getskillname(f->val[0]), buf, f); + makedesc_skill(f->val[0], buf2); + addchoice(&prompt, ch++, getskillname(f->val[0]), buf, f, buf2); } } } - addchoice(&prompt, '-', "None", "None", NULL); + addchoice(&prompt, '-', "None", "None", NULL, NULL); while (!done) { getchoicestr(&prompt, B_FALSE, B_TRUE); @@ -3079,11 +3041,13 @@ void enhanceskills(lifeform_t *lf) { for (sk = firstskill ; sk ; sk = sk->next) { if (!getskill(player, sk->id) && canlearn(player, sk->id)) { char buf[BUFLEN]; + char buf2[HUGEBUFLEN]; snprintf(buf, BUFLEN, "%-18s(%s)", getskillname(sk->id), getskilldesc(sk->id)); - addchoice(&prompt, ch++, getskillname(sk->id), buf, sk); + makedesc_skill(sk->id, buf2); + addchoice(&prompt, ch++, getskillname(sk->id), buf, sk, buf2); } } - addchoice(&prompt, '-', "None", "None", NULL); + addchoice(&prompt, '-', "None", "None", NULL, NULL); while (!done) { getchoicestr(&prompt, B_FALSE, B_TRUE); sk = (skill_t *)prompt.result; @@ -3841,13 +3805,6 @@ void gainlevel(lifeform_t *lf) { lf->skillpoints++; } - //if (postready && !preready) { - /* - } else { - killflagsofid(lf->flags, F_HASNEWLEVEL); - } - */ - if (isplayer(lf)) { msg("^GYou are ready to train a new experience level!"); more(); @@ -4871,17 +4828,6 @@ object_t *getbestweapon(lifeform_t *lf) { } } - /* - if (op && (bestwep == op->first)) { - // ie. use no weapon - bestwep = NULL; - } - - if (op) { - killobpile(op); - } - */ - if (bestwep && (bestwep->pile->owner == NULL)) { // ie. best weapon is an innate attack bestwep = NULL; @@ -5034,22 +4980,6 @@ int getguntargetid(lifeform_t *lf) { return f->val[0]; } - -/* -// get time to heal 1 hp -int gethealtime(lifeform_t *lf) { - int healtime; - flag_t *f; - f = lfhasflag(lf, F_HEALTIME); - if (f) { - healtime = f->val[0]; - } else { - healtime = DEF_HEALTIME; - } - return healtime; -} -*/ - int gethearingrange(lifeform_t *lf) { int range = 8; // deafult range = 2 + (getskill(lf, SK_LISTEN)*2); @@ -5557,12 +5487,6 @@ char *getseenlfconditionname(lifeform_t *lf, lifeform_t *viewer) { glyph_t *getlfglyph(lifeform_t *lf) { flag_t *f; - /* - if (isplayer(lf) && !ispolymorphed(lf)) { - return &playerglyph; - } - */ - if (lfhasflag(lf, F_FEIGNINGDEATH)) { // look like a corpse tempglyph.ch = '%'; @@ -6951,9 +6875,12 @@ void givejob(lifeform_t *lf, enum JOB jobid) { job_t *j; flag_t *f; int i; - int rollhp = B_FALSE, rollmp = B_FALSE; + //int rollhp = B_FALSE; + int rollmp = B_FALSE; int rollatt[MAXATTS]; int db = B_FALSE; + flag_t *retflag[MAXCANDIDATES]; + int nretflags; if (db) dblog("givejob() starting.\n"); @@ -6965,13 +6892,11 @@ void givejob(lifeform_t *lf, enum JOB jobid) { addflag(lf->flags, F_JOB, jobid, NA, NA, NULL); j = findjob(jobid); - // override hitdice from race - if (hasflag(j->flags, F_HITDICE)) { - rollhp = B_TRUE; - f = lfhasflag(lf, F_HITDICE); - if (f) { - killflag(f); - } + // apply job's maxhp mod + f = hasflag(j->flags, F_MAXHPMOD); + if (f) { + lf->maxhp = pctof(f->val[0], lf->maxhp); + lf->hp = lf->maxhp; } // override mpdice from race if (hasflag(j->flags, F_MPDICE)) { @@ -6982,7 +6907,15 @@ void givejob(lifeform_t *lf, enum JOB jobid) { } } - // inherit all flags except startob ones + // apply attrib mods from this job + getflags(j->flags, retflag, &nretflags, F_JOBATTRMOD, F_NONE); + for (i = 0; i < nretflags; i++) { + f = retflag[i]; + modattr(lf, f->val[0], f->val[1]); + } + + // inherit all flags except: + // - hpmod ones for (f = j->flags->first ; f ; f = f->next) { int ignorethis = B_FALSE; int val[3]; @@ -7018,12 +6951,21 @@ void givejob(lifeform_t *lf, enum JOB jobid) { ignorethis = B_TRUE; } + switch (f->id) { + case F_MAXHPMOD: + case F_JOBATTRMOD: + ignorethis = B_TRUE; + break; + default: + break; + } + if (!ignorethis) { if (db) dblog("inheriting flagid %d.", f->id); addflag_real(lf->flags, id, val[0], val[1], val[2], text, FROMJOB,B_TRUE, -1); - if (id == F_STARTATT) { + if (id == F_STARTATT) { // need to reroll attribs if we override them. rollatt[val[0]] = B_TRUE; - } + } } } @@ -7035,6 +6977,7 @@ void givejob(lifeform_t *lf, enum JOB jobid) { // override hp/mp from race + /* if (rollhp) { lf->maxhp = 0; for (i = 0; i < lf->level; i++) { @@ -7043,6 +6986,7 @@ void givejob(lifeform_t *lf, enum JOB jobid) { } lf->hp = lf->maxhp; } + */ if (rollmp) { f = hasflag(lf->flags, F_MPDICE); @@ -7461,7 +7405,7 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp) { initprompt(&prompt, buf); for (i = 0; i < nposs; i++) { - addchoice(&prompt, ch++, poss[i]->name, NULL, poss[i]); + addchoice(&prompt, ch++, poss[i]->name, NULL, poss[i], NULL); } if (prompt.nchoices == 1) { @@ -7684,7 +7628,7 @@ int gotosleep(lifeform_t *lf, int onpurpose) { return B_TRUE; } if (onpurpose) taketime(lf, getactspeed(lf)); - addflag(lf->flags, F_ASLEEP, B_TRUE, NA, onpurpose ? B_TRUE : NA, NULL); + addflag(lf->flags, F_ASLEEP, B_TRUE, lfhasflag(lf, F_MEDITATES) ? B_TRUE : NA, onpurpose ? B_TRUE : NA, NULL); return B_FALSE; } @@ -7923,48 +7867,6 @@ int lfcanbestoned(lifeform_t *lf) { // conferred by a held/equipped object? flag_t *lfhasflag(lifeform_t *lf, enum FLAG fid) { flag_t *f; - - // note: we check conferred flags first because we want - // these to override ones direclty on the player. - - // does a held object give us this flag? - /* - o = hasobwithflagval(lf->pack, F_HOLDCONFER, fid, NA, NA, NULL); - if (o) { - // return the flag, not the objcet - f = hasflagval(o->flags, F_HOLDCONFER, fid, NA, NA, NULL); - if (f) return f; - } - - for (o = lf->pack->first ; o ; o = o->next) { - f = hasflagval(o->flags, F_HOLDCONFER, fid, NA, NA, NULL); - if (f) { - if (f->val[2] == B_IFIDENT) { - if (isknown(o)) return f; - } else { - return f; - } - } - } - */ - - /* - // does an equipped object give us this flag? - for (o = lf->pack->first ; o ; o = o->next) { - if (hasflag(o->flags, F_EQUIPPED)) { - f = hasflagval(o->flags, F_EQUIPCONFER, fid, NA, NA, NULL); - if (f) { - if (f->val[2] == B_IFIDENT) { - if (isknown(o)) return f; - } else { - return f; - } - } - } - } - */ - - // do we have this flag directly? f = hasflag(lf->flags, fid); if (f) return f; return NULL; @@ -7974,86 +7876,12 @@ flag_t *lfhasflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2 flag_t *f; f = hasflagval(lf->flags, fid, val0, val1, val2, text); if (f) return f; - - // does a held object give us this flag? - /* - o = hasobwithflagval(lf->pack, F_HOLDCONFER, fid, val0, val1, text); - if (o) { - // return the flag, not the objcet - f = hasflagval(o->flags, F_HOLDCONFER, fid, val0, val1, text); - if (f) return f; - } - - for (o = lf->pack->first ; o ; o = o->next) { - f = hasflagval(o->flags, F_HOLDCONFER, fid, val0, val1, text); - if (f) { - if (f->val[2] == B_IFIDENT) { - if (isknown(o)) return f; - } else { - return f; - } - } - } - */ - - // does an equipped object give us this flag? - /* - for (o = lf->pack->first ; o ; o = o->next) { - if (hasflag(o->flags, F_EQUIPPED)) { - f = hasflagval(o->flags, F_EQUIPCONFER, fid, val0, val1, NULL); - if (f) { - if (f->val[2] == B_IFIDENT) { - if (isknown(o)) return f; - } else { - return f; - } - } - } - } - */ return NULL; } flag_t *lfhasknownflag(lifeform_t *lf, enum FLAG fid) { flag_t *f; - // note: we check conferred flags first because we want - // these to override ones direclty on the player. - - /* - - for (o = lf->pack->first ; o ; o = o->next) { - if (isknown(o)) { - f = hasflagval(o->flags, F_HOLDCONFER, fid, NA, NA, NULL); - if (f && f->known) { - if (f->val[2] == B_IFIDENT) { - if (isknown(o)) return f; - } else { - return f; - } - } - } - } - - */ - // does an equipped object give us this flag? - /* - for (o = lf->pack->first ; o ; o = o->next) { - if (isknown(o)) { - if (hasflag(o->flags, F_EQUIPPED)) { - f = hasflagval(o->flags, F_EQUIPCONFER, fid, NA, NA, NULL); - if (f && f->known) { - if (f->val[2] == B_IFIDENT) { - if (isknown(o)) return f; - } else { - return f; - } - } - } - } - } - */ - // do we have this flag directly? f = hasflagknown(lf->flags, fid); if (f && f->known) return f; @@ -8062,38 +7890,6 @@ flag_t *lfhasknownflag(lifeform_t *lf, enum FLAG fid) { flag_t *lfhasknownflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2, char *text) { flag_t *f; - - /* - for (o = lf->pack->first ; o ; o = o->next) { - if (isknown(o)) { - f = hasflagval(o->flags, F_HOLDCONFER, fid, val0, val1, text); - if (f && f->known) { - if (f->val[2] == B_IFIDENT) { - if (isknown(o)) return f; - } else { - return f; - } - } - } - } - - // does an equipped object give us this flag? - for (o = lf->pack->first ; o ; o = o->next) { - if (isknown(o)) { - if (hasflag(o->flags, F_EQUIPPED)) { - f = hasflagval(o->flags, F_EQUIPCONFER, fid, val0, val1, NULL); - if (f && f->known) { - if (f->val[2] == B_IFIDENT) { - if (isknown(o)) return f; - } else { - return f; - } - } - } - } - } - */ - // got the flag directly? f = hasflagvalknown(lf->flags, fid, val0, val1, val2, text); if (f && f->known) return f; @@ -8583,9 +8379,11 @@ int isbleeding(lifeform_t *lf) { } int isblind(lifeform_t *lf) { + flag_t *f; if (!lf) return B_FALSE; - if (lfhasflag(lf, F_ASLEEP)) { + f = lfhasflag(lf, F_ASLEEP); + if (f && (f->val[1] == NA)) { return B_TRUE; } if (lfhasflag(lf, F_BLIND)) { @@ -9267,7 +9065,6 @@ void addtrail(lifeform_t *lf, int dir) { // footprints first if (!isairborne(lf) && !lfhasflag(lf, F_NONCORPOREAL)) { int fpdir; - if (getskill(lf, SK_PERCEPTION) >= PR_EXPERT) { // no footprints! return; @@ -9613,11 +9410,6 @@ int areallies(lifeform_t *lf1, lifeform_t *lf2) { } } } - /* - if (getallegiance(lf1) == getallegiance(lf2)) { - return B_TRUE; - } - */ return B_FALSE; } @@ -10419,7 +10211,7 @@ void makenoise(lifeform_t *lf, enum NOISETYPE nid) { if (nid == N_WALK) { volume += getarmournoise(lf); } - noise(lf->cell, lf, NC_OTHER, volume, noisetext, verb); + noise(lf->cell, lf, (nid == N_WALK) ? NC_WALK : NC_OTHER, volume, noisetext, verb); } else { // some defaults if (nid == N_WALK) { @@ -10462,7 +10254,7 @@ void makenoise(lifeform_t *lf, enum NOISETYPE nid) { } volume += getarmournoise(lf); if (strlen(movetext)) { - noise(lf->cell, lf, NC_OTHER, volume, movetext, NULL); + noise(lf->cell, lf, (nid == N_WALK) ? NC_WALK : NC_OTHER, volume, movetext, NULL); } } else if (nid == N_WARCRY) { noise(lf->cell, lf, NC_OTHER, 4, "a blood-curdling war cry!", "shouts a blood-curdling war-cry!"); @@ -10837,7 +10629,8 @@ int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nt, int volume, cha msg("%s %s.", lfname, realseetext); rv = B_TRUE; } - } else if (text && !lfhasflag(l, F_DEAF) && ((nt == NC_SPEECH) || !lfhasflag(l, F_DONELISTEN))) { + } else if (text && !lfhasflag(l, F_DEAF) && ((nt != NC_WALK) || !lfhasflag(l, F_DONELISTEN))) { + // this means you can only hear one 'walk' sound per turn char textnopunc[BUFLEN]; char punc; int dist; @@ -10922,8 +10715,8 @@ int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nt, int volume, cha msg("You hear %s", text); rv = B_TRUE; } - // only hear one thing per turn. - if (isplayer(l)) { + // can only hear one 'walk' sound per turn. + if (isplayer(l) && (nt == NC_WALK)) { addflag(l->flags, F_DONELISTEN, B_TRUE, NA, NA, NULL); practice(l, SK_LISTEN, 1); } @@ -11127,9 +10920,6 @@ int pickup(lifeform_t *lf, object_t *what, int howmany, int fromground, int want msg("%s picks up %s.",buf, obname); } } - /* - taketime(lf, (SPEED_PICKUP * howmany)); - */ taketime(lf, SPEED_PICKUP); // TODO: update burdened status @@ -11367,16 +11157,6 @@ void precalclos_new(lifeform_t *lf) { calcbresnham(lf->cell->map, lf->cell->x, lf->cell->y, endx[nn], endy[nn], retcell, &numpixels ); // keep going until we lose los for (n = 0; keepgoing && (n < numpixels); n++) { - /* - // calc x/y change - xd = precos[ang]; - yd = presin[ang]; - //limitd(&xd, -1, 1); - //limitd(&yd, -1, 1); - // get new cell - x += xd; - y += yd; - */ c = retcell[n]; if (n != 0) currange++; if (currange > maxvisrange) c = NULL; @@ -11419,33 +11199,6 @@ void precalclos_new(lifeform_t *lf) { } assert(nlos < (MAX_MAPW * MAX_MAPH)); - // deal with enhanced smell - do a second sweep in all directions. - /* - if (enhancesmell) { - int n; - get_circular_fov_endpoints(lf, enhancesmell->val[0], endx, endy, &nendcells); - - for (i = 0;i < nendcells; i++) { - calcbresnham(lf->cell->map, lf->cell->x, lf->cell->y, endx[i], endy[i], retcell, &numpixels ); - // keep going until we lose los - for (n = 0; n < numpixels; n++) { - if ((retcell[n]->lf && (retcell[n]->lf->race->raceclass->id != RC_UNDEAD)) || - hasobwithflag(retcell[n]->obpile, F_SMELLY) ) { // && (endcell[i]->lf != lf)) { - int nn,found = B_FALSE; - for (nn = 0; nn < nlos; nn++) { // can we already see this cell? - if (los[nn] == retcell[n]) { - found = B_TRUE; break; - } - } - if (!found) { - los[nlos++] = retcell[n]; - } - } - } - } - } - */ - // now fill in lifeform structure lf->los = malloc(sizeof(cell_t *) * nlos); for (i = 0; i < nlos; i++) { @@ -12333,25 +12086,6 @@ void interrupt(lifeform_t *lf) { killflagsofid(lf->flags, F_AUTOCMD); } -/*j -void setlftarget(lifeform_t *lf, lifeform_t *victim) { - // first remove existing targets - killflagsofid(lf->flags, F_TARGET); - killflagsofid(lf->flags, F_TARGETCELL); - - // set new target - addflag(lf->flags, F_TARGET, victim->id, victim->cell->x, victim->cell->x, NULL); - - if (!areenemies(lf, victim)) { - if (getallegiance(victim) == AL_FRIENDLY) { - if (!hasflag(lf->flags, F_HOSTILE)) { - addflag(lf->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); - } - } - } -} -*/ - int setlfmaterial(lifeform_t *lf, enum MATERIAL id) { if (getlfmaterial(lf) == id) { return B_TRUE; @@ -13689,12 +13423,12 @@ int steal(lifeform_t *lf, obpile_t *op, enum FLAG wantflag) { } if (ok) { getobname(o, buf, 1); - addchoice(&prompt, fromground ? letter++ : o->letter, buf, NULL, o); + addchoice(&prompt, fromground ? letter++ : o->letter, buf, NULL, o, NULL); } } if (prompt.nchoices > 1) { if (isplayer(lf) && (slev >= PR_ADEPT)) { - addchoice(&prompt, '-', "Nothing", NULL, NULL); + addchoice(&prompt, '-', "Nothing", NULL, NULL, NULL); // pick what you want getchoice(&prompt); o = (object_t *)prompt.result; @@ -13808,11 +13542,11 @@ void stopresting(lifeform_t *lf) { if (f) { killflag(f); if (isplayer(lf)) { - msg("Your rest is interrupted!"); + msg("Your %s is interrupted!", (f->val[1] == NA) ? "rest" : "meditation"); } else if (cansee(player, lf)) { char buf[BUFLEN]; getlfname(lf, buf); - msg("%s stops resting.",buf); + msg("%s stops %s.",buf, (f->val[1] == NA) ? "resting" : "meditating"); } statdirty = B_TRUE; } @@ -13960,12 +13694,6 @@ void taketime(lifeform_t *lf, long howlong) { return; } - /* - if (isplayer(lf)) { - statdirty = B_TRUE; - } - */ - map = lf->cell->map; assert(howlong > 0); @@ -14845,6 +14573,15 @@ int validateraces(void) { printf("ERROR in race '%s' - F_HITCONFER, but no HITCONFERVALS defined.\n", r->name); goterror = B_TRUE; } + } else if (f->id == F_PLAYABLE) { + // playable races must have fully defined stats + enum ATTRIB a; + for (a = 0 ; a < MAXATTS; a++) { + if (!hasflagval(r->flags, F_STARTATT, a, NA, NA, NULL)) { + printf("ERROR in race '%s' - race is f_playable but has no f_startatt %s\n", r->name, getattrname(a)); + goterror = B_TRUE; + } + } } else if (f->id == F_STARTATT) { if (strlen(f->text) && (f->val[1] != NA)) { printf("ERROR in race '%s' - F_STARTATT has both text range and val1.", r->name); @@ -15212,9 +14949,9 @@ int wear(lifeform_t *lf, object_t *o) { } else { snprintf(buf, BUFLEN, "%s", getbodypartname(possbp[i])); } - addchoice(&prompt, ch++, buf, NULL, &possbp[i]); + addchoice(&prompt, ch++, buf, NULL, &possbp[i], NULL); } - addchoice(&prompt, '-', "(cancel)", NULL, NULL); + addchoice(&prompt, '-', "(cancel)", NULL, NULL, NULL); ch = getchoice(&prompt); if (ch == '-') { @@ -15336,20 +15073,6 @@ int wear(lifeform_t *lf, object_t *o) { maketried(o->type->id); - /* - if (isplayer(lf)) { - // equipping unknown objects makes them known - if (!isknown(o)) { - // announce - announceob(o->type->id); - - // make the obejct type known - makeknown(o->type->id); - getobname(o, obname, 1); - } - } - */ - // when you wear armour, you find out // its bonuses. if (isplayer(lf) && (o->type->obclass->id == OC_ARMOUR)) { @@ -15562,20 +15285,6 @@ int weild(lifeform_t *lf, object_t *o) { } } } - /* - // this weapon is two handed and uses the other hand - if (hasflag(oo->flags, F_TWOHANDED)) { - f = hasflagval(oo->flags, F_EQUIPPED, otherloc, -1, -1, NULL); - if (f) { - // unweild it - if (unweild(lf, oo)) { - // if we can't unweild old weapon, stop - return B_TRUE; - } - } - } - */ - // new weapon is two handed? check other hand too. if (twohanded) { f = hasflagval(oo->flags, F_EQUIPPED, otherloc, -1, -1, NULL); diff --git a/map.c b/map.c index f2f0e13..74c8def 100644 --- a/map.c +++ b/map.c @@ -1519,6 +1519,19 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int for (rx = x; (rx < x+w) && valid; rx++) { int includethiscell = B_FALSE; cell = getcellat(map, rx,ry); + + + // NEVER create a vault 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; + } + // is this cell adjacent to an empty cell and not a // corner (ie. a valid door location) if (countcellexits(cell)) { @@ -1548,12 +1561,6 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int valid = B_FALSE; } } - // NEVER create it 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; - } } } } diff --git a/nexus.c b/nexus.c index 99d113b..5df8e99 100644 --- a/nexus.c +++ b/nexus.c @@ -108,7 +108,7 @@ int main(int argc, char **argv) { char welcomemsg[BUFLEN]; int ch; FILE *playerfile = NULL; - int x,y; + int x,y,i; cell_t *c; vault_t *v; enum SKILLLEVEL slev; @@ -150,11 +150,21 @@ int main(int argc, char **argv) { } } + // init prompt + for (i = 0; i < MAXCHOICES; i++) { + choice_t *c; + c = &prompt.choice[i]; + c->text = NULL; + c->desc = NULL; + c->longdesc = NULL; + } + // if no player (ie. didn't load a game), add them if (!player) { char *user,pname[BUFLEN],buf[BUFLEN]; job_t *j = NULL; + race_t *startrace = NULL; char ch; object_t *o; cell_t *where; @@ -166,7 +176,7 @@ int main(int argc, char **argv) { // populate scroll, potion, etc names genhiddennames(); - // read from input file if required + // read from rc file if required if (playerfile) { char *p; while (!feof(playerfile)) { @@ -181,13 +191,31 @@ int main(int argc, char **argv) { fseek(playerfile, 0, SEEK_SET); } - if (!j) { + + if (!startrace) { + race_t *r; // ask for race + initprompt(&prompt, "Select your race:"); + ch = 'a'; + for (r = firstrace ; r ; r = r->next) { + if (hasflag(r->flags, F_PLAYABLE)) { + addchoice(&prompt, ch++, r->name, NULL, r, NULL); + } + } + startrace = NULL; + while (!startrace) { + getchoicestr(&prompt, B_FALSE, B_TRUE); + startrace = prompt.result; + } + } + + if (!j) { + // ask for job initprompt(&prompt, "Select your job:"); ch = 'a'; for (j = firstjob ; j ; j = j->next) { if (!hasflag(j->flags, F_NOPLAYER)) { - addchoice(&prompt, ch++, j->name, NULL, j); + addchoice(&prompt, ch++, j->name, NULL, j, NULL); } } j = NULL; @@ -232,7 +260,7 @@ int main(int argc, char **argv) { more(); exit(1); } - real_addlf(where, R_HUMAN, 1, C_PLAYER); // this will assign 'player' + real_addlf(where, startrace->id, 1, C_PLAYER); // this will assign 'player' addflag(player->flags, F_CANWILL, OT_A_PRAY, NA, NA, NULL); addflag(player->flags, F_CANWILL, OT_A_TRAIN, NA, NA, NULL); addflag(player->flags, F_CANWILL, OT_A_DEBUG, NA, NA, NULL); ///////// @@ -252,9 +280,9 @@ int main(int argc, char **argv) { if (j->id == J_WIZARD) { skill_t *sk; initprompt(&prompt, "Select your primary spell specialty:"); - addchoice(&prompt, 'a', getskillname(SK_SS_AIR), NULL, findskill(SK_SS_AIR)); - addchoice(&prompt, 'c', getskillname(SK_SS_COLD), NULL, findskill(SK_SS_COLD)); - addchoice(&prompt, 'f', getskillname(SK_SS_FIRE), NULL, findskill(SK_SS_FIRE)); + addchoice(&prompt, 'a', getskillname(SK_SS_AIR), NULL, findskill(SK_SS_AIR), NULL); + addchoice(&prompt, 'c', getskillname(SK_SS_COLD), NULL, findskill(SK_SS_COLD), NULL); + addchoice(&prompt, 'f', getskillname(SK_SS_FIRE), NULL, findskill(SK_SS_FIRE), NULL); getchoice(&prompt); sk = (skill_t *) prompt.result; giveskilllev(player, sk->id, PR_BEGINNER); @@ -272,10 +300,10 @@ int main(int argc, char **argv) { break; } initprompt(&prompt, "Select your secondary spell school:"); - addchoice(&prompt, 'd', getskillname(SK_SS_DIVINATION), NULL, findskill(SK_SS_DIVINATION)); - addchoice(&prompt, 'm', getskillname(SK_SS_MODIFICATION), NULL, findskill(SK_SS_MODIFICATION)); - addchoice(&prompt, 's', getskillname(SK_SS_SUMMONING), NULL, findskill(SK_SS_SUMMONING)); - addchoice(&prompt, 't', getskillname(SK_SS_TRANSLOCATION), NULL, findskill(SK_SS_TRANSLOCATION)); + addchoice(&prompt, 'd', getskillname(SK_SS_DIVINATION), NULL, findskill(SK_SS_DIVINATION), NULL); + addchoice(&prompt, 'm', getskillname(SK_SS_MODIFICATION), NULL, findskill(SK_SS_MODIFICATION), NULL); + addchoice(&prompt, 's', getskillname(SK_SS_SUMMONING), NULL, findskill(SK_SS_SUMMONING), NULL); + addchoice(&prompt, 't', getskillname(SK_SS_TRANSLOCATION), NULL, findskill(SK_SS_TRANSLOCATION), NULL); getchoice(&prompt); sk = (skill_t *) prompt.result; giveskilllev(player, sk->id, PR_NOVICE); diff --git a/objects.c b/objects.c index c9223a1..5dfd1d2 100644 --- a/objects.c +++ b/objects.c @@ -1739,19 +1739,9 @@ objecttype_t *addot(enum OBTYPE id, char *name, char *description, int material, a->obclass = findoc(obclassid); a->flags = addflagpile(NULL, NULL); // inherit flags from object class - /* - for (f = a->obclass->flags->first ; f ; f = f->next) { - addflag(a->flags, f->id, f->val[0], f->val[1], f->val[2], f->text); - } - */ copyflags(a->flags, a->obclass->flags, NA); if (a->material) { // inherit flags from material - /* - for (f = a->material->flags->first ; f ; f = f->next) { - addflag(a->flags, f->id, f->val[0], f->val[1], f->val[2], f->text); - } - */ copyflags(a->flags, a->material->flags, FROMMAT); } @@ -1959,17 +1949,6 @@ void adjustdamob(object_t *o, unsigned int *dam, enum DAMTYPE damtype) { adjustdamhardness(dam, damtype, o->material->id); } -// adjust price for magical effects etc -/* -void adjustprice(objecttype_t *ot, float *price) { - int min,max; - flag_t *f; - - // bonuses/penalties - -} -*/ - // adjusts armour's ac//evasion penalty based on skill int adjustarmourpenalty(lifeform_t *lf, float amt) { enum SKILLLEVEL slev; @@ -2113,15 +2092,6 @@ void brightflash(cell_t *centre, int range, lifeform_t *immunelf) { msg("You see an intense flash of light!"); more(); } - /* - if (getcelldist(player->cell, centre) <= range) { - // player is in range but can't see - announce it beacuse it - // will make you deaf! - youhear(centre, "a deafening bang!"); - } else { // not in range of the flash - youhear(centre, "a loud bang!"); - } - */ // blind monsters for (y = centre->y - range; y <= centre->y + range; y++) { for (x = centre->x - range; x <= centre->x + range; x++) { @@ -2616,19 +2586,6 @@ void explodeob(object_t *o, flag_t *f, int bigness) { } explodecells(c, dam * o->amt, bigness ? B_TRUE : B_FALSE, o, bigness ? 1 : 0, DT_COMPASS, B_FALSE); - // hurt everything! - /* - if (bigness) { - int dir; - cell_t *cc; - explodecell(c, dam, (bigness) ? B_TRUE : B_FALSE, NULL); - for (dir = DC_N; dir <= DC_NW; dir++) { - cc = getcellindir(c, dir); - } - } else { - explodecell(c, dam, (bigness) ? B_TRUE : B_FALSE, NULL); - } - */ // object dies. removeob(o, o->amt); } @@ -3350,18 +3307,6 @@ int getobvalue(object_t *o) { default: break; } - /* - if (rarity >= 70) { - price /= 1.5; - } else if (rarity <= 40) { - price *= 1.5; - } else if (rarity <= 20) { - price *= 2; - } else if (rarity <= 10) { - price *= 5; - } - */ - // blessed/cursed if (isblessed(o) || iscursed(o)) price *= 1.25; @@ -3372,20 +3317,6 @@ int getobvalue(object_t *o) { return (int) price; } -/* -int getobtypevalue(objecttype_t *ot) { - float price; - if (ot->id == OT_GOLD) { - return 1; - } - // base value: weight * material value - price = (float)ot->weight * (float)getmaterialvalue(ot->material->id); - - adjustprice(ot, &price); - return (int) price; -} -*/ - char *getoperateverb(object_t *o) { if (hasflag(o->flags, F_CONTAINER) && (o->type->id != OT_VENDINGMACHINE)) { return "open"; @@ -3397,12 +3328,6 @@ char *getoperateverb(object_t *o) { // ie if you call this on a gem inside a bag inside // a barrel, will return the barrel. object_t *getoutercontainer(object_t *o) { - /* - while (o->pile->parentob) { - o = o->pile->parentob; - } - return o; - */ return getoutercontainerop(o->pile); } @@ -4073,20 +3998,6 @@ char *getobextrainfo(object_t *o, char *buf) { cell_t *getoblocation(object_t *o) { return getobpilelocation(o->pile); - /* - if (o->pile->owner) { // held by someone - return o->pile->owner->cell; - } else if (o->pile->where) { // on the ground - return o->pile->where; - } else if (o->pile->parentob) { // inside another object - object_t *outerob; - // get outside object - outerob = getoutercontainer(o); - return getoblocation(outerob); - } - // in a dummy cell - return NULL; - */ } cell_t *getobpilelocation(obpile_t *op) { @@ -5592,14 +5503,6 @@ int isbetterwepthan(object_t *a, object_t *b) { if (!a) return B_FALSE; if (!b) return B_TRUE; - /* if (a->pile->owner && lfhasflag(a->pile->owner, F_DEBUG)) { - db = B_TRUE; - } - if (b->pile->owner && lfhasflag(b->pile->owner, F_DEBUG)) { - db = B_TRUE; - } */ - - if (db) { getobname(a, namea, a->amt); getobname(b, nameb, b->amt); @@ -7300,17 +7203,6 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) { return B_TRUE; } - /* - if (lf->controller != C_PLAYER) { - - if (haslos(player, lf->cell)) { - getlfname(lf, buf); - capitalise(buf); - msg("%s operates %s.", buf, obname); - } - } - */ - if (hasflag(o->flags, F_CONTAINER) && (o->type->id != OT_VENDINGMACHINE)) { // loot it if (isplayer(lf)) { // only player can loot. char ch; @@ -7318,16 +7210,16 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) { initprompt(&prompt, buf); if (countobs(lf->pack, B_FALSE)) { snprintf(buf, BUFLEN, "Put items in %s",obname); - addchoice(&prompt, 'i', buf, NULL, NULL); + addchoice(&prompt, 'i', buf, NULL, NULL, NULL); } if (countobs(o->contents, B_FALSE)) { snprintf(buf, BUFLEN, "Take items out of %s",obname); - addchoice(&prompt, 'o', buf, NULL, NULL); + addchoice(&prompt, 'o', buf, NULL, NULL, NULL); } snprintf(buf, BUFLEN, "Both"); - addchoice(&prompt, 'b', buf, NULL, NULL); + addchoice(&prompt, 'b', buf, NULL, NULL, NULL); snprintf(buf, BUFLEN, "Neither"); - addchoice(&prompt, 'n', buf, NULL, NULL); + addchoice(&prompt, 'n', buf, NULL, NULL, NULL); ch = getchoice(&prompt); switch (ch) { case 'i': @@ -9561,7 +9453,6 @@ int shatter(object_t *o, int hitlf, char *damstring, lifeform_t *fromlf) { strcpy(prefix, ""); } - msg("%s%s shatter%s!",prefix, strlen(prefix) ? noprefix(obname) : obname, (o->amt == 1) ? "s" : ""); @@ -9582,7 +9473,6 @@ int shatter(object_t *o, int hitlf, char *damstring, lifeform_t *fromlf) { } } - // place shards if (o->material->id == MT_GLASS) { int numshards; @@ -9648,6 +9538,7 @@ int shatter(object_t *o, int hitlf, char *damstring, lifeform_t *fromlf) { case OT_POT_POLYMORPH: case OT_POT_INVIS: case OT_POT_SANCTUARY: // apply regular potion effects, and make them known + case OT_POT_SLEEP: if (target) { if (seen) { makeknown(o->type->id); @@ -10236,7 +10127,7 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, // identify as cursed! } - if (haslos(player, where)) { + if (haslos(player, where) || haslos(player, srcloc)) { // can see the src/dst location seen = B_TRUE; } else { seen = B_FALSE; @@ -10296,14 +10187,6 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, } else if (seen) { char throwstring[BUFLEN]; // an object is moving on its own - - /* - if (target) { - msg("Something %ss %s at %s.", throwverbpres, obname, targetname); - } else { - msg("Something %ss %s.",throwverbpres, obname); - } - */ if (o->pile->owner && cansee(player, o->pile->owner)) { char ownername[BUFLEN]; getlfname(o->pile->owner, ownername); @@ -10708,14 +10591,6 @@ void timeeffectsob(object_t *o) { getobname(o, obname, o->amt); location = getoblocation(o); - /* - if (o->pile->where) { - location = o->pile->where; - } else { - location = NULL; - } - */ - if (o->pile->owner) { owner = o->pile->owner; getlfname(owner, ownername); @@ -10775,15 +10650,6 @@ void timeeffectsob(object_t *o) { if (!glowflag) { // start glowing glowflag = addtempflag(o->flags, F_PRODUCESLIGHT, 2, NA, NA, NULL, FROMBLESSING); - /* - if (isplayer(o->pile->owner)) { - msg("Your %s start%s glowing!",noprefix(obname), (o->amt == 1) ? "s" : ""); - if (!o->blessknown) o->blessknown = B_TRUE; - } else if (haslos(player, ourcell)) { - msg("%s start%s glowing!",obname, (o->amt == 1) ? "s" : ""); - if (!o->blessknown) o->blessknown = B_TRUE; - } - */ if (haslos(player, ourcell)) { if (!o->blessknown) o->blessknown = B_TRUE; } @@ -10795,15 +10661,6 @@ void timeeffectsob(object_t *o) { if (glowflag) { killflag(glowflag); glowflag = NULL; - /* - if (isplayer(o->pile->owner)) { - msg("Your %s stop%s glowing.",noprefix(obname), (o->amt == 1) ? "s" : ""); - if (!o->blessknown) o->blessknown = B_TRUE; - } else if (haslos(player, ourcell)) { - msg("%s stop%s glowing.",obname, (o->amt == 1) ? "s" : ""); - if (!o->blessknown) o->blessknown = B_TRUE; - } - */ } } } @@ -11542,13 +11399,6 @@ int validateobs(void) { printf("ERROR - spell %s doesn't have F_SPELLSCHOOL.\n", ot->name); goterror = B_TRUE; } - /* - if (!hasflag(ot->flags, F_SPELLLETTER)) { - printf("ERROR - spell %s doesn't have F_SPELLLETTER.\n", ot->name); - goterror = B_TRUE; - } - */ - if ((ot->obclass->id == OC_SPELL) && !hasflag(ot->flags, F_SPELLLEVEL)) { printf("ERROR - spell %s doesn't have F_SPELLLEVEL.\n", ot->name); goterror = B_TRUE; @@ -11661,23 +11511,6 @@ int validateobs(void) { } } - /* - for (sk = firstskill ; sk ; sk = sk->next) { - int found = B_FALSE; - // make sure every skill have an object providing it - for (ot = objecttype ; ot ; ot = ot->next) { - if (hasflagval(ot->flags, F_MANUALOF, sk->id, NA, NA, NULL)) { - found = B_TRUE; - break; - } - } - if (!found) { - printf("ERROR - skill '%s' has no matching manual.\n", sk->name); - goterror = B_TRUE; - } - } - */ - return goterror; } @@ -11870,15 +11703,6 @@ int getmissileaccuracy(lifeform_t *thrower, cell_t *where, object_t *missile, ob rangemod = 30 - ((int) (((float)howfar / (float)maxrange) * 60.0)); acc += rangemod; } - /* - if (howfar == 1) { - acc += 30; - } else if (howfar == maxrange) { - if (slev != PR_MASTER) { - acc -= 30; - } - } - */ // modify for dexterity if (whichatt != A_NONE) { diff --git a/save.c b/save.c index 9aefc3e..e3c7b9c 100644 --- a/save.c +++ b/save.c @@ -1085,6 +1085,7 @@ int writehiscore(lifeform_t *lf, int *rank) { int rc; char filename[BUFLEN],*cmd; char pname[BUFLEN]; + char racename[BUFLEN]; char jobname[BUFLEN]; char killedby[BUFLEN]; char *errmsg = NULL; @@ -1106,7 +1107,9 @@ int writehiscore(lifeform_t *lf, int *rank) { getplayername(pname); j = getjob(player); - snprintf(jobname, BUFLEN, "Lv%d %s", player->level, j->name); + strcpy(racename, player->race->name); + capitalise(racename); + snprintf(jobname, BUFLEN, "Lv%d %s %s", player->level, racename, j->name); makekillertext(killedby, lf->lastdam, B_FALSE); diff --git a/spell.c b/spell.c index 7608517..61d21d2 100644 --- a/spell.c +++ b/spell.c @@ -858,7 +858,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef // 1.compile a list of repairable objects // sk_armour lets you repair armour up to xx% (depends on skill) initprompt(&prompt, "Repair which object?"); - addchoice(&prompt, '-', "Cancel", "Cancel", NULL); + addchoice(&prompt, '-', "Cancel", "Cancel", NULL, NULL); for (o = user->pack->first ; o ; o = o->next) { int ok = B_FALSE; int cutoff = 0; @@ -877,7 +877,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef char buf[BUFLEN]; getobname(o, buf, o->amt); // we can repair this object - addchoice(&prompt, o->letter, buf, buf, o); + addchoice(&prompt, o->letter, buf, buf, o, NULL); } } } @@ -1002,7 +1002,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef } // ask what to inspect - initprompt(&prompt, "Study which scroll"); + initprompt(&prompt, "Study which scroll?"); for (o = user->pack->first ; o ; o = o->next) { if ((o->type->obclass->id == OC_SCROLL) && isknown(o)) { f = hasflag(o->flags, F_LINKSPELL); @@ -1011,10 +1011,15 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef getobname(o, buf, o->amt); difficulty = 20 + (getspelllevel(f->val[0])*3); sprintf(buf2, "%s (%d%% success chance)", buf, difficulty); - addchoice(&prompt, o->letter, buf, NULL, f); + addchoice(&prompt, o->letter, buf, NULL, f, NULL); } } } + + if (!prompt.nchoices) { + msg("You have no scrolls which you need to study."); + return B_TRUE; + } getchoice(&prompt); f = (flag_t *)prompt.result; if (!f) { @@ -1348,8 +1353,10 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef initprompt(&prompt, "Which skill will you learn?"); ch = 'a'; for (sk = firstskill ; sk ; sk = sk->next) { + char buf2[HUGEBUFLEN]; snprintf(buf, BUFLEN, "%s (%s)",getskillname(sk->id), getskilldesc(sk->id)); - addchoice(&prompt, ch++, getskillname(sk->id), buf, sk); + makedesc_skill(sk->id, buf2); + addchoice(&prompt, ch++, getskillname(sk->id), buf, sk, buf2); } getchoicestr(&prompt, B_FALSE, B_TRUE); sk = (skill_t *)prompt.result; @@ -1359,7 +1366,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef initprompt(&prompt, "How much will you learn this skill?"); for (i = getskill(user, sk->id) + 1 ; i <= PR_MASTER; i++) { snprintf(buf, BUFLEN, "%s",getskilllevelname(i)); - addchoice(&prompt, ch++, buf, buf, NULL); + addchoice(&prompt, ch++, buf, buf, NULL, NULL); } if (prompt.nchoices <= 0) { msg("You have already mastered this skill!"); @@ -1890,7 +1897,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef if (classok && !isknown(o)) { char buf[BUFLEN]; getobname(o, buf, o->amt); - addchoice(&prompt, o->letter, buf, NULL, o); + addchoice(&prompt, o->letter, buf, NULL, o, NULL); } } getchoice(&prompt); @@ -2576,10 +2583,10 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ // which object to take? initprompt(&prompt, "Confiscate which object?"); - addchoice(&prompt, '-', "(Cancel)", NULL, NULL); + addchoice(&prompt, '-', "(Cancel)", NULL, NULL, NULL); for (o = target->pack->first ; o ; o = o->next) { getobname(o, obname, o->amt); - addchoice(&prompt, ch, obname, NULL, o); + addchoice(&prompt, ch, obname, NULL, o, NULL); if (ch == 'z') { ch = 'A'; } else { @@ -4899,7 +4906,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ for (l = caster->cell->map->lf ; l ; l = l->next) { if (l != caster) { if (isimmuneto(l->flags, DT_NECROTIC) || - spellresisted(target, caster, spellid, power, seenbyplayer, B_FALSE)) { + spellresisted(l, caster, spellid, power, seenbyplayer, B_FALSE)) { if (isplayer(l)) { msg("Luckily, the evil doesn't seem to harm you."); if (seenbyplayer) *seenbyplayer = B_TRUE; @@ -4915,7 +4922,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ } // now hit the caster! - if (isimmuneto(caster->flags, DT_NECROTIC) || spellresisted(target, caster, spellid, power, seenbyplayer, B_FALSE)) { + if (isimmuneto(caster->flags, DT_NECROTIC) || spellresisted(caster, caster, spellid, power, seenbyplayer, B_FALSE)) { if (isplayer(caster)) { msg("Luckily, the evil doesn't seem to harm you."); if (seenbyplayer) *seenbyplayer = B_TRUE; @@ -5161,7 +5168,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ for (r = firstregion ; r ; r = r->next) { regiontype_t *rt; rt = r->rtype; - addchoice(&prompt, ch++, rt->name, NULL, r); + addchoice(&prompt, ch++, rt->name, NULL, r, NULL); } ch = getchoice(&prompt); @@ -5944,7 +5951,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ char obname[BUFLEN]; real_getobname(o, obname, o->amt, B_TRUE, B_TRUE, B_FALSE, B_FALSE, B_FALSE); if (strcasestr(obname, wantname)) { - addchoice(&prompt, ch++, obname, NULL, o); + addchoice(&prompt, ch++, obname, NULL, o, NULL); } } } @@ -5966,7 +5973,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ strcat(obname, lfname); strcat(obname, ")"); - addchoice(&prompt, ch++, obname, NULL, o); + addchoice(&prompt, ch++, obname, NULL, o, NULL); } } } @@ -6009,7 +6016,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ sk = findskill(skid); if (sk && isloreskill(skid)) { if (!getskill(caster, skid)) { - addchoice(&prompt, ch++, sk->name, NULL, sk); + addchoice(&prompt, ch++, sk->name, NULL, sk, NULL); } } } @@ -7013,8 +7020,8 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ getobname(corpse, corpsename, 1); snprintf(buf, BUFLEN, "What will you ask %s?", corpsename); initprompt(&prompt, buf); - addchoice(&prompt, 'a', "How did you die?", NULL, NULL); - addchoice(&prompt, '-', "(nothing)", NULL, NULL); + addchoice(&prompt, 'a', "How did you die?", NULL, NULL, NULL); + addchoice(&prompt, '-', "(nothing)", NULL, NULL, NULL); ch = getchoice(&prompt); if (ch == 'a') { @@ -8062,12 +8069,12 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ char ch; if (!target) target = caster; initprompt(&prompt, "For what do you wish?"); - addchoice(&prompt, 'a', "Wealth", NULL, NULL); - addchoice(&prompt, 'b', "Power", NULL, NULL); - addchoice(&prompt, 'c', "Protection", NULL, NULL); - addchoice(&prompt, 'd', "Fame", NULL, NULL); - addchoice(&prompt, 'e', "Knowledge", NULL, NULL); - addchoice(&prompt, 'f', "Magic", NULL, NULL); + addchoice(&prompt, 'a', "Wealth", NULL, NULL, NULL); + addchoice(&prompt, 'b', "Power", NULL, NULL, NULL); + addchoice(&prompt, 'c', "Protection", NULL, NULL, NULL); + addchoice(&prompt, 'd', "Fame", NULL, NULL, NULL); + addchoice(&prompt, 'e', "Knowledge", NULL, NULL, NULL); + addchoice(&prompt, 'f', "Magic", NULL, NULL, NULL); if (isplayer(target)) { ch = getchoice(&prompt); } else {