#include "hack.h"
Defines | |
#define | POTION_OCCUPANT_CHANCE(n) (13 + 2*(n)) |
#define | ALCHEMY_WHITE 0 |
#define | ALCHEMY_BLACK 8 |
#define | ALCHEMY_GRAY (alchemy_table2[16]) |
#define | IS_PRIMARY_COLOR(x) (((x)&7)==1 || ((x)&7)==2 || ((x)&7)==4) |
#define | IS_SECONDARY_COLOR(x) (((x)&7)==3 || ((x)&7)==5 || ((x)&7)==6) |
#define | IS_LIGHT_COLOR(x) (((x)&8)==0) |
#define | IS_DARK_COLOR(x) ((x)&8) |
Functions | |
STATIC_DCL long | FDECL (itimeout,(long)) |
STATIC_DCL long | FDECL (itimeout_incr,(long, int)) |
STATIC_DCL void | NDECL (ghost_from_bottle) |
STATIC_OVL void | NDECL (alchemy_init) |
STATIC_DCL short | FDECL (mixtype,(struct obj *, struct obj *)) |
STATIC_DCL int | FDECL (dip,(struct obj *, struct obj *)) |
STATIC_OVL long | itimeout (long val) |
STATIC_OVL long | itimeout_incr (long old, int incr) |
void | set_itimeout (long *which, long val) |
void | incr_itimeout (long *which, int incr) |
void | make_confused (long xtime, boolean talk) |
void | make_stunned (long xtime, boolean talk) |
void | make_sick (long xtime, const char *cause, boolean talk, int type) |
void | make_vomiting (long xtime, boolean talk) |
void | make_blinded (long xtime, boolean talk) |
boolean | make_hallucinated (long xtime, boolean talk, long mask) |
STATIC_OVL void | ghost_from_bottle () |
int | dodrink () |
int | dopotion (struct obj *otmp) |
int | peffects (struct obj *otmp) |
void | healup (int nhp, int nxtra, boolean curesick, boolean cureblind) |
void | strange_feeling (struct obj *obj, const char *txt) |
const char * | bottlename () |
void | potionhit (struct monst *mon, struct obj *obj, boolean your_fault) |
void | potionbreathe (struct obj *obj) |
STATIC_OVL void | alchemy_init () |
STATIC_OVL short | mixtype (struct obj *o1, struct obj *o2) |
boolean | get_wet (struct obj *obj) |
int | dodip () |
int | dip (struct obj *potion, struct obj *obj) |
void | djinni_from_bottle (struct obj *obj) |
struct monst * | split_mon (struct monst *mon, struct monst *mtmp) |
Variables | |
boolean | notonhead = FALSE |
static NEARDATA int | nothing |
static NEARDATA int | unkn |
static NEARDATA const char | beverages [] = { POTION_CLASS, 0 } |
static const char | vismsg [] = "vision seems to %s for a moment but is %s now." |
static const char | eyemsg [] = "%s momentarily %s." |
const char * | bottlenames [] |
char | alchemy_table1 [POT_VAMPIRE_BLOOD-POT_GAIN_ABILITY] |
short | alchemy_table2 [17] |
#define ALCHEMY_BLACK 8 |
Referenced by mixtype().
#define ALCHEMY_GRAY (alchemy_table2[16]) |
Referenced by mixtype().
#define ALCHEMY_WHITE 0 |
Referenced by mixtype().
#define IS_DARK_COLOR | ( | x ) | ((x)&8) |
Referenced by mixtype().
#define IS_LIGHT_COLOR | ( | x ) | (((x)&8)==0) |
Referenced by mixtype().
#define IS_PRIMARY_COLOR | ( | x ) | (((x)&7)==1 || ((x)&7)==2 || ((x)&7)==4) |
Referenced by mixtype().
#define IS_SECONDARY_COLOR | ( | x ) | (((x)&7)==3 || ((x)&7)==5 || ((x)&7)==6) |
Referenced by mixtype().
#define POTION_OCCUPANT_CHANCE | ( | n ) | (13 + 2*(n)) |
STATIC_OVL void alchemy_init | ( | ) |
const char* bottlename | ( | ) |
Referenced by chest_shatter_msg(), and potionhit().
Dip an arbitrary object into a potion.
References A_STR, A_WIS, Acid_resistance, AMETHYST, AMULET_OF_UNCHANGING, aobjnam(), bill_dummy_object(), bless(), Blind, body_part(), breathless, BUFSZ, catch_lit(), check_unpaid(), CORPSE, costly_spot(), curse(), cxname(), d(), monst::data, docall(), doname(), exercise(), EXPL_FIERY, explode(), FALSE, FINGER, FOOD_CLASS, get_wet(), Glib, Hallucination, haseyes, hcolor(), hold_another_object(), incr_itimeout(), index, is_ammo, is_corrodeable, is_flammable(), is_poisonable, is_rustprone, is_weptool, KILLED_BY_AN, losehp(), MAGIC_LAMP, makeknown, makeplural(), MAX_ERODE, mixtype(), mkobj(), more_than_one, NH_AMBER, NH_BLACK, NH_LIGHT_BLUE, NH_ORANGE, NH_RED, nothing_happens, obfree(), OBJ_DESCR, obj_extract_self(), OBJ_NAME, obj_resists(), objects, objclass::oc_uname, OIL_LAMP, otense(), otmp, obj::otyp, PAPER, PLASTIC, pline(), PM_LICHEN, poly_obj(), u_conduct::polypiles, POT_ACID, POT_EXTRA_HEALING, POT_FULL_HEALING, POT_HEALING, POT_INVISIBILITY, POT_OIL, POT_POLYMORPH, POT_SEE_INVISIBLE, POT_SICKNESS, POT_WATER, POTION_CLASS, potionbreathe(), prinv(), rn2(), rnd(), See_invisible, setuqwep(), setuswapwep(), setuwep(), Shk_Your(), SPE_POLYMORPH, splitobj(), Sprintf, STRANGE_OBJECT, Strcpy, The(), the(), TRUE, u, uball, you::uconduct, unbless(), uncurse(), UNICORN_HORN, update_inventory, uquiver, useup(), uskin, uswapwep, uwep, you::ux, you::uy, vowels, WAN_POLYMORPH, WEAPON_CLASS, xname(), yname(), Yname2(), youmonst, and zeroobj.
Referenced by dodip().
void djinni_from_bottle | ( | struct obj * | obj ) |
References a_monnam(), Blind, FALSE, makemon(), makewish(), mongone(), Monnam(), mons, NO_MM_FLAGS, pline(), PM_DJINNI, rn2(), rnd(), set_malign(), Something, tamedog(), TRUE, u, you::ux, and you::uy.
Referenced by dodrink(), and dorub().
int dodip | ( | ) |
User command for dipping objects.
References ALL_CLASSES, beverages, dip(), dipfountain(), floating_above(), get_wet(), getobj(), IS_FOUNTAIN, is_pool(), is_swimmer, Levitation, levl, obj::otyp, P_BASIC, P_SKILL, pline(), POT_ACID, QBUFSZ, obj::quan, safe_qbuf(), simple_typename(), Sprintf, the(), u, useup(), you::ux, you::uy, waterbody_name(), xname(), and yn.
int dodrink | ( | ) |
References beverages, flag::djinni_count, djinni_from_bottle(), dopotion(), drinkfountain(), flags, getobj(), flag::ghost_count, ghost_from_bottle(), IS_FOUNTAIN, IS_SINK, Levitation, levl, MAXMONNO, OBJ_DESCR, objects, otmp, obj::otyp, pline(), PM_ARCHEOLOGIST, POTION_OCCUPANT_CHANCE, rn2(), Role_if, Strangled, TRUE, u, Underwater, useup(), you::ux, you::uy, and yn.
int dopotion | ( | struct obj * | otmp ) |
References docall(), Hallucination, makeknown, more_experienced(), nothing, objects, objclass::oc_uname, peffects(), TRUE, unkn, and useup().
Referenced by dodrink(), and eatspecial().
STATIC_DCL long FDECL | ( | itimeout | , |
(long) | |||
) |
STATIC_DCL long FDECL | ( | itimeout_incr | , |
(long, int) | |||
) |
References Acid_resistance, aobjnam(), bill_dummy_object(), Blind, BUFSZ, costly_spot(), FALSE, grease_protect(), is_rustprone, KILLED_BY, losehp(), MAIL, makeknown, MAX_ERODE, otense(), pline(), POT_ACID, POT_WATER, POTION_CLASS, rn2(), rnd(), SCR_BLANK_PAPER, SCR_MAIL, SCROLL_CLASS, Shk_Your(), snuff_lit(), SPBOOK_CLASS, SPE_BLANK_PAPER, SPE_BOOK_OF_THE_DEAD, The(), TRUE, u, update_inventory, you::ux, you::uy, WEAPON_CLASS, xname(), and youmonst.
Referenced by dip(), dipfountain(), and dodip().
STATIC_OVL void ghost_from_bottle | ( | ) |
References Blind, flags, Hallucination, makemon(), mons, NO_MM_FLAGS, nomovemsg, nomul(), pline(), PM_GHOST, rndmonnam(), something, u, you::ux, you::uy, and flag::verbose.
Referenced by dodrink().
References flag::botl, flags, make_blinded(), make_sick(), you::mh, you::mhmax, SICK_ALL, TRUE, u, you::uhp, you::uhpmax, and Upolyd.
Referenced by artifact_hit(), peffects(), spelleffects(), and zapyourself().
void incr_itimeout | ( | long * | which, |
int | incr | ||
) |
References itimeout_incr(), and set_itimeout().
Referenced by Boots_on(), dip(), eataccessory(), eatcorpse(), Gloves_on(), opentin(), peffects(), potionbreathe(), priest_talk(), use_grease(), and zapyourself().
STATIC_OVL long itimeout | ( | long | val ) |
References TIMEOUT.
Referenced by itimeout_incr(), and set_itimeout().
STATIC_OVL long itimeout_incr | ( | long | old, |
int | incr | ||
) |
References itimeout(), and TIMEOUT.
Referenced by incr_itimeout(), peffects(), and potionbreathe().
void make_blinded | ( | long | xtime, |
boolean | talk | ||
) |
References Blind, Blind_telepat, Blinded, Blindfolded, body_part(), flag::botl, BUFSZ, monst::data, EYE, eyecount, FALSE, flags, Hallucination, haseyes, Infravision, makeplural(), pline(), Punished, see_monsters(), set_bc(), set_itimeout(), strange_feeling(), Strcpy, u, you::usleep, vision_full_recalc, and youmonst.
Referenced by arti_invoke(), buzz(), cast_cleric_spell(), cursed_book(), domagictrap(), dosit(), engrave(), explmu(), fix_attributes_and_properties(), fix_worst_trouble(), fpostfx(), gazemu(), gulpmu(), healup(), hitmu(), inside_gas_cloud(), m_throw(), nh_timeout(), peffects(), pleased(), polyman(), polymon(), potionbreathe(), rottenfood(), tele(), toss_up(), use_cream_pie(), use_crystal_ball(), use_towel(), wipeoff(), and zapyourself().
void make_confused | ( | long | xtime, |
boolean | talk | ||
) |
References flag::botl, flags, Hallucination, HConfusion, set_itimeout(), and TRUE.
Referenced by cast_cleric_spell(), cpostfx(), cursed_book(), dosit(), fix_attributes_and_properties(), fix_worst_trouble(), gazemu(), hitmu(), Mb_hit(), nh_timeout(), peffects(), potionbreathe(), rottenfood(), seffects(), spell_backfire(), use_crystal_ball(), use_mirror(), and vomiting_dialogue().
References Blind, body_part(), flag::botl, BUFSZ, monst::data, EHalluc_resistance, EYE, eyecount, flags, haseyes, HHallucination, makeplural(), pline(), see_monsters(), see_objects(), see_traps(), set_itimeout(), strange_feeling(), Strcpy, swallowed(), TRUE, u, update_inventory, and youmonst.
Referenced by bagotricks(), chest_trap(), cpostfx(), explmu(), fix_attributes_and_properties(), fix_worst_trouble(), nh_timeout(), peffects(), set_artifact_intrinsic(), and use_crystal_ball().
void make_sick | ( | long | xtime, |
const char * | cause, | ||
boolean | talk, | ||
int | type | ||
) |
References A_CON, flag::botl, exercise(), FALSE, flags, pline(), set_itimeout(), Sick, Sick_resistance, TRUE, u, and you::usick_cause.
Referenced by arti_invoke(), diseasemu(), dosit(), eatcorpse(), fix_attributes_and_properties(), fix_worst_trouble(), fpostfx(), healup(), hitmu(), newman(), peffects(), polymon(), and vomit().
void make_stunned | ( | long | xtime, |
boolean | talk | ||
) |
References flag::botl, monst::data, flags, Hallucination, HStun, set_itimeout(), stagger(), TRUE, u, and youmonst.
Referenced by b_trapped(), cast_wizard_spell(), chest_trap(), cpostfx(), doeat(), fix_attributes_and_properties(), fix_worst_trouble(), gazemu(), hitmu(), Mb_hit(), nh_timeout(), passive(), seffects(), spell_backfire(), vomiting_dialogue(), and zapyourself().
void make_vomiting | ( | long | xtime, |
boolean | talk | ||
) |
References set_itimeout(), and Vomiting.
Referenced by fix_attributes_and_properties(), fpostfx(), fprefx(), nh_timeout(), opentin(), and peffects().
Returns the potion type when object o1 is dipped into object o2
References ALCHEMY_BLACK, ALCHEMY_GRAY, alchemy_init(), ALCHEMY_WHITE, AMETHYST, IS_DARK_COLOR, IS_LIGHT_COLOR, IS_PRIMARY_COLOR, IS_SECONDARY_COLOR, OBJ_NAME, objects, POT_BLINDNESS, POT_BLOOD, POT_BOOZE, POT_CONFUSION, POT_FRUIT_JUICE, POT_GAIN_ABILITY, POT_HALLUCINATION, POT_SICKNESS, POT_VAMPIRE_BLOOD, POT_WATER, POTION_CLASS, rn2(), and UNICORN_HORN.
Referenced by dip().
STATIC_OVL void NDECL | ( | alchemy_init | ) |
STATIC_DCL void NDECL | ( | ghost_from_bottle | ) |
int peffects | ( | struct obj * | otmp ) |
References A_CHAOTIC, A_CON, A_DEX, A_INT, A_LAWFUL, A_MAX, A_NEUTRAL, A_STR, A_WIS, ABASE, Acid_resistance, adjalign(), adjattrib(), aggravate(), AMAX, bcsign(), BInvis, Blind, Blinded, body_part(), flag::botl, Can_rise_up(), ceiling(), COLNO, Confusion, d(), monst::data, depth(), Detect_monsters, display_nhwindow, doup(), earth_level, enlightenment(), exercise(), FACE, fall_asleep(), FALSE, Fast, Fire_resistance, fix_petrification(), Fixed_abil, flags, float_up(), FOOT, Free_action, FROMOUTSIDE, fruitname(), get_level(), GLYPH_INVISIBLE, goto_level(), Halluc_resistance, Hallucination, HConfusion, HDetect_monsters, HEAD, heal_legs(), healup(), HFast, HHallucination, HInvis, HLevitation, HSee_invisible, I_SPECIAL, incr_itimeout(), Invis, Invisible, Is_airlevel, is_demon, is_undead, is_vampire, Is_waterlevel, itimeout_incr(), KILLED_BY, KILLED_BY_AN, ledger_no(), LEG, lesshungry(), Levitation, levl, likes_fire, losehp(), LOW_PM, make_blinded(), make_confused(), make_hallucinated(), make_sick(), make_vomiting(), makeplural(), maybe_polyd, you::mh, you::mhmax, permonst::mname, MON_AT, mons, monster_detect(), you::mtimedone, multi, MUMMY_WRAPPING, newhp(), newsym(), newuhs(), nomovemsg, nomul(), NON_PM, nothing, object_detect(), on_level(), obj::otyp, pline(), pluslvl(), PM_HEALER, PM_MONK, PM_VAMPIRE, PM_VAMPIRE_BAT, PM_VAMPIRE_LORD, Poison_resistance, poisontell(), polymon(), polyself(), POT_ACID, POT_BLINDNESS, POT_BLOOD, POT_BOOZE, POT_CONFUSION, POT_ENLIGHTENMENT, POT_EXTRA_HEALING, POT_FRUIT_JUICE, POT_FULL_HEALING, POT_GAIN_ABILITY, POT_GAIN_ENERGY, POT_GAIN_LEVEL, POT_HALLUCINATION, POT_HEALING, POT_INVISIBILITY, POT_LEVITATION, POT_MONSTER_DETECTION, POT_OBJECT_DETECTION, POT_OIL, POT_PARALYSIS, POT_POLYMORPH, POT_RESTORE_ABILITY, POT_SEE_INVISIBLE, POT_SICKNESS, POT_SLEEPING, POT_SPEED, POT_VAMPIRE_BLOOD, POT_WATER, Race_if, rn1, rn2(), rnd(), rndexp(), Role_if, ROWNO, see_monsters(), self_invis_message(), set_mimic_blocking(), SICK_ALL, Sleep_resistance, SPE_DETECT_MONSTERS, SPE_DETECT_TREASURE, SPE_HASTE_SELF, SPE_INVISIBILITY, SPE_LEVITATION, SPE_RESTORE_ABILITY, spoteffects(), sstairs, STEED, Stoned, surface(), stairway::sx, stairway::sy, TRUE, align::type, u, you::ualign, uarmc, uarmh, you::uconduct, you::uen, you::uenmax, you::uexp, you::ugangr, you::uhave, you::uhp, you::uhpmax, you::uhs, you::uhunger, you::ulevel, you::ulevelmax, you::ulycn, Unchanging, unfixable_trouble_count(), unkn, unmap_object(), u_conduct::unvegan, u_conduct::unvegetarian, stairway::up, Upolyd, you::ux, you::uy, you::uz, Very_fast, violated_vegetarian(), Vomiting, WIN_MESSAGE, Wounded_legs, xname(), xupladder, xupstair, You_can_move_again, you_unwere(), you_were(), youmonst, yupladder, and yupstair.
Referenced by dopotion(), and spelleffects().
void potionbreathe | ( | struct obj * | obj ) |
References A_CON, A_DEX, A_MAX, A_WIS, ABASE, AMAX, Blind, Blinded, body_part(), flag::botl, breathless, Confusion, monst::data, docall(), exercise(), EYE, eyecount, FALSE, Fast, flags, Free_action, haseyes, HConfusion, HFast, incr_itimeout(), Invis, is_vampire, itimeout_incr(), LOW_PM, make_blinded(), make_confused(), makeknown, makeplural(), maybe_polyd, you::mh, you::mhmax, mons, nomovemsg, nomul(), objects, objclass::oc_uname, pline(), PM_GREMLIN, PM_HEALER, PM_VAMPIRE, POT_ACID, POT_BLINDNESS, POT_BLOOD, POT_BOOZE, POT_CONFUSION, POT_EXTRA_HEALING, POT_FULL_HEALING, POT_GAIN_ABILITY, POT_HALLUCINATION, POT_HEALING, POT_INVISIBILITY, POT_PARALYSIS, POT_POLYMORPH, POT_RESTORE_ABILITY, POT_SICKNESS, POT_SLEEPING, POT_SPEED, POT_VAMPIRE_BLOOD, POT_WATER, Race_if, rn2(), rnd(), Role_if, See_invisible, Sleep_resistance, Something, split_mon(), TRUE, u, you::uhp, you::uhpmax, you::ulycn, you::umonnum, Upolyd, you::usleep, vision_clears, You_can_move_again, you_unwere(), you_were(), and youmonst.
Referenced by breakobj(), chest_shatter_msg(), destroy_item(), dip(), and potionhit().
References Acid_resistance, AD_ACID, AD_DISE, AD_PEST, Antimagic, bhitm(), body_part(), bottlename(), breathless, BUFSZ, cansee, canseemon, d(), monst::data, distu, dmgtype(), docall(), FALSE, Hallucination, has_head, haseyes, HEAD, in_rooms(), is_demon, is_human, is_silent, is_undead, is_were, killed(), KILLED_BY_AN, losehp(), min, mon_adjust_speed(), mon_nam(), mon_set_minvis(), monkilled(), Monnam(), mons, new_were(), NOTELL, notonhead, obfree(), objects, objclass::oc_uname, oresist_disintegration, pline(), PM_GREMLIN, PM_IRON_GOLEM, PM_PESTILENCE, polyself(), POT_ACID, POT_BLINDNESS, POT_BOOZE, POT_CONFUSION, POT_EXTRA_HEALING, POT_FULL_HEALING, POT_GAIN_ABILITY, POT_HEALING, POT_INVISIBILITY, POT_OIL, POT_PARALYSIS, POT_POLYMORPH, POT_RESTORE_ABILITY, POT_SICKNESS, POT_SLEEPING, POT_SPEED, POT_WATER, POTION_CLASS, potionbreathe(), Protection_from_shape_changers, resist(), resists_acid, resists_poison, rn2(), rnd(), s_suffix(), shop_keeper(), SHOPBASE, sleep_monst(), slept_monst(), splatter_burning_oil(), split_mon(), Sprintf, stolen_value(), Strcpy, subfrombill(), Tobjnam(), TRUE, u, Unchanging, you::ushops, you::ux, you::uy, wakeup(), WEBB_DISINT, and youmonst.
Referenced by hmon_hitmon(), m_throw(), ohitmon(), thitmonst(), and toss_up().
void set_itimeout | ( | long * | which, |
long | val | ||
) |
References itimeout(), and TIMEOUT.
Referenced by cpostfx(), incr_itimeout(), make_blinded(), make_confused(), make_hallucinated(), make_sick(), make_stunned(), and make_vomiting().
References flag::botl, BUFSZ, canspotmon, clone_mon(), cloneu(), flags, you::mhmax, monst::mhpmax, mon_nam(), Monnam(), pline(), s_suffix(), Sprintf, u, and youmonst.
Referenced by domonability(), dotrap(), drown(), minliquid(), mintrap(), passive(), passivemm(), passiveum(), potionbreathe(), and potionhit().
void strange_feeling | ( | struct obj * | obj, |
const char * | txt | ||
) |
References flag::beginner, docall(), flags, Hallucination, objects, objclass::oc_uname, pline(), and useup().
Referenced by chwepon(), food_detect(), gold_detect(), make_blinded(), make_hallucinated(), monster_detect(), object_detect(), seffects(), and trap_detect().
char alchemy_table1[POT_VAMPIRE_BLOOD-POT_GAIN_ABILITY] |
short alchemy_table2[17] |
NEARDATA const char beverages[] = { POTION_CLASS, 0 } [static] |
const char* bottlenames[] |
{ "bottle", "phial", "flagon", "carafe", "flask", "jar", "vial" }
const char eyemsg[] = "%s momentarily %s." [static] |
NEARDATA int nothing [static] |
Referenced by dopotion(), makewish(), and peffects().
Referenced by artifact_hit(), bhit(), dog_move(), fightm(), kick_object(), m_move(), mdamagem(), potionhit(), and probe_monster().
NEARDATA int unkn |
Referenced by dopotion(), and peffects().
const char vismsg[] = "vision seems to %s for a moment but is %s now." [static] |