Crossfire Server, Branches 1.12
R18729
|
Go to the source code of this file.
Macros | |
#define | MAX_EXPLORE 5000 |
#define | MAX_KNOWN_SPELLS 20 |
#define | MIN_MON_RADIUS 3 /* minimum monster detection radius */ |
Functions | |
int | can_detect_enemy (object *op, object *enemy, rv_vector *rv) |
static int | can_hit (object *ob1, object *ob2, rv_vector *rv) |
int | can_see_enemy (object *op, object *enemy) |
void | check_doors (object *op, mapstruct *m, int x, int y) |
void | check_earthwalls (object *op, mapstruct *m, int x, int y) |
object * | check_enemy (object *npc, rv_vector *rv) |
static int | check_good_armour (object *who, object *item) |
static int | check_good_weapon (object *who, object *item) |
static int | check_wakeup (object *op, object *enemy, rv_vector *rv) |
static void | circ1_move (object *ob) |
static void | circ2_move (object *ob) |
void | communicate (object *op, const char *txt) |
int | compute_path (object *source, object *target, int default_dir) |
static int | dist_att (int dir, object *ob, object *enemy, object *part, rv_vector *rv) |
static int | disthit_att (int dir, object *ob, object *enemy, object *part, rv_vector *rv) |
static int | do_talk_npc (object *op, object *npc, const char *txt, int *talked) |
static object * | find_enemy (object *npc, rv_vector *rv) |
object * | find_mon_throw_ob (object *op) |
object * | find_nearest_living_creature (object *npc) |
static int | hitrun_att (int dir, object *ob, object *enemy) |
static void | monster_apply_below (object *monster) |
static int | monster_can_pick (object *monster, object *item) |
static int | monster_cast_spell (object *head, object *part, object *pl, int dir, rv_vector *rv) |
void | monster_check_apply (object *mon, object *item) |
static void | monster_check_pickup (object *monster) |
static object * | monster_choose_random_spell (object *monster) |
static void | monster_do_living (object *op) |
static int | monster_move_no_enemy (object *op) |
static int | monster_should_cast_spell (object *monster, object *spell_ob) |
static int | monster_use_bow (object *head, object *part, object *pl, int dir) |
static int | monster_use_range (object *head, object *part, object *pl, int dir) |
static int | monster_use_scroll (object *head, object *part, object *pl, int dir, rv_vector *rv) |
static int | monster_use_skill (object *head, object *part, object *pl, int dir) |
int | move_monster (object *op) |
static int | move_randomly (object *op) |
void | npc_call_help (object *op) |
void | npc_say (object *npc, const char *cp) |
static void | pace2_moveh (object *ob) |
static void | pace2_movev (object *ob) |
static void | pace_moveh (object *ob) |
static void | pace_movev (object *ob) |
static void | rand_move (object *ob) |
static int | run_att (int dir, object *ob, object *enemy, object *part, rv_vector *rv) |
int | stand_in_light (object *op) |
static int | talk_to_npc (object *op, object *npc, const char *txt, int *talked) |
static int | wait_att (int dir, object *ob, object *enemy, object *part, rv_vector *rv) |
static int | wait_att2 (int dir, object *ob, object *enemy, object *part, rv_vector *rv) |
This deals with monster moving, attacking, using items and such. The core function is move_monster().
Definition in file monster.c.
#define MAX_EXPLORE 5000 |
Definition at line 355 of file monster.c.
Referenced by compute_path().
#define MAX_KNOWN_SPELLS 20 |
Maximum number of spells to consider when choosing a spell for a monster.
Definition at line 900 of file monster.c.
Referenced by monster_choose_random_spell().
#define MIN_MON_RADIUS 3 /* minimum monster detection radius */ |
Definition at line 67 of file monster.c.
Referenced by can_detect_enemy(), and check_wakeup().
Definition at line 2020 of file monster.c.
References can_see_enemy(), obj::contr, find_skill_by_number(), FLAG_WIZ, get_rangevector(), pl::hidden, obj::hide, liv::Int, obj::invisible, obj::level, llevError, LOG(), make_visible(), obj::map, MAX, MIN_MON_RADIUS, on_same_map(), PLAYER, QUERY_FLAG, SK_HIDING, obj::stats, pl::tmp_invis, obj::type, and liv::Wis.
Referenced by attempt_steal(), check_enemy(), get_nearest_player(), and get_pet_enemy().
Checks if monster can hit in hand-to-hand combat. Multitile aware.
ob1 | monster trying to hit. |
ob2 | target to hit. |
rv | vector from ob1 to ob2. |
Definition at line 835 of file monster.c.
References rv_vector::distance_x, rv_vector::distance_y, FLAG_CONFUSED, get_rangevector(), obj::more, and QUERY_FLAG.
Referenced by dist_att(), move_monster(), run_att(), and wait_att().
Definition at line 2199 of file monster.c.
References mapdef::darkness, draw_ext_info(), FLAG_ALIVE, FLAG_BLIND, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_XRAYS, has_carried_lights(), obj::head, obj::hide, obj::invisible, is_true_undead(), make_visible(), makes_invisible_to(), obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, PLAYER, player_can_view(), QUERY_FLAG, stand_in_light(), and obj::type.
Referenced by adj_attackroll(), attack_ob_simple(), can_detect_enemy(), and get_pet_enemy().
Definition at line 1802 of file monster.c.
References obj::above, AT_PHYSICAL, DOOR, GET_MAP_OB, hit_player(), and obj::type.
Referenced by move_ob().
Definition at line 1791 of file monster.c.
References obj::above, AT_PHYSICAL, liv::dam, EARTHWALL, GET_MAP_OB, hit_player(), obj::stats, and obj::type.
Referenced by move_ob().
Checks npc->enemy and returns that enemy if still valid, NULL otherwise. This is map tile aware. If this returns an enemy, the range vector rv should also be set to sane values.
npc | monster we're considering | |
[out] | rv | will contain vector to go to enemy if function returns not NULL. |
Definition at line 83 of file monster.c.
References obj::attack_movement, can_detect_enemy(), obj::enemy, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NEUTRAL, FLAG_REMOVED, GOLEM, HI4, on_same_map(), obj::owner, PETMOVE, PLAYER, QUERY_FLAG, should_arena_attack(), and obj::type.
Referenced by find_enemy(), and get_pet_enemy().
Checks if using armor 'item' would be better for 'who'. This is a very simplistic check - also checking things like speed and ac are also relevant.
who | creature considering to apply item. |
item | item to check. |
Definition at line 1336 of file monster.c.
References liv::ac, ATNR_PHYSICAL, obj::below, FLAG_APPLIED, obj::inv, obj::magic, NROFATTACKS, QUERY_FLAG, obj::resist, obj::stats, and obj::type.
Referenced by monster_check_apply().
Checks if using weapon 'item' would be better for 'who'. This is a very simplistic check - also checking things like speed and ac are also relevant.
who | creature considering to apply item. |
item | item to check. |
Definition at line 1293 of file monster.c.
References obj::below, liv::dam, FLAG_APPLIED, get_attr_value(), obj::inv, obj::magic, NUM_STATS, QUERY_FLAG, obj::stats, and obj::type.
Referenced by monster_check_apply().
Sees if this monster should wake up. Currently, this is only called from move_monster, and if enemy is set, then so should be rv.
op | monster to check. | |
enemy | enemy that can cause to wake up. | |
[out] | rv | vector pointing to enemy. |
Definition at line 298 of file monster.c.
References CLEAR_FLAG, mapdef::darkness, rv_vector::distance, FLAG_BLIND, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_SLEEP, FLAG_STEALTH, obj::invisible, obj::map, MAX, MIN_MON_RADIUS, QUERY_FLAG, stand_in_light(), obj::stats, and liv::Wis.
Referenced by move_monster().
|
static |
Definition at line 1718 of file monster.c.
References move_object(), and obj::move_status.
Referenced by monster_move_no_enemy().
|
static |
Definition at line 1727 of file monster.c.
References move_object(), and obj::move_status.
Referenced by monster_move_no_enemy().
void communicate | ( | object * | op, |
const char * | txt | ||
) |
This function looks for an object or creature that is listening to said text.
There is a rare event that the orig_map is used for - basically, if a player says the magic word that gets him teleported off the map, it can result in the new map putting the object count too high, which forces the swap out of some other map. In some cases, the map the player was just on now gets swapped out - thus, the object on that map are no longer in memory. So check to see if the players map changes, and if so, don't process any further. If it does change, most likely we don't care about the results of further conversation. Also, depending on the value of i, the conversation would continue on the new map, which probably isn't what is really wanted either.
op | who is saying something. |
txt | what is said. |
Definition at line 1831 of file monster.c.
References obj::above, ext_info_map(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, llevDebug, LOG(), obj::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_SAY, obj::name, NDI_WHITE, P_OUT_OF_MAP, PLAYER, SIZEOFFREE2, snprintf(), talk_to_npc(), obj::type, obj::x, and obj::y.
Referenced by command_say().
Computes a path from source to target. Takes into account walls, other living things, and such. Only works if both items are on same map.
source | what wants to move. |
target | target to go to. |
default_dir | general direction from source to target. |
Definition at line 371 of file monster.c.
References absdir(), fatal(), freearr_x, freearr_y, mapdef::height, obj::map, MAX_EXPLORE, ob_blocked(), OUT_OF_MEMORY, OUT_OF_REAL_MAP, mapdef::width, obj::x, and obj::y.
Referenced by move_monster(), and move_to().
Definition at line 1654 of file monster.c.
References absdir(), can_hit(), and rv_vector::distance.
Referenced by disthit_att(), and move_monster().
|
static |
Definition at line 1699 of file monster.c.
References absdir(), dist_att(), liv::hp, liv::maxhp, obj::run_away, and obj::stats.
Referenced by move_monster().
Checks the messages of a NPC for a matching text. Will not call plugin events. Called by talk_to_npc().
op | who is saying something |
npc | object that gets a chance to reply. |
txt | text being said. |
talked | did op already talk? Will be modified if this function makes op talk. |
Definition at line 1883 of file monster.c.
References draw_ext_info(), draw_ext_info_format(), ext_info_map(), get_dialog_message(), MAGIC_EAR, obj::map, MAX_BUF, struct_dialog_reply::message, struct_dialog_message::message, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_SAY, MSG_TYPE_DIALOG, MSG_TYPE_DIALOG_MAGIC_MOUTH, obj::name, NDI_NAVY, NDI_UNIQUE, NDI_WHITE, struct_dialog_reply::next, npc_say(), struct_dialog_message::replies, struct_dialog_reply::reply, rt_reply, snprintf(), struct_dialog_reply::type, obj::type, and use_trigger().
Referenced by talk_to_npc().
Tries to find an enmy for npc. We pass the range vector since our caller will find the information useful. Currently, only move_monster calls this function. Fix function so that we always make calls to get_rangevector if we have a valid target - function as not doing so in many cases.
npc | monster we're considering. | |
[out] | rv | vector that will contain how to reach the target. Must not be NULL. |
Definition at line 216 of file monster.c.
References obj::attack_movement, obj::attacked_by, obj::attacked_by_count, check_enemy(), CLEAR_FLAG, obj::count, obj::enemy, find_nearest_living_creature(), FLAG_BERSERK, FLAG_FRIENDLY, FLAG_NEUTRAL, FLAG_SLEEP, FLAG_UNAGGRESSIVE, get_nearest_player(), get_pet_enemy(), get_rangevector(), HI4, on_same_map(), PETMOVE, PLAYER, QUERY_FLAG, and obj::type.
Referenced by move_monster().
Definition at line 1978 of file monster.c.
References obj::below, obj::count, FLAG_APPLIED, FLAG_IS_THROWN, obj::head, obj::inv, obj::invisible, llevDebug, LOG(), MAX_BUF, obj::name, QUERY_FLAG, and query_name().
Referenced by skill_throw().
Returns the nearest living creature (monster or generator). Modified to deal with tiled maps properly. Also fixed logic so that monsters in the lower directions were more likely to be skipped - instead of just skipping the 'start' number of direction, revisit them after looking at all the other spaces.
Note that being this may skip some number of spaces, it will not necessarily find the nearest living creature - it basically chooses one from within a 3 space radius, and since it skips the first few directions, it could very well choose something 3 spaces away even though something directly north is closer.
This function is map tile aware.
npc | monster to consider |
Definition at line 162 of file monster.c.
References obj::above, can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_search_arr(), llevDebug, LOG(), obj::map, P_IS_ALIVE, P_OUT_OF_MAP, mapdef::path, PLAYER, QUERY_FLAG, SIZEOFFREE, obj::type, obj::x, and obj::y.
Referenced by find_enemy(), and get_pet_enemy().
Definition at line 1673 of file monster.c.
References absdir(), and obj::move_status.
Referenced by move_monster().
|
static |
Definition at line 1500 of file monster.c.
References obj::below, CF_HANDLE, FLAG_IS_FLOOR, manual_apply(), QUERY_FLAG, TREASURE, TRIGGER, obj::type, obj::will_apply, WILL_APPLY_HANDLE, and WILL_APPLY_TREASURE.
Referenced by move_monster().
Definition at line 1420 of file monster.c.
References obj::arch, ARROW, obj::body_info, BOW, can_pick(), archt::clone, FLAG_CAN_USE_SKILL, FLAG_CAST_SPELL, FLAG_UNPAID, FLAG_USE_ARMOUR, FLAG_USE_BOW, FLAG_USE_RANGE, FLAG_USE_RING, FLAG_USE_SCROLL, FLAG_USE_SHIELD, FLAG_USE_WEAPON, FOOD, GEM, HORN, IS_ARMOR, IS_SHIELD, IS_WEAPON, MONEY, NUM_BODY_LOCATIONS, obj::pick_up, QUERY_FLAG, RING, ROD, SCROLL, SKILL, SPELLBOOK, obj::type, and WAND.
Referenced by monster_check_pickup().
|
static |
Tries to make a (part of a) monster cast a spell.
Handles sp/gr limits, and confusion.
head | head of the monster. |
part | part of the monster that we use to cast. |
pl | target. |
dir | direction to cast. |
rv | vector describing where the enemy is. |
Definition at line 957 of file monster.c.
References absdir(), cast_spell(), CLEAR_FLAG, liv::dam, dirdiff(), rv_vector::direction, FLAG_CAST_SPELL, FLAG_CONFUSED, FLAG_FRIENDLY, get_owner(), get_rangevector(), liv::grace, obj::inv, llevError, llevMonster, LOG(), monster_choose_random_spell(), obj::name, path_to_player(), QUERY_FLAG, obj::range, liv::sp, SP_level_spellpoint_cost(), SPELL_GRACE, SPELL_MANA, SPELLBOOK, obj::spellitem, obj::stats, and obj::type.
Referenced by move_monster().
Definition at line 1534 of file monster.c.
References AP_APPLY, AP_IGNORE_CURSE, obj::arch, ARROW, obj::below, BOW, CAN_APPLY_NOT_MASK, can_apply_object(), check_good_armour(), check_good_weapon(), archt::clone, obj::count, FLAG_APPLIED, FLAG_CAST_SPELL, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SCROLL, FLAG_READY_SKILL, FLAG_USE_BOW, FLAG_USE_SCROLL, FOOD, HORN, obj::inv, IS_ARMOR, IS_SHIELD, llevDebug, llevMonster, LOG(), manual_apply(), monster_should_cast_spell(), QUERY_FLAG, obj::race, RING, ROD, SCROLL, SET_FLAG, SKILL, SPELLBOOK, TREASURE, obj::type, WAND, WEAPON, obj::will_apply, WILL_APPLY_FOOD, and WILL_APPLY_TREASURE.
Referenced by monster_check_pickup().
|
static |
Checks for items that monster can pick up.
Vick's (vick(at)bern.docs.uu.se) fix 921030 for the sweeper blob. Each time the blob passes over some treasure, it will grab it a.s.a.p.
Eneq((at)csd.uu.se): This can now be defined in the archetypes, added code to handle this.
This function was seen be continueing looping at one point (tmp->below became a recursive loop. It may be better to call monster_check_apply after we pick everything up, since that function may call others which affect stacking on this space.
monster | monster that can pick up items. |
Definition at line 1393 of file monster.c.
References obj::below, obj::count, insert_ob_in_ob(), monster_can_pick(), monster_check_apply(), remove_ob(), and was_destroyed.
Referenced by move_monster().
Selects a spell to cast for a monster.
Returns a randomly selected spell. This logic is still less than ideal. This code also only seems to deal with wizard spells, as the check is against sp, and not grace. can monsters know cleric spells?
monster | monster trying to cast a spell. |
Definition at line 917 of file monster.c.
References obj::below, obj::inv, MAX_KNOWN_SPELLS, monster_should_cast_spell(), SPELL, SPELLBOOK, and obj::type.
Referenced by monster_cast_spell().
|
static |
For a monster, regenerate hp and sp, potentially clear scared status.
op | monster. Must have FLAG_MONSTER set. |
Definition at line 436 of file monster.c.
References CLEAR_FLAG, liv::Con, FABS, FLAG_MONSTER, FLAG_RUN_AWAY, FLAG_SCARED, liv::hp, obj::last_heal, obj::last_sp, liv::maxhp, liv::maxsp, MIN, liv::Pow, QUERY_FLAG, obj::run_away, liv::sp, obj::speed, and obj::stats.
Referenced by move_monster().
|
static |
Makes a monster without any enemy move.
op | monster, must have FLAG_MONSTER set. |
Definition at line 495 of file monster.c.
References obj::attack_movement, circ1_move(), circ2_move(), CIRCLE1, CIRCLE2, FLAG_MONSTER, FLAG_ONLY_ATTACK, FLAG_RANDOM_MOVE, FLAG_STAND_STILL, free_object(), HI4, move_randomly(), pace2_moveh(), pace2_movev(), pace_moveh(), pace_movev(), PACEH, PACEH2, PACEV, PACEV2, pet_move(), PETMOVE, QUERY_FLAG, rand_move(), RANDO, RANDO2, and remove_ob().
Referenced by move_monster().
Checks if a monster should cast a spell.
Note that this function does not check to see if the monster can in fact cast the spell (sp dependencies and what not.) That is because this function is also sued to see if the monster should use spell items (rod/horn/wand/scroll).
Note that there are certainly other offensive spells that could be included, but I decided to leave out the spells that may kill more monsters than players (eg, disease).
This could be a lot smarter - if there are few monsters around, then disease might not be as bad. Likewise, if the monster is damaged, the right type of healing spell could be useful.
monster | monster trying to cast a spell. |
spell_ob | spell considered. |
Definition at line 880 of file monster.c.
References SP_BOLT, SP_BOMB, SP_BULLET, SP_CONE, SP_EXPLOSION, SP_INVISIBLE, SP_MAGIC_MISSILE, SP_MAGIC_WALL, SP_MOVING_BALL, SP_SMITE, SP_SUMMON_GOLEM, SP_SUMMON_MONSTER, SP_SWARM, and obj::subtype.
Referenced by monster_check_apply(), monster_choose_random_spell(), and monster_use_scroll().
Tries to make a (part of a) monster fire a bow.
Handles confusion effect.
head | head of the monster. |
part | part of the monster that we use to cast. |
pl | target. |
dir | direction to cast. |
Definition at line 1233 of file monster.c.
References absdir(), rv_vector::distance, rv_vector::distance_x, rv_vector::distance_y, find_dir_2(), fire_bow(), FLAG_CONFUSED, FLAG_FRIENDLY, freearr_x, freearr_y, get_map_from_coord(), GET_MAP_MOVE_BLOCK, get_owner(), get_rangevector(), llevError, LOG(), obj::map, MOVE_FLY_LOW, QUERY_FLAG, obj::x, and obj::y.
Referenced by move_monster().
Monster will use a ranged attack (HORN, WAND, ...).
head | head of the monster. |
part | part of the monster that can do a range attack. |
pl | target. |
dir | direction to fire. |
Definition at line 1164 of file monster.c.
References absdir(), obj::below, cast_spell(), CLEAR_FLAG, obj::count, dirdiff(), drain_rod_charge(), drain_wand_charge(), find_dir_2(), FLAG_CONFUSED, FLAG_FRIENDLY, FLAG_READY_RANGE, liv::food, get_owner(), liv::grace, HORN, liv::hp, obj::inv, llevError, LOG(), MAX, obj::name, path_to_player(), QUERY_FLAG, ROD, liv::sp, obj::stats, obj::type, WAND, obj::x, and obj::y.
Referenced by move_monster().
|
static |
Tries to make a (part of a) monster apply a spell.
head | head of the monster. |
part | part of the monster that we use to cast. |
pl | target. |
dir | direction to cast. |
rv | vector describing where the enemy is. |
Definition at line 1040 of file monster.c.
References absdir(), animate_object(), obj::animation_id, obj::below, CLEAR_FLAG, dirdiff(), obj::direction, rv_vector::direction, obj::facing, FLAG_CONFUSED, FLAG_FRIENDLY, FLAG_READY_SCROLL, get_owner(), get_rangevector(), obj::inv, monster_should_cast_spell(), ob_apply(), path_to_player(), QUERY_FLAG, obj::range, SCROLL, and obj::type.
Referenced by move_monster().
monster_use_skill()-implemented 95-04-28 to allow monster skill use. Note that monsters do not need the skills SK_MELEE_WEAPON and SK_MISSILE_WEAPON to make those respective attacks, if we required that we would drastically increase the memory requirements of CF!!
The skills we are treating here are all but those. -b.t.
At the moment this is only useful for throwing, perhaps for stealing. TODO: This should be more integrated in the game. -MT, 25.11.01
Will switch between at most 2 skills.
head | head of the monster. |
part | part of the monster that may use a skill. |
pl | target. |
dir | direction to cast. |
Definition at line 1115 of file monster.c.
References absdir(), obj::below, obj::chosen_skill, CLEAR_FLAG, obj::count, dirdiff(), do_skill(), find_dir_2(), FLAG_CONFUSED, FLAG_FRIENDLY, FLAG_READY_SKILL, get_owner(), obj::inv, llevDebug, LOG(), obj::name, path_to_player(), QUERY_FLAG, SKILL, obj::type, obj::x, and obj::y.
Referenced by move_monster().
int move_monster | ( | object * | op | ) |
Main monster processing routine.
Will regenerate spell points, hit points. Moves the monster, handle attack, item applying, pickup, ...
op | monster to process. |
Definition at line 566 of file monster.c.
References absdir(), add_refcount(), ALLRUN, animate_object(), obj::animation_id, obj::attack_movement, obj::attacked_by, obj::attacked_by_count, can_hit(), check_wakeup(), compute_path(), obj::count, mapdef::darkness, obj::direction, rv_vector::direction, dist_att(), DISTATT, DISTHIT, disthit_att(), do_hidden_move(), obj::enemy, FABS, obj::face, obj::facing, find_enemy(), FLAG_BLIND, FLAG_CAST_SPELL, FLAG_CONFUSED, FLAG_FREED, FLAG_FRIENDLY, FLAG_NO_ATTACK, FLAG_ONLY_ATTACK, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SCROLL, FLAG_READY_SKILL, FLAG_REMOVED, FLAG_RUN_AWAY, FLAG_SCARED, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_SLEEP, FLAG_STAND_STILL, follow_owner(), free_object(), free_string(), get_nearest_player(), get_owner(), get_rangevector(), obj::head, HI4, obj::hide, HITRUN, hitrun_att(), llevDebug, LO4, LOG(), obj::map, MIN_ACTIVE_SPEED, monster_apply_below(), monster_cast_spell(), monster_check_pickup(), monster_do_living(), monster_move_no_enemy(), monster_use_bow(), monster_use_range(), monster_use_scroll(), monster_use_skill(), obj::more, move_object(), move_randomly(), obj::name, on_same_map(), rv_vector::part, PETMOVE, obj::pick_up, QUERY_FLAG, obj::race, remove_friendly_object(), remove_ob(), run_att(), RUNATT, RUSH, skill_attack(), obj::speed, obj::stats, WAIT2, wait_att(), wait_att2(), WAITATT, liv::wc, and obj::will_apply.
Referenced by process_object().
|
static |
Makes an object move in a random direction.
op | object to move. |
Definition at line 344 of file monster.c.
References move_object().
Referenced by monster_move_no_enemy(), and move_monster().
void npc_call_help | ( | object * | op | ) |
Definition at line 1632 of file monster.c.
References obj::above, obj::enemy, FLAG_ALIVE, FLAG_UNAGGRESSIVE, get_map_flags(), GET_MAP_OB, obj::map, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, obj::x, and obj::y.
Referenced by alchemy_failure_effect(), attack_ob_simple(), attempt_steal(), and hit_player().
void npc_say | ( | object * | npc, |
const char * | cp | ||
) |
Simple function to have some NPC say something.
npc | who should say something. |
cp | what is being said. |
Definition at line 1933 of file monster.c.
References ext_info_map(), HUGE_BUF, obj::map, MAX_BUF, MSG_TYPE_DIALOG, MSG_TYPE_DIALOG_NPC, NDI_NAVY, NDI_UNIQUE, query_name(), and snprintf().
Referenced by cfapi_object_say(), and do_talk_npc().
|
static |
Definition at line 1767 of file monster.c.
References move_object(), and obj::move_status.
Referenced by monster_move_no_enemy().
|
static |
Definition at line 1754 of file monster.c.
References move_object(), and obj::move_status.
Referenced by monster_move_no_enemy().
|
static |
Definition at line 1745 of file monster.c.
References move_object(), and obj::move_status.
Referenced by monster_move_no_enemy().
|
static |
Definition at line 1736 of file monster.c.
References move_object(), and obj::move_status.
Referenced by monster_move_no_enemy().
|
static |
Definition at line 1780 of file monster.c.
References move_object(), and obj::move_status.
Referenced by monster_move_no_enemy().
Definition at line 1664 of file monster.c.
References absdir(), can_hit(), and obj::move_status.
Referenced by move_monster().
int stand_in_light | ( | object * | op | ) |
Definition at line 2159 of file monster.c.
References get_map_flags(), GET_MAP_LIGHT, obj::glow_radius, isqrt(), obj::map, MAX_LIGHT_RADII, P_OUT_OF_MAP, obj::x, and obj::y.
Referenced by adj_attackroll(), can_see_enemy(), and check_wakeup().
Give an object the chance to handle something being said. Plugin hooks will be called, including in the NPC's inventory.
op | who is talking. |
npc | object to try to talk to. Can be an NPC or a MAGIC_EAR. |
txt | what op is saying. |
talked | did op already talk? Can be modified by this function. |
Definition at line 1952 of file monster.c.
References obj::below, do_talk_npc(), EVENT_SAY, execute_event(), obj::inv, and SCRIPT_FIX_ALL.
Referenced by communicate().
Definition at line 1683 of file monster.c.
References absdir(), can_hit(), and obj::move_status.
Referenced by move_monster().
Definition at line 1712 of file monster.c.
References absdir(), and rv_vector::distance.
Referenced by move_monster().