Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Patches on voidsuits can now be removed #305

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
44 changes: 26 additions & 18 deletions code/modules/clothing/spacesuits/breaches.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
//Repair a certain amount of brute or burn damage to the suit.
/obj/item/clothing/suit/space/proc/repair_breaches(var/damtype, var/amount, var/mob/user)

if(!can_breach || !breaches || !breaches.len || !damage)
if(!can_breach || !breaches || !breaches.len)
to_chat(user, "There are no breaches to repair on \the [src].")
return

Expand All @@ -75,7 +75,10 @@
amount_left = 0
B.update_descriptor()

user.visible_message("<b>[user]</b> patches some of the damage on \the [src].")
user.visible_message(
SPAN_NOTICE("\The [user] patches some of the damage on \the [src]."),
SPAN_NOTICE("You patch some of the damage on \the [src].")
)
calc_breach_damage()

/obj/item/clothing/suit/space/proc/create_breaches(var/damtype, var/amount)
Expand Down Expand Up @@ -109,9 +112,11 @@
amount -= needs

if(existing.damtype == BRUTE)
visible_message("<span class = 'warning'>\The [existing.descriptor] on [src] gapes wider[existing.patched ? ", tearing the patch" : ""]!</span>")
var/message = "\The [existing.descriptor] on \the [src] gapes wider[existing.patched ? ", tearing the patch" : ""]!"
visible_message(SPAN_WARNING(message))
else if(existing.damtype == BURN)
visible_message("<span class = 'warning'>\The [existing.descriptor] on [src] widens[existing.patched ? ", ruining the patch" : ""]!</span>")
var/message = "\The [existing.descriptor] on \the [src] widens[existing.patched ? ", ruining the patch" : ""]!"
visible_message(SPAN_WARNING(message))

existing.patched = FALSE

Expand All @@ -127,9 +132,9 @@
B.holder = src

if(B.damtype == BRUTE)
visible_message("<span class = 'warning'>\A [B.descriptor] opens up on [src]!</span>")
visible_message(SPAN_WARNING("\A [B.descriptor] opens up on \the [src]!"))
else if(B.damtype == BURN)
visible_message("<span class = 'warning'>\A [B.descriptor] marks the surface of [src]!</span>")
visible_message(SPAN_WARNING("\A [B.descriptor] marks the surface of \the [src]!"))

calc_breach_damage()

Expand Down Expand Up @@ -187,10 +192,10 @@
if(!repair_power)
return

if(istype(src.loc,/mob/living/carbon/human))
var/mob/living/carbon/human/H = src.loc
if(istype(loc,/mob/living/carbon/human))
var/mob/living/carbon/human/H = loc
if(H.wear_suit == src)
to_chat(user, "<span class='warning'>You cannot repair \the [src] while it is being worn.</span>")
to_chat(user, SPAN_WARNING("You cannot repair \the [src] while it is being worn."))
return

if(burn_damage <= 0)
Expand All @@ -205,10 +210,10 @@

else if(isWelder(W))

if(istype(src.loc,/mob/living/carbon/human))
var/mob/living/carbon/human/H = src.loc
if(istype(loc,/mob/living/carbon/human))
var/mob/living/carbon/human/H = loc
if(H.wear_suit == src)
to_chat(user, "<span class='warning'>You cannot repair \the [src] while it is being worn.</span>")
to_chat(user, SPAN_WARNING("You cannot repair \the [src] while it is being worn."))
return

if (brute_damage <= 0)
Expand All @@ -217,7 +222,7 @@

var/obj/item/weldingtool/WT = W
if(!WT.remove_fuel(5))
to_chat(user, "<span class='warning'>You need more welding fuel to repair this suit.</span>")
to_chat(user, SPAN_WARNING("You need more welding fuel to repair this suit."))
return

repair_breaches(BRUTE, 3, user)
Expand All @@ -233,12 +238,15 @@

if(!target_breach)
to_chat(user, "There are no open breaches to seal with \the [W].")
else
else
playsound(src, 'sound/effects/tape.ogg',25)
var/mob/living/carbon/human/H = user
if(!istype(H)) return
if(do_after(user, H.wear_suit == src? 60 : 30, istype(src.loc,/mob/living)? src.loc : null)) //Sealing a breach on your own suit is awkward and time consuming
user.visible_message("<b>[user]</b> uses \the [W] to seal \the [target_breach.descriptor] on \the [src].")
if(do_after(user, H.wear_suit == src? 60 : 30, istype(loc,/mob/living)? loc : null)) //Sealing a breach on your own suit is awkward and time consuming
user.visible_message(
SPAN_NOTICE("\The [user] uses \the [W] to seal \the [target_breach.descriptor] on \the [src]."),
SPAN_NOTICE("You use \the [W] to seal \the [target_breach.descriptor] on \the [src].")
)
target_breach.patched = TRUE
target_breach.update_descriptor()
calc_breach_damage()
Expand All @@ -250,9 +258,9 @@
. = ..()
if(can_breach && breaches && breaches.len)
for(var/datum/breach/B in breaches)
to_chat(user, "<span class='danger'>It has \a [B.descriptor].</span>")
to_chat(user, SPAN_DANGER("It has \a [B.descriptor]."))

/obj/item/clothing/suit/space/get_pressure_weakness(pressure)
. = ..()
if(can_breach && damage)
. = min(1, . + damage*0.1)
. = min(1, . + damage*0.1)