mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Merge pull request #49421 from ShizCalev/define-cleanup
Cleans up redundant math defines
This commit is contained in:
@@ -183,7 +183,7 @@
|
||||
burn_dam += burn
|
||||
|
||||
//We've dealt the physical damages, if there's room lets apply the stamina damage.
|
||||
stamina_dam += round(CLAMP(stamina, 0, max_stamina_damage - stamina_dam), DAMAGE_PRECISION)
|
||||
stamina_dam += round(clamp(stamina, 0, max_stamina_damage - stamina_dam), DAMAGE_PRECISION)
|
||||
|
||||
|
||||
if(owner && updating_health)
|
||||
@@ -288,7 +288,7 @@
|
||||
C = source
|
||||
if(!original_owner)
|
||||
original_owner = source
|
||||
else
|
||||
else
|
||||
C = owner
|
||||
if(original_owner && owner != original_owner) //Foreign limb
|
||||
no_update = TRUE
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
return FALSE
|
||||
|
||||
var/obj/item/bodypart/affecting = C.get_bodypart(BODY_ZONE_CHEST)
|
||||
affecting.receive_damage(CLAMP(brute_dam/2 * affecting.body_damage_coeff, 15, 50), CLAMP(burn_dam/2 * affecting.body_damage_coeff, 0, 50)) //Damage the chest based on limb's existing damage
|
||||
affecting.receive_damage(clamp(brute_dam/2 * affecting.body_damage_coeff, 15, 50), clamp(burn_dam/2 * affecting.body_damage_coeff, 0, 50)) //Damage the chest based on limb's existing damage
|
||||
C.visible_message("<span class='danger'><B>[C]'s [src.name] has been violently dismembered!</B></span>")
|
||||
C.emote("scream")
|
||||
SEND_SIGNAL(C, COMSIG_ADD_MOOD_EVENT, "dismembered", /datum/mood_event/dismembered)
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
return
|
||||
var/range = input(user, "Enter range (0 - [max_light_beam_distance])", "Range Select", 0) as null|num
|
||||
|
||||
set_distance(CLAMP(range, 0, max_light_beam_distance))
|
||||
set_distance(clamp(range, 0, max_light_beam_distance))
|
||||
assume_rgb(C)
|
||||
|
||||
/obj/item/organ/eyes/robotic/glow/proc/assume_rgb(newcolor)
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
if(safe_oxygen_max)
|
||||
if(O2_pp > safe_oxygen_max)
|
||||
var/ratio = (breath_gases[/datum/gas/oxygen][MOLES]/safe_oxygen_max) * 10
|
||||
H.apply_damage_type(CLAMP(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type)
|
||||
H.apply_damage_type(clamp(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type)
|
||||
H.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy)
|
||||
else
|
||||
H.clear_alert("too_much_oxy")
|
||||
@@ -141,7 +141,7 @@
|
||||
if(safe_nitro_max)
|
||||
if(N2_pp > safe_nitro_max)
|
||||
var/ratio = (breath_gases[/datum/gas/nitrogen][MOLES]/safe_nitro_max) * 10
|
||||
H.apply_damage_type(CLAMP(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type)
|
||||
H.apply_damage_type(clamp(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type)
|
||||
H.throw_alert("too_much_nitro", /obj/screen/alert/too_much_nitro)
|
||||
else
|
||||
H.clear_alert("too_much_nitro")
|
||||
@@ -207,7 +207,7 @@
|
||||
if(safe_toxins_max)
|
||||
if(Toxins_pp > safe_toxins_max)
|
||||
var/ratio = (breath_gases[/datum/gas/plasma][MOLES]/safe_toxins_max) * 10
|
||||
H.apply_damage_type(CLAMP(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type)
|
||||
H.apply_damage_type(clamp(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type)
|
||||
H.throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
|
||||
else
|
||||
H.clear_alert("too_much_tox")
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
return
|
||||
if(maximum < damage)
|
||||
return
|
||||
damage = CLAMP(damage + d, 0, maximum)
|
||||
damage = clamp(damage + d, 0, maximum)
|
||||
var/mess = check_damage_thresholds(owner)
|
||||
prev_damage = damage
|
||||
if(mess && owner)
|
||||
|
||||
@@ -124,4 +124,4 @@
|
||||
to_chat(owner, "<span class='notice'>You absorb some of the shock into your body!</span>")
|
||||
|
||||
/obj/item/organ/stomach/ethereal/proc/adjust_charge(amount)
|
||||
crystal_charge = CLAMP(crystal_charge + amount, ETHEREAL_CHARGE_NONE, ETHEREAL_CHARGE_DANGEROUS)
|
||||
crystal_charge = clamp(crystal_charge + amount, ETHEREAL_CHARGE_NONE, ETHEREAL_CHARGE_DANGEROUS)
|
||||
|
||||
Reference in New Issue
Block a user