Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions code/__DEFINES/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,8 @@
#define examining_span_normal(msg) span_infoplain(span_italics(msg))
/// For consistent examine span formatting (small size)
#define examining_span_small(msg) span_slightly_smaller(span_infoplain(span_italics(msg)))

/// Damtype is "physical" like a slap to the face
#define IS_PHYSICAL_DAMAGE(damage_type) (damage_type == BRUTE || damage_type == BURN)
/// Damtype is intended to disable rather than kill
#define IS_DISABLING_DAMAGE(damage_type) (damage_type == STAMINA || damage_type == PAIN)
7 changes: 3 additions & 4 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
if(item_flags & NOBLUDGEON)
return FALSE

if(damtype != STAMINA && force && HAS_TRAIT(user, TRAIT_PACIFISM))
if(IS_DISABLING_DAMAGE(damtype) && force && HAS_TRAIT(user, TRAIT_PACIFISM))
to_chat(user, span_warning("You don't want to harm other living beings!"))
return FALSE

Expand Down Expand Up @@ -375,13 +375,13 @@
return FALSE

/mob/living/silicon/robot/attack_effects(damage_done, hit_zone, armor_block, obj/item/attacking_item, mob/living/attacker)
if(damage_done > 0 && attacking_item.damtype != STAMINA && stat != DEAD)
if(damage_done > 0 && IS_PHYSICAL_DAMAGE(attacking_item.damtype) && stat != DEAD)
spark_system.start()
. = TRUE
return ..() || .

/mob/living/silicon/ai/attack_effects(damage_done, hit_zone, armor_block, obj/item/attacking_item, mob/living/attacker)
if(damage_done > 0 && attacking_item.damtype != STAMINA && stat != DEAD)
if(damage_done > 0 && IS_PHYSICAL_DAMAGE(attacking_item.damtype) && stat != DEAD)
spark_system.start()
. = TRUE
return ..() || .
Expand Down Expand Up @@ -494,4 +494,3 @@
return " in the [input_area]"

return ""

2 changes: 1 addition & 1 deletion code/game/objects/items/flamethrower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
create_with_tank = TRUE

/obj/item/flamethrower/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE)
if(damage && attack_type == PROJECTILE_ATTACK && damage_type != STAMINA && prob(15))
if(damage && attack_type == PROJECTILE_ATTACK && IS_PHYSICAL_DAMAGE(damage_type) && prob(15))
owner.visible_message(span_danger("\The [attack_text] hits the fuel tank on [owner]'s [name], rupturing it! What a shot!"))
var/turf/target_turf = get_turf(owner)
owner.log_message("held a flamethrower tank detonated by a projectile ([hitby])", LOG_GAME)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/grenades/_grenade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
return attack_hand(user, modifiers)

/obj/item/grenade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE)
if(damage && attack_type == PROJECTILE_ATTACK && damage_type != STAMINA && prob(15))
if(damage && attack_type == PROJECTILE_ATTACK && IS_PHYSICAL_DAMAGE(damage_type) && prob(15))
owner.visible_message(span_danger("[attack_text] hits [owner]'s [src], setting it off! What a shot!"))
var/turf/source_turf = get_turf(src)
var/logmsg = "held a grenade detonated by a projectile ([hitby]) at [COORD(source_turf)]"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/capture_the_flag/ctf_player_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
///Stamina and oxygen damage will not dust a player by themself.
/datum/component/ctf_player/proc/damage_type_check(datum/source, damage, damage_type)
SIGNAL_HANDLER
if(damage_type != STAMINA && damage_type != OXY)
if(IS_PHYSICAL_DAMAGE(damage_type))
ctf_dust()

///Dusts the player and starts a respawn countdown.
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/basic/bots/_bots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ GLOBAL_LIST_INIT(command_strings, list(
ejectpai(user)

/mob/living/basic/bot/attack_effects(damage_done, hit_zone, armor_block, obj/item/attacking_item, mob/living/attacker)
if(damage_done > 0 && attacking_item.damtype != STAMINA && stat != DEAD)
if(damage_done > 0 && IS_PHYSICAL_DAMAGE(attacking_item.damtype) && stat != DEAD)
do_sparks(5, TRUE, src)
. = TRUE
return ..() || .
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/bot/bot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
return ..()

/mob/living/simple_animal/bot/attack_effects(damage_done, hit_zone, armor_block, obj/item/attacking_item, mob/living/attacker)
if(damage_done > 0 && attacking_item.damtype != STAMINA && stat != DEAD)
if(damage_done > 0 && IS_PHYSICAL_DAMAGE(attacking_item.damtype) && stat != DEAD)
do_sparks(5, TRUE, src)
. = TRUE
return ..() || .
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/bot/secbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
return
if(attacking_item.tool_behaviour == TOOL_WELDER && !user.combat_mode) // Any intent but harm will heal, so we shouldn't get angry.
return
if(attacking_item.tool_behaviour != TOOL_SCREWDRIVER && (attacking_item.force) && (!target) && (attacking_item.damtype != STAMINA)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
if(attacking_item.tool_behaviour != TOOL_SCREWDRIVER && (attacking_item.force) && (!target) && !IS_DISABLING_DAMAGE(attacking_item.damtype)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
retaliate(user)
special_retaliate_after_attack(user)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@
* This is used in places such as AI responses to determine if they're being threatened or not (among other places)
*/
/obj/projectile/proc/is_hostile_projectile()
if(damage > 0 || stamina > 0)
if(damage > 0 || stamina > 0 || pain > 0)
return TRUE

if(paralyze + stun + immobilize + knockdown > 0 SECONDS)
Expand Down
Loading