![]() |
Crossfire Server, Trunk
1.75.0
|
#include "global.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "living.h"
#include "material.h"
#include "skills.h"
#include "sounds.h"
#include "sproto.h"
Go to the source code of this file.
Functions | |
static int | abort_attack (object *target, object *hitter, int simple_attack) |
Check if target and hitter are still in a relation similar to the one determined by get_attack_mode(). More... | |
static int | adj_attackroll (object *hitter, object *target) |
Adjustments to attack rolls by various conditions. More... | |
static void | attack_message (int dam, int type, object *op, object *hitter) |
Send an attack message to someone. More... | |
int | attack_ob (object *op, object *hitter) |
Simple wrapper for attack_ob_simple(), will use hitter's values. More... | |
static int | attack_ob_simple (object *op, object *hitter, int base_dam, int wc) |
Handles simple attack cases. More... | |
object * | blame (object *op) |
void | blind_living (object *op, object *hitter, int dam) |
Blind a living thing. More... | |
static void | cancellation (object *op) |
Cancels object *op. More... | |
void | confuse_living (object *op, object *hitter, int dam) |
Confuse a living thing. More... | |
static void | deathstrike_living (object *op, object *hitter, int *dam) |
Attempts to kill 'op'. More... | |
static int | did_make_save_item (object *op, int type, object *originator) |
Checks to make sure the item actually made its saving throw based on the tables. More... | |
int | friendly_fire (object *op, object *hitter) |
Find out if this is friendly fire (PVP and attacker is peaceful) or not. More... | |
static void | get_attack_message (int dam, int type, const object *op, const object *hitter, char *buf1, char *buf2) |
Compute attack messages. More... | |
void | get_attack_message_for_attack_type (int dam, uint8_t atm_type, const char *victim_name, char *buf1, char *buf2) |
Get the attack message for a damage and a type. More... | |
static uint8_t | get_attack_message_type (int type, const object *op, const object *hitter) |
Figure the Attack types ATM_xxx type for an attack. More... | |
static int | get_attack_mode (object **target, object **hitter, int *simple_attack) |
Find correct parameters for attack, do some sanity checks. More... | |
int | hit_map (object *op, int dir, uint32_t type, int full_hit) |
Attack a spot on the map. More... | |
int | hit_player (object *op, int dam, object *hitter, uint32_t type, int full_hit) |
Object is attacked by something. More... | |
object * | hit_with_arrow (object *op, object *victim) |
hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile. More... | |
static int | hit_with_drain (object *op, object *hitter, int dam) |
static int | hit_with_one_attacktype (object *op, object *hitter, int dam, uint32_t attacknum) |
Handles one attacktype's damage. More... | |
static int | is_aimed_missile (object *op) |
Determine if the object is an 'aimed' missile. More... | |
static int | kill_object (object *op, int dam, object *hitter) |
An object was killed, handle various things (logging, messages, ...). More... | |
static void | object_get_materialtype (object *op, materialtype_t **mt) |
void | paralyze_living (object *op, int dam) |
Paralyze a living thing. More... | |
static void | poison_living (object *op, object *hitter, int dam) |
Poison a living thing. More... | |
static void | put_in_icecube (object *op, object *originator) |
void | save_throw_object (object *op, uint32_t type, object *originator) |
Object is attacked with some attacktype (fire, ice, ...). More... | |
static void | scare_creature (object *target, object *hitter) |
Creature is scared, update its values. More... | |
static void | slow_living (object *op, object *hitter, int dam) |
Slow a living thing. More... | |
int | slow_living_by (object *op, const int speed_penalty) |
static int | stick_arrow (object *op, object *tmp) |
Try to put an arrow in inventory. More... | |
static void | tear_down_wall (object *op) |
Handles wall tearing animation. More... | |
static void | thrown_item_effect (object *hitter, object *victim) |
Handles any special effects of thrown items (like attacking living creatures–a potion thrown at a monster). More... | |
This handles all attacks, magical or not.
Definition in file attack.cpp.
Check if target and hitter are still in a relation similar to the one determined by get_attack_mode().
target | who is attacked. |
hitter | who is attacking. |
simple_attack | previous mode as returned by get_attack_mode(). |
Definition at line 724 of file attack.cpp.
References object::env, FLAG_REMOVED, object::map, on_same_map(), and QUERY_FLAG.
Referenced by attack_ob_simple(), and hit_player().
Adjustments to attack rolls by various conditions.
hitter | who is hitting. |
target | victim of the attack. |
Definition at line 2566 of file attack.cpp.
References mapstruct::darkness, FLAG_ALIVE, FLAG_BLIND, FLAG_CONFUSED, FLAG_REMOVED, FLAG_SCARED, FLAG_UNAGGRESSIVE, object::invisible, is_aimed_missile(), llevError, LOG(), object::map, monster_can_see_enemy(), monster_stand_in_light(), object::move_type, object_get_owner(), on_same_map(), PLAYER, player_can_view(), QUERY_FLAG, and object::type.
Referenced by attack_ob_simple().
Send an attack message to someone.
dam | amount of damage done. |
type | attack type. |
op | victim of the attack. |
hitter | who is hitting. |
Definition at line 608 of file attack.cpp.
References AT_MAGIC, buf, object::chosen_skill, draw_ext_info, draw_ext_info_format(), FOR_MAP_FINISH, FOR_MAP_PREPARE, get_attack_message(), MAX_BUF, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, MSG_TYPE_ATTACK_PET_HIT, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_HIT, object::name, NDI_BLACK, object_get_owner(), OUT_OF_REAL_MAP, play_sound_map(), PLAYER, rndm(), SOUND_TYPE_HIT, SP_BULLET, SP_CONE, SP_EXPLOSION, SPELL_EFFECT, is_valid_types_gen::type, object::type, and VERY_BIG_BUF.
Referenced by hit_player().
Simple wrapper for attack_ob_simple(), will use hitter's values.
op | victim. |
hitter | attacker. |
Definition at line 937 of file attack.cpp.
References attack_ob_simple(), living::dam, HEAD, object::stats, and living::wc.
Referenced by do_skill_attack(), and pets_move_golem().
Handles simple attack cases.
If rolling 1d20 > WC - AC, deal damage. Otherwise, miss. In other words, if WC is less than or equal to AC, the attack will always hit. Otherwise, for each point of WC above the target's AC, there is a 5% more chance of missing the target up to a maximum of 95% miss.
Some adjustments in adj_attackroll() increase or decrease the attacker's roll.
Deal between 1-base_dam damage. The actual amount of damage may be adjusted by the victim's resistances.
op | victim. Should be the head part. |
hitter | attacked. Should be the head part. |
base_dam | Maximum base damage, before resistances, to deal. |
wc | Attacker's weapon class (see living::wc). |
Definition at line 767 of file attack.cpp.
References abort_attack(), living::ac, adj_attackroll(), object::anim_suffix, apply_anim_suffix(), AT_ACID, AT_PHYSICAL, object::attacktype, Settings::casting_time, object::casting_time, object::chosen_skill, CLEAR_FLAG, object::count, object::current_weapon, living::dam, draw_ext_info, draw_ext_info_format(), EVENT_ATTACKS, events_execute_object_event(), FABS, FLAG_ALIVE, FLAG_HITBACK, FLAG_MONSTER, FLAG_SLEEP, get_attack_mode(), object::hide, hit_player(), living::Int, is_criminal(), make_visible(), monster_can_see_enemy(), monster_npc_call_help(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_FUMBLE, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_HIT, MSG_TYPE_VICTIM_WAS_PUSHED, object::name, NDI_ALL, NDI_UNIQUE, object_get_owner(), object_value_set(), object_was_destroyed, play_sound_map(), PLAYER, player_arrest(), PREFER_HIGH, PREFER_LOW, process_object(), QUERY_FLAG, random_roll(), rndm(), SCRIPT_FIX_ALL, settings, SOUND_TYPE_HIT, object::speed, object::speed_left, object::stats, thrown_item_effect(), TRUE, is_valid_types_gen::type, and object::type.
Referenced by attack_ob(), and hit_with_arrow().
Definition at line 176 of file attack.cpp.
References object_get_owner(), PLAYER, and object::type.
Referenced by save_throw_object().
Blind a living thing.
op | victim. |
hitter | who is attacking. |
dam | damage to deal. |
Definition at line 2358 of file attack.cpp.
References ATNR_BLIND, BLINDNESS, change_abil(), create_archetype(), draw_ext_info_format(), fix_object(), FLAG_APPLIED, FLAG_BLIND, living::food, MAX_BUF, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, NDI_UNIQUE, object_get_owner(), object_insert_in_ob(), object_present_in_ob(), query_name(), object::resist, SET_FLAG, object::speed, and object::stats.
Referenced by hit_with_one_attacktype(), and scroll_failure().
|
static |
Cancels object *op.
Cancellation basically means an object loses its magical benefits.
op | item to cancel. Its inventory will also be cancelled. |
Definition at line 51 of file attack.cpp.
References AT_CANCELLATION, CLEAR_FLAG, CONTAINER, did_make_save_item(), object::env, esrv_update_item(), FABS, FLAG_ALIVE, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, FLAG_KNOWN_MAGICAL, FOR_INV_FINISH, FOR_INV_PREPARE, object::invisible, object::magic, PLAYER, QUERY_FLAG, rndm(), THROWN_OBJ, object::type, UPD_FLAGS, and UPD_NAME.
Referenced by hit_with_one_attacktype(), and save_throw_object().
Confuse a living thing.
op | victim. |
hitter | who is attacking, unused. |
dam | damage to deal, unused. |
Definition at line 2315 of file attack.cpp.
References add_string(), ATNR_CONFUSION, create_archetype(), draw_ext_info, object::duration, FLAG_APPLIED, FLAG_CONFUSED, FORCE, FORCE_CONFUSION, FORCE_NAME, free_string(), MAX, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, object::name, NDI_UNIQUE, object_insert_in_ob(), object_present_in_ob_by_name(), PLAYER, QUERY_FLAG, object::resist, SET_FLAG, object::speed, object::subtype, and object::type.
Referenced by charge_mana_effect(), hit_with_one_attacktype(), prayer_failure(), scroll_failure(), spell_failure(), and write_scroll().
Attempts to kill 'op'.
The intention of a death attack is to kill outright things that are a lot weaker than the attacker, have a chance of killing things somewhat weaker than the caster, and no chance of killing something equal or stronger than the attacker.
If a deathstrike attack has a slaying, only a monster whose name or race matches a comma-delimited list in the slaying field of the deathstriking object is affected (this includes undead). If no slaying set, only undead are unaffected.
op | victim. | |
hitter | attacker. | |
[out] | dam | damage to deal, will contain computed damage or 0 if strike failed. |
Definition at line 2453 of file attack.cpp.
References object::arch, ATNR_DEATH, object::chosen_skill, FLAG_UNDEAD, living::hp, object::level, llevError, LOG(), object::map, mapstruct::name, object::name, archetype::name, PREFER_HIGH, QUERY_FLAG, object::race, random_roll(), object::resist, object::slaying, object::stats, undead_name, object::x, and object::y.
Referenced by hit_with_one_attacktype().
Checks to make sure the item actually made its saving throw based on the tables.
It does not take any further action (like destroying the item).
op | object to check. |
type | attack type. |
originator | what it attacking? |
Definition at line 104 of file attack.cpp.
References AT_BLIND, AT_CONFUSION, AT_COUNTERSPELL, AT_DEATH, AT_DEPLETE, AT_DRAIN, AT_FEAR, AT_GHOSTHIT, AT_HOLYWORD, AT_LIFE_STEALING, AT_MAGIC, AT_PARALYZE, AT_POISON, AT_SLOW, AT_TURN_UNDEAD, attacks, living::dam, FALSE, object::magic, NROFATTACKS, object_get_materialtype(), object::resist, rndm(), materialtype_t::save, object::stats, TRUE, and is_valid_types_gen::type.
Referenced by cancellation(), and save_throw_object().
Find out if this is friendly fire (PVP and attacker is peaceful) or not.
op | victim. |
hitter | attacker. |
Definition at line 1858 of file attack.cpp.
References object::contr, DISEASE, HEAD, object_get_owner(), player::peaceful, PLAYER, POISONING, RUNE, SPELL, and object::type.
Referenced by hit_player().
|
static |
Compute attack messages.
Two versions are done, one for the living doing the action, the other for the victim of the attack.
dam | amount of damage done. | |
type | attack type. | |
op | victim of the attack. | |
hitter | who is hitting. | |
[out] | buf1 | where to write the message for the one doing the attack, must be at least MAX_BUF long. |
[out] | buf2 | where to write the message for the victim of the attack, must be at least MAX_BUF long. |
Definition at line 569 of file attack.cpp.
References DOOR, get_attack_message_for_attack_type(), get_attack_message_type(), MAX_BUF, object::name, is_valid_types_gen::type, and object::type.
Referenced by attack_message().
void get_attack_message_for_attack_type | ( | int | dam, |
uint8_t | atm_type, | ||
const char * | victim_name, | ||
char * | buf1, | ||
char * | buf2 | ||
) |
Get the attack message for a damage and a type.
dam | damage done. | |
atm_type | one Attack types of type ATM_xxx. | |
victim_name | name of the victim of the attack. | |
[out] | buf1 | where to write the message for the one doing the attack, must be at least MAX_BUF long. |
[out] | buf2 | where to write the message for the victim of the attack, must be at least MAX_BUF long. |
Definition at line 538 of file attack.cpp.
References attack_mess, attackmess_t::level, level, MAX_BUF, and MAXATTACKMESS.
Referenced by get_attack_message().
|
static |
Figure the Attack types ATM_xxx type for an attack.
type | base attack type. |
op | victim of the attack. |
hitter | who is hitting. |
Definition at line 463 of file attack.cpp.
References AT_COLD, AT_DRAIN, AT_ELECTRICITY, AT_FIRE, AT_MAGIC, AT_PHYSICAL, AT_POISON, ATM_ARROW, ATM_BASIC, ATM_BLUD, ATM_CLAW, ATM_CLEAVE, ATM_COLD, ATM_CRUSH, ATM_DOOR, ATM_DRAIN, ATM_ELEC, ATM_FIRE, ATM_KARATE, ATM_PIERCE, ATM_PUNCH, ATM_SLASH, ATM_SLICE, ATM_STAB, ATM_SUFFER, ATM_WHIP, ATM_WRAITH_FEED, object::current_weapon, DISEASE, DOOR, IS_ARROW, IS_LIVE, PLAYER, POISONING, SK_CLAWING, SK_KARATE, SK_PUNCHING, SK_WRAITH_FEED, SYMPTOM, is_valid_types_gen::type, object::type, USING_SKILL, WEAP_BLUD, WEAP_CLEAVE, WEAP_CRUSH, WEAP_HIT, WEAP_PIERCE, WEAP_SLASH, WEAP_SLICE, WEAP_STAB, WEAP_WHIP, and object::weapontype.
Referenced by get_attack_message().
Find correct parameters for attack, do some sanity checks.
target | will point to victim's head. |
hitter | will point to hitter's head. |
simple_attack | will be 1 if one of victim or target isn't on a map, 0 else. |
Definition at line 688 of file attack.cpp.
References FLAG_FREED, FLAG_REMOVED, HEAD, llevError, LOG(), on_same_map(), and QUERY_FLAG.
Referenced by attack_ob_simple(), and hit_player().
int hit_map | ( | object * | op, |
int | dir, | ||
uint32_t | type, | ||
int | full_hit | ||
) |
Attack a spot on the map.
op | object hitting the map. |
dir | direction op is hitting/going. |
type | attacktype. |
full_hit | if set then monster area does not matter, it gets all damage. Else damage is proportional to affected area vs full monster area. |
Definition at line 355 of file attack.cpp.
References object::arch, AT_CHAOS, AT_COUNTERSPELL, AT_MAGIC, object::count, counterspell(), living::dam, object::env, FLAG_ALIVE, FLAG_FREED, FLAG_REMOVED, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, hit_player(), llevError, LOG(), object::map, object::name, archetype::name, object_update(), object_was_destroyed, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, save_throw_object(), shuffle_attack(), object::stats, TRANSPORT, is_valid_types_gen::type, UP_OBJ_FACE, object::x, and object::y.
Referenced by explode_bullet(), explosion(), move_aura(), move_ball_spell(), move_bolt(), move_cone(), and rune_attack().
Object is attacked by something.
This isn't used just for players, but in fact most objects.
Oct 95 - altered the following slightly for MULTIPLE_GODS hack which needs new attacktype AT_HOLYWORD to work . b.t.
op | object to be hit |
dam | base damage - protections/vulnerabilities/slaying matches can modify it. |
hitter | what is hitting the object |
type | attacktype |
full_hit | set if monster area does not matter. |
Definition at line 1907 of file attack.cpp.
References abort_attack(), object::arch, AT_CHAOS, AT_DEATH, AT_HOLYWORD, AT_MAGIC, AT_PARALYZE, AT_PHYSICAL, AT_SLOW, ATNR_MAGIC, attack_message(), ATTACKS, change_object(), CLEAR_FLAG, object::count, object::current_weapon, determine_god(), did_make_save(), DOOR, object::enemy, EVENT_ATTACKED, events_execute_object_event(), find_god(), FLAG_ALIVE, FLAG_FREED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_NO_DAMAGE, FLAG_ONE_HIT, FLAG_REMOVED, FLAG_RUN_AWAY, FLAG_SPLITTING, FLAG_TEAR_DOWN, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, FLAG_WIZ, FOR_INV_FINISH, FOR_INV_PREPARE, friendly_fire(), get_attack_mode(), object::head, hit_with_one_attacktype(), living::hp, kill_object(), object::level, llevDebug, LOG(), living::maxhp, monster_npc_call_help(), archetype::more, object::name, archetype::name, NROFATTACKS, object_find_by_type2(), object_free_drop_inventory(), object_get_owner(), object_remove(), object_set_enemy(), object_was_destroyed, op_on_battleground(), PLAYER, QUERY_FLAG, object::race, RANDOM, remove_friendly_object(), object::resist, rndm(), object::run_away, RUNE, scare_creature(), SCRIPT_FIX_ALL, SET_FLAG, Settings::set_friendly_fire, settings, object::slaying, spring_trap(), object::stats, tear_down_wall(), object::title, TRAP, is_valid_types_gen::type, object::type, and undead_name.
Referenced by attack_ob_simple(), cast_destruction(), cast_earth_to_dust(), cast_light(), check_bullet(), check_heal_and_mana(), enter_exit(), gate_type_process(), hit_map(), legacy_ob_process(), monster_check_doors(), monster_check_earthwalls(), move_symptom(), poison_type_apply(), poisoning_type_process(), rune_attack(), spell_effect_type_move_on(), and spell_failure().
hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile.
op | missile hitting. |
victim | who is hit by op. |
Definition at line 979 of file attack.cpp.
References add_refcount(), attack_ob_simple(), object::count, living::dam, object::env, EVENT_ATTACKS, EVENT_CONNECTOR, events_execute_object_event(), fix_stopped_arrow(), FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, free_no_drop(), free_string(), INS_NO_MERGE, INS_NO_WALK_ON, object::inv, object::map, object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_merge(), object_remove(), object_set_owner(), object_was_destroyed, SCRIPT_FIX_ALL, object::skill, object::speed, object::stats, stick_arrow(), object::type, living::wc, object::x, and object::y.
Referenced by common_process_projectile(), and common_projectile_move_on().
Definition at line 1174 of file attack.cpp.
References object::arch, ATNR_DRAIN, ATNR_PHYSICAL, change_exp(), object::chosen_skill, archetype::clone, living::exp, FLAG_WAS_WIZ, GOLEM, hit_with_one_attacktype(), living::hp, object::level, living::maxhp, MIN, object_get_owner(), op_on_battleground(), PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), object::resist, SK_EXP_ADD_SKILL, SK_EXP_TOTAL, object::skill, object::stats, and object::type.
Referenced by hit_with_one_attacktype().
|
static |
Handles one attacktype's damage.
This doesn't damage the creature, but returns how much it should take. However, it will do other effects (paralyzation, slow, etc.).
op | victim of the attack. |
hitter | attacker. |
dam | maximum dealt damage. |
attacknum | number of the attacktype of the attack. See the ATNR_xxx values. |
Definition at line 1272 of file attack.cpp.
References AMULET, ATNR_ACID, ATNR_BLIND, ATNR_CANCELLATION, ATNR_CHAOS, ATNR_CONFUSION, ATNR_COUNTERSPELL, ATNR_DEATH, ATNR_DEPLETE, ATNR_DRAIN, ATNR_FEAR, ATNR_HOLYWORD, ATNR_INTERNAL, ATNR_LIFE_STEALING, ATNR_PARALYZE, ATNR_PHYSICAL, ATNR_POISON, ATNR_SLOW, ATNR_TURN_UNDEAD, blind_living(), cancellation(), check_physically_infect(), confuse_living(), deathstrike_living(), determine_god(), did_make_save(), DOOR, drain_stat(), draw_ext_info_format(), esrv_update_item(), find_god(), fix_object(), FLAG_ALIVE, FLAG_APPLIED, FLAG_GENERATOR, FLAG_MONSTER, FLAG_UNDEAD, living::food, FOR_INV_FINISH, FOR_INV_PREPARE, get_turn_bonus(), GIRDLE, GOLEM, hit_with_drain(), living::hp, is_wraith_pl(), object::level, llevError, LOG(), M_IRON, MAX, MAX_BUF, MAX_FOOD, living::maxhp, MIN, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_HIT, NDI_RED, NDI_UNIQUE, NROFATTACKS, object_get_owner(), op_on_battleground(), paralyze_living(), PLAYER, poison_living(), PREFER_HIGH, PREFER_LOW, QUERY_FLAG, query_name(), object::race, random_roll(), object::resist, RING, rndm(), ROD, scare_creature(), object::slaying, slow_living(), object::speed, object::stats, object::type, undead_name, UPD_NAME, WAND, and living::Wis.
Referenced by hit_player(), and hit_with_drain().
|
static |
Determine if the object is an 'aimed' missile.
op | object to check. |
Definition at line 2633 of file attack.cpp.
References ARROW, MOVE_FLYING, object::move_type, SP_BULLET, SP_EXPLOSION, SPELL_EFFECT, object::subtype, THROWN_OBJ, and object::type.
Referenced by adj_attackroll().
An object was killed, handle various things (logging, messages, ...).
GROS: This code comes from hit_player. It has been made external to allow script procedures to "kill" objects in a combat-like fashion. It was initially used by (kill-object) developed for the Collector's Sword. Note that nothing has been changed from the original version of the following code.
Will LOG pk, handles battleground, and so on.
This function was a bit of a mess with hitter getting changed, values being stored away but not used, etc. I've cleaned it up a bit - I think it should be functionally equivalant. MSW 2002-07-17
op | what is being killed. |
dam | damage done to it. |
hitter | what is hitting it. |
Definition at line 1586 of file attack.cpp.
References BIG_NAME, buf, calc_skill_exp(), change_luck(), check_exp_loss(), object::chosen_skill, object::contr, object::current_weapon, DOOR, draw_ext_info, draw_ext_info_format(), EVENT_DEATH, EVENT_GKILL, events_execute_global_event(), events_execute_object_event(), living::exp, find_applied_skill_by_name(), FLAG_BLOCKSVIEW, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_READY_WEAPON, FLAG_WAS_WIZ, FLAG_WIZ, player::golem_count, socket_struct::host, living::hp, kill_player(), player::killer, object::level, llevError, llevInfo, LOG(), object::map, MAX_BUF, MIN, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_KILL, MSG_TYPE_ATTACK_PET_DIED, name, object::name, NDI_ALL, NDI_BLACK, NDI_UNIQUE, object_free_drop_inventory(), object_get_owner(), object_handle_death_animation(), object_remove(), object_update_speed(), op_on_battleground(), player::party, player::peaceful, Settings::pk_luck_penalty, Settings::pk_max_experience, Settings::pk_max_experience_percent, play_sound_map(), PLAYER, QUERY_FLAG, query_name(), range_golem, player::ranges, remove_friendly_object(), SCRIPT_FIX_ALL, settings, share_exp(), Settings::simple_exp, SK_EXP_TOTAL, SKILL, object::skill, skill, player::socket, SOUND_TYPE_HIT, object::speed, object::speed_left, object::stats, t, time, player::title, object::type, update_all_los(), VERY_BIG_BUF, object::x, and object::y.
Referenced by hit_player().
|
static |
Definition at line 75 of file attack.cpp.
References object::material, object::materialname, materials, name_to_material(), and set_materialname().
Referenced by did_make_save_item().
void paralyze_living | ( | object * | op, |
int | dam | ||
) |
Paralyze a living thing.
op | victim. |
dam | damage to deal. |
Definition at line 2402 of file attack.cpp.
References ATNR_PARALYZE, draw_ext_info, FABS, FLAG_PARALYZED, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, NDI_UNIQUE, PLAYER, QUERY_FLAG, object::resist, SET_FLAG, object::speed, object::speed_left, and object::type.
Referenced by hit_with_one_attacktype(), prayer_failure(), scroll_failure(), and spell_failure().
Poison a living thing.
op | victim. |
hitter | who is attacking. |
dam | damage to deal. |
Definition at line 2158 of file attack.cpp.
References add_refcount(), arch_present_in_ob(), arch_to_object(), object::chosen_skill, living::Con, living::dam, living::Dex, draw_ext_info, draw_ext_info_format(), find_archetype(), fix_object(), FLAG_ALIVE, FLAG_APPLIED, living::food, free_string(), living::Int, object::level, llevError, LOG(), MAX, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, MSG_TYPE_ATTACK_PET_HIT, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, object::name, NDI_UNIQUE, object_copy_owner(), object_get_owner(), object_insert_in_ob(), PLAYER, QUERY_FLAG, SET_FLAG, object::skill, skill, object::speed_left, object::stats, living::Str, and object::type.
Referenced by hit_with_one_attacktype().
Definition at line 151 of file attack.cpp.
References arch_to_object(), find_archetype(), FLAG_REMOVED, object::map, map_find_by_archetype(), object::move_slow, object::move_slow_penalty, object_insert_in_map_at(), object_insert_in_ob(), object_remove(), QUERY_FLAG, stop_item(), object::x, and object::y.
Referenced by save_throw_object().
Object is attacked with some attacktype (fire, ice, ...).
Calls did_make_save_item(). It then performs the appropriate actions to the item (such as burning the item up, calling cancellation(), etc.)
op | victim of the attack. |
type | attacktype. |
originator | what is attacking. |
Definition at line 202 of file attack.cpp.
References AT_CANCELLATION, AT_COLD, AT_ELECTRICITY, AT_FIRE, ATNR_COLD, ATNR_FIRE, blame(), cancellation(), commit_crime(), create_archetype(), did_make_save_item(), draw_ext_info_format(), object::env, env, fix_stopped_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_LIGHTABLE, FLAG_NO_PICK, FLAG_REMOVED, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, object::inv, kill_player(), llevError, LOG(), m, object::map, MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, name, object::name, archetype::name, NDI_RED, NDI_UNIQUE, object::nrof, object_decrease_nrof(), object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_replace_insert_in_map(), object::other_arch, put_in_icecube(), QUERY_FLAG, query_name(), RANDOM, object::resist, rndm(), RUNE, SET_FLAG, spring_trap(), stop_item(), TRANSPORT, is_valid_types_gen::type, object::type, weight, object::weight, object::x, and object::y.
Referenced by do_light(), hit_map(), and spell_effect_type_move_on().
Creature is scared, update its values.
target | scared creature. |
hitter | who scared target. |
Definition at line 1163 of file attack.cpp.
References object::enemy, FLAG_SCARED, object_get_owner(), object_set_enemy(), and SET_FLAG.
Referenced by hit_player(), and hit_with_one_attacktype().
Slow a living thing.
op | victim. |
hitter | who is attacking. |
dam | damage to deal. |
Give slow attacks some oomph – always speed -1 was REALLY weak
Neila Hawkins 2018-05-31
Definition at line 2270 of file attack.cpp.
References ATNR_SLOW, draw_ext_info, object::level, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, NDI_UNIQUE, PREFER_LOW, random_roll(), object::resist, and slow_living_by().
Referenced by hit_with_one_attacktype().
int slow_living_by | ( | object * | op, |
const int | speed_penalty | ||
) |
Definition at line 2231 of file attack.cpp.
References arch_present_in_ob(), arch_to_object(), living::exp, find_archetype(), fix_object(), FLAG_APPLIED, living::food, object_insert_in_ob(), SET_FLAG, object::speed_left, and object::stats.
Referenced by eat_common(), and slow_living().
Try to put an arrow in inventory.
op | arrow to try to insert. |
tmp | what is stopping the arrow. |
Definition at line 952 of file attack.cpp.
References HEAD, living::hp, object_insert_in_ob(), object_remove(), object::stats, and object::weight.
Referenced by hit_with_arrow().
|
static |
Handles wall tearing animation.
Will change the face according to the hp/maxhp ration.
If the wall reaches its last animation, either free it or set it non living so it doesn't block anymore.
op | wall to update. |
Definition at line 1114 of file attack.cpp.
References blank_face, CLEAR_FLAG, object::face, FLAG_ALIVE, FLAG_BLOCKSVIEW, GET_ANIM_ID, living::hp, if(), llevError, LOG(), object::map, living::maxhp, object::move_block, object::name, NUM_ANIMATIONS, object_free_drop_inventory(), object_remove(), object_update(), SET_ANIMATION, object::stats, UP_OBJ_FACE, update_all_los(), object::x, and object::y.
Referenced by hit_player().
Handles any special effects of thrown items (like attacking living creatures–a potion thrown at a monster).
hitter | thrown item. |
victim | object that is hit by hitter. |
Definition at line 2526 of file attack.cpp.
References ATNR_MAGIC, ATNR_POISON, FLAG_ALIVE, FLAG_UNDEAD, ob_apply(), POISON, POTION, QUERY_FLAG, object::resist, and object::type.
Referenced by attack_ob_simple().