Skip to content

Commit

Permalink
renames receive_damage() for animations to receiving_damage()
Browse files Browse the repository at this point in the history
renames take_damage() for organs to receive_damage()
renames Deconstruct() to deconstruct() for atmos objects
obj_integrity, max_integrity, integrity_failure vars moved to /obj level, obj_integrity = max_integrity on New()
  • Loading branch information
CryoSpacewalk committed Dec 27, 2017
1 parent 73d7af2 commit 75e177b
Show file tree
Hide file tree
Showing 47 changed files with 108 additions and 108 deletions.
6 changes: 3 additions & 3 deletions code/ATMOSPHERICS/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Pipelines + Other Objects -> Pipe network
//You unwrenched a pipe full of pressure? let's splat you into the wall silly.
if(unsafe_wrenching)
unsafe_pressure_release(user,internal_pressure)
Deconstruct()
deconstruct()
else
return ..()

Expand All @@ -208,7 +208,7 @@ Pipelines + Other Objects -> Pipe network
//Values based on 2*ONE_ATMOS (the unsafe pressure), resulting in 20 range and 4 speed
user.throw_at(general_direction,pressures/10,pressures/50)

/obj/machinery/atmospherics/proc/Deconstruct()
/obj/machinery/atmospherics/deconstruct()
if(can_unwrench)
stored.loc = get_turf(src)
transfer_fingerprints_to(stored)
Expand Down Expand Up @@ -321,7 +321,7 @@ Pipelines + Other Objects -> Pipe network

/obj/machinery/atmospherics/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
Deconstruct()
deconstruct()

/obj/machinery/atmospherics/update_remote_sight(mob/user)
user.sight |= (SEE_TURFS|BLIND)
2 changes: 1 addition & 1 deletion code/ATMOSPHERICS/pipes/manifold.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
// A check to make sure both nodes exist - self-delete if they aren't present
/obj/machinery/atmospherics/pipe/manifold/check_nodes_exist()
if(!node1 && !node2 && !node3)
Deconstruct()
deconstruct()
return 0 // 0: No nodes exist
// 1: 1-3 nodes exist, we continue existing
return 1
Expand Down
2 changes: 1 addition & 1 deletion code/ATMOSPHERICS/pipes/manifold4w.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
// A check to make sure both nodes exist - self-delete if they aren't present
/obj/machinery/atmospherics/pipe/manifold4w/check_nodes_exist()
if(!node1 && !node2 && !node3 && !node4)
Deconstruct()
deconstruct()
return 0 // 0: No nodes exist
// 1: 1-4 nodes exist, we continue existing
return 1
Expand Down
2 changes: 1 addition & 1 deletion code/ATMOSPHERICS/pipes/simple/pipe_simple.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
// A check to make sure both nodes exist - self-delete if they aren't present
/obj/machinery/atmospherics/pipe/simple/check_nodes_exist()
if(!node1 && !node2)
Deconstruct()
deconstruct()
return 0 // 0: No nodes exist
// 1: 1-2 nodes exist, we continue existing
return 1
Expand Down
4 changes: 2 additions & 2 deletions code/datums/diseases/advance/symptoms/vision.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ Bonus
if(3, 4)
to_chat(M, "<span class='warning'><b>Your eyes burn!</b></span>")
M.EyeBlurry(20)
eyes.take_damage(1)
eyes.receive_damage(1)
else
to_chat(M, "<span class='userdanger'>Your eyes burn horrificly!</span>")
M.EyeBlurry(30)
eyes.take_damage(5)
eyes.receive_damage(5)
if(eyes.damage >= 10)
M.BecomeNearsighted()
if(prob(eyes.damage - 10 + 1))
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/changeling/powers/headcrab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
H.EyeBlurry(20)
var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes)
if(istype(E))
E.take_damage(5, 1)
E.receive_damage(5, 1)
H.AdjustConfused(3)
for(var/mob/living/silicon/S in range(2,user))
to_chat(S, "<span class='userdanger'>Your sensors are disabled by a shower of blood!</span>")
Expand Down
9 changes: 4 additions & 5 deletions code/game/gamemodes/miniantags/bot_swarm/swarmer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -433,22 +433,22 @@
spawn(5)
qdel(src)

/obj/structure/swarmer/proc/TakeDamage(damage)
/obj/structure/swarmer/take_damage(damage)
health -= damage
if(health <= 0)
qdel(src)

/obj/structure/swarmer/bullet_act(obj/item/projectile/Proj)
if(Proj.damage)
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
TakeDamage(Proj.damage)
take_damage(Proj.damage)
..()

/obj/structure/swarmer/attackby(obj/item/weapon/I, mob/living/user, params)
if(istype(I, /obj/item/weapon))
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
TakeDamage(I.force)
take_damage(I.force)
return

/obj/structure/swarmer/ex_act()
Expand All @@ -462,14 +462,13 @@
/obj/structure/swarmer/emp_act()
qdel(src)
return

/obj/structure/swarmer/attack_animal(mob/living/user)
if(isanimal(user))
var/mob/living/simple_animal/S = user
S.do_attack_animation(src)
user.changeNext_move(CLICK_CD_MELEE)
if(S.melee_damage_type == BRUTE || S.melee_damage_type == BURN)
TakeDamage(rand(S.melee_damage_lower, S.melee_damage_upper))
take_damage(rand(S.melee_damage_lower, S.melee_damage_upper))
return

/obj/structure/swarmer/trap
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/shadowling/shadowling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Made by Xhuis
H.clear_alert("lightexposure")
var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes)
if(istype(E))
E.take_damage(-1)
E.receive_damage(-1)
H.heal_overall_damage(5, 5)
H.adjustToxLoss(-5)
H.adjustBrainLoss(-25) //Shad O. Ling gibbers, "CAN U BE MY THRALL?!!"
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ About the new airlock wires panel:
var/obj/item/organ/external/affecting = H.get_organ("head")
H.Stun(5)
H.Weaken(5)
if(affecting.take_damage(10, 0))
if(affecting.receive_damage(10, 0))
H.UpdateDamageIcon()
else
visible_message("<span class='warning'>[user] headbutts the airlock. Good thing they're wearing a helmet.</span>")
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
else
to_chat(user, "<span class='warning'>You burn your hand on [src]!</span>")
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_arm")
if(affecting && affecting.take_damage(0, 5)) // 5 burn damage
if(affecting && affecting.receive_damage(0, 5)) // 5 burn damage
H.UpdateDamageIcon()
H.updatehealth()
return
Expand Down Expand Up @@ -454,9 +454,9 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes)
if(!eyes) // should still get stabbed in the head
var/obj/item/organ/external/head/head = H.bodyparts_by_name["head"]
head.take_damage(rand(10,14), 1)
head.receive_damage(rand(10,14), 1)
return
eyes.take_damage(rand(3,4), 1)
eyes.receive_damage(rand(3,4), 1)
if(eyes.damage >= eyes.min_bruised_damage)
if(M.stat != 2)
if(!(eyes.status & ORGAN_ROBOT) || !(eyes.status & ORGAN_ASSISTED)) //robot eyes bleeding might be a bit silly
Expand All @@ -472,7 +472,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
if(M.stat != 2)
to_chat(M, "<span class='danger'>You go blind!</span>")
var/obj/item/organ/external/affecting = H.get_organ("head")
if(affecting.take_damage(7))
if(affecting.receive_damage(7))
H.UpdateDamageIcon()
else
M.take_organ_damage(7)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/grenades/flashbang.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
var/mob/living/carbon/human/H = M
var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes)
if(E)
E.take_damage(8, 1)
E.receive_damage(8, 1)

if(M.flash_eyes(affect_silicon = 1))
M.Stun(max(10/distance, 3))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand")
if(affecting.take_damage( 0, 5 )) //INFERNO
if(affecting.receive_damage( 0, 5 )) //INFERNO
H.UpdateDamageIcon()
H.updatehealth()
user.visible_message("<span class='notice'>After a few attempts, [user] manages to light the [src], they however burn their finger in the process.</span>")
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/shards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
if(affecting.status & ORGAN_ROBOT)
return
to_chat(H, "<span class='warning'>[src] cuts into your hand!</span>")
if(affecting.take_damage(force*0.5))
if(affecting.receive_damage(force*0.5))
H.UpdateDamageIcon()
H.updatehealth()

Expand Down Expand Up @@ -84,7 +84,7 @@
if(affecting.status & ORGAN_ROBOT)
return
H.Weaken(3)
if(affecting.take_damage(5, 0))
if(affecting.receive_damage(5, 0))
H.UpdateDamageIcon()
H.updatehealth()
..()
Expand Down
7 changes: 6 additions & 1 deletion code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
var/damtype = "brute"
var/force = 0

var/obj_integrity //defaults to max_integrity
var/max_integrity = 500
var/integrity_failure = 0 //0 if we have no special broken behavior

var/Mtoollink = 0 // variable to decide if an object should show the multitool menu linking menu, not all objects use it

var/burn_state = FIRE_PROOF // LAVA_PROOF | FIRE_PROOF | FLAMMABLE | ON_FIRE
Expand All @@ -25,7 +29,8 @@

/obj/New()
. = ..()

if(obj_integrity == null)
obj_integrity = max_integrity
if(on_blueprints && isturf(loc))
var/turf/T = loc
if(force_blueprints)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@

if(affecting)
to_chat(M, "<span class='warning'>You land heavily on your [affecting.name]!</span>")
affecting.take_damage(damage, 0)
affecting.receive_damage(damage, 0)
if(affecting.parent)
affecting.parent.add_autopsy_data("Misadventure", damage)
else
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/structures/grille.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@
var/obj/R = new rods_type(loc, rods_amount)
transfer_fingerprints_to(R)
qdel(src)
..()

/obj/structure/grille/proc/obj_break()
if(!broken && can_deconstruct)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/assembly/mousetrap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
affecting = H.get_organ(type)
H.Stun(3)
if(affecting)
affecting.take_damage(1, 0)
affecting.receive_damage(1, 0)
H.updatehealth()
else if(ismouse(target))
var/mob/living/simple_animal/mouse/M = target
Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/grown/nettle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
var/organ = ((H.hand ? "l_":"r_") + "arm")
var/obj/item/organ/external/affecting = H.get_organ(organ)
if(affecting)
if(affecting.take_damage(0, force))
if(affecting.receive_damage(0, force))
H.UpdateDamageIcon()
to_chat(H, "<span class='userdanger'>The nettle burns your bare hand!</span>")
return 1
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
var/mob/living/carbon/human/H = src
var/obj/item/organ/external/organ = H.get_organ("chest")
if(istype(organ))
if(organ.take_damage(d, 0))
if(organ.receive_damage(d, 0))
H.UpdateDamageIcon()

H.updatehealth()
Expand Down Expand Up @@ -327,15 +327,15 @@
if(1)
to_chat(src, "<span class='warning'>Your eyes sting a little.</span>")
if(prob(40)) //waiting on carbon organs
E.take_damage(1, 1)
E.receive_damage(1, 1)

if(2)
to_chat(src, "<span class='warning'>Your eyes burn.</span>")
E.take_damage(rand(2, 4), 1)
E.receive_damage(rand(2, 4), 1)

else
to_chat(src, "Your eyes itch and burn severely!</span>")
E.take_damage(rand(12, 16), 1)
E.receive_damage(rand(12, 16), 1)

if(E.damage > E.min_bruised_damage)
AdjustEyeBlind(damage)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
if(!I || !L || I.loc != src || !(I in L.embedded_objects))
return
L.embedded_objects -= I
L.take_damage(I.embedded_unsafe_removal_pain_multiplier*I.w_class)//It hurts to rip it out, get surgery you dingus.
L.receive_damage(I.embedded_unsafe_removal_pain_multiplier*I.w_class)//It hurts to rip it out, get surgery you dingus.
I.forceMove(get_turf(src))
usr.put_in_hands(I)
usr.emote("scream")
Expand Down
16 changes: 8 additions & 8 deletions code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
if(sponge)
if(species)
amount = amount * species.brain_mod
sponge.take_damage(amount, 1)
sponge.receive_damage(amount, 1)
brainloss = sponge.damage
else
brainloss = 200
Expand Down Expand Up @@ -112,7 +112,7 @@
var/obj/item/organ/external/O = get_organ(organ_name)

if(amount > 0)
O.take_damage(amount, 0, sharp=is_sharp(damage_source), used_weapon=damage_source)
O.receive_damage(amount, 0, sharp=is_sharp(damage_source), used_weapon=damage_source)
else
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
O.heal_damage(-amount, 0, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
Expand All @@ -126,7 +126,7 @@
var/obj/item/organ/external/O = get_organ(organ_name)

if(amount > 0)
O.take_damage(0, amount, sharp=is_sharp(damage_source), used_weapon=damage_source)
O.receive_damage(0, amount, sharp=is_sharp(damage_source), used_weapon=damage_source)
else
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
O.heal_damage(0, -amount, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
Expand Down Expand Up @@ -240,7 +240,7 @@
if(!parts.len)
return
var/obj/item/organ/external/picked = pick(parts)
if(picked.take_damage(brute, burn, sharp))
if(picked.receive_damage(brute, burn, sharp))
UpdateDamageIcon()
updatehealth()
speech_problem_flag = 1
Expand Down Expand Up @@ -285,7 +285,7 @@
var/burn_was = picked.burn_dam


update |= picked.take_damage(brute_per_part, burn_per_part, sharp, used_weapon)
update |= picked.receive_damage(brute_per_part, burn_per_part, sharp, used_weapon)

brute -= (picked.brute_dam - brute_was)
burn -= (picked.burn_dam - burn_was)
Expand Down Expand Up @@ -355,7 +355,7 @@ This function restores all organs.
if(species)
damage = damage * species.brute_mod

if(organ.take_damage(damage, 0, sharp, used_weapon))
if(organ.receive_damage(damage, 0, sharp, used_weapon))
UpdateDamageIcon()

if(LAssailant && ishuman(LAssailant)) //superheros still get the comical hit markers
Expand All @@ -372,15 +372,15 @@ This function restores all organs.
dmgIcon.pixel_y = (!lying) ? rand(-11,9) : rand(-10,1)
flick_overlay(dmgIcon, attack_bubble_recipients, 9)

receive_damage()
receiving_damage()

if(BURN)
damageoverlaytemp = 20

if(species)
damage = damage * species.burn_mod

if(organ.take_damage(0, damage, sharp, used_weapon))
if(organ.receive_damage(0, damage, sharp, used_weapon))
UpdateDamageIcon()

// Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life().
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ emp_act
L.embedded_objects |= I
I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!
I.forceMove(src)
L.take_damage(I.w_class*I.embedded_impact_pain_multiplier)
L.receive_damage(I.w_class*I.embedded_impact_pain_multiplier)
visible_message("<span class='danger'>[I] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>[I] embeds itself in your [L.name]!</span>")
hitpush = 0
skipcatch = 1 //can't catch the now embedded item
Expand Down Expand Up @@ -358,10 +358,10 @@ emp_act
if("brute")
if(M.force > 20)
Paralyse(1)
update |= affecting.take_damage(rand(M.force/2, M.force), 0)
update |= affecting.receive_damage(rand(M.force/2, M.force), 0)
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
if("fire")
update |= affecting.take_damage(0, rand(M.force/2, M.force))
update |= affecting.receive_damage(0, rand(M.force/2, M.force))
playsound(src, 'sound/items/Welder.ogg', 50, 1)
if("tox")
M.mech_toxin_damage(src)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if(E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15))
var/obj/item/organ/internal/I = pick(E.internal_organs)
custom_pain("You feel broken bones moving in your [E.name]!", 1)
I.take_damage(rand(3,5))
I.receive_damage(rand(3,5))

//handle_stance()
handle_grasp()
Expand Down
Loading

0 comments on commit 75e177b

Please sign in to comment.