|
|
|
@@ -26,24 +26,24 @@
|
|
|
|
|
. = ..(user)
|
|
|
|
|
|
|
|
|
|
if(health == maxhealth)
|
|
|
|
|
to_chat(user, "<span class='notice'>It looks fully intact.</span>")
|
|
|
|
|
to_chat(user, span("notice", "It looks fully intact."))
|
|
|
|
|
else
|
|
|
|
|
var/perc = health / maxhealth
|
|
|
|
|
if(perc > 0.75)
|
|
|
|
|
to_chat(user, "<span class='notice'>It has a few cracks.</span>")
|
|
|
|
|
to_chat(user, span("notice", "It has a few cracks."))
|
|
|
|
|
else if(perc > 0.5)
|
|
|
|
|
to_chat(user, "<span class='warning'>It looks slightly damaged.</span>")
|
|
|
|
|
to_chat(user, span("warning", "It looks slightly damaged."))
|
|
|
|
|
else if(perc > 0.25)
|
|
|
|
|
to_chat(user, "<span class='warning'>It looks moderately damaged.</span>")
|
|
|
|
|
to_chat(user, span("warning", "It looks moderately damaged."))
|
|
|
|
|
else
|
|
|
|
|
to_chat(user, "<span class='danger'>It looks heavily damaged.</span>")
|
|
|
|
|
to_chat(user, span("danger", "It looks heavily damaged."))
|
|
|
|
|
if(silicate)
|
|
|
|
|
if (silicate < 30)
|
|
|
|
|
to_chat(user, "<span class='notice'>It has a thin layer of silicate.</span>")
|
|
|
|
|
to_chat(user, span("notice", "It has a thin layer of silicate."))
|
|
|
|
|
else if (silicate < 70)
|
|
|
|
|
to_chat(user, "<span class='notice'>It is covered in silicate.</span>")
|
|
|
|
|
to_chat(user, span("notice", "It is covered in silicate."))
|
|
|
|
|
else
|
|
|
|
|
to_chat(user, "<span class='notice'>There is a thick layer of silicate covering it.</span>")
|
|
|
|
|
to_chat(user, span("notice", "There is a thick layer of silicate covering it."))
|
|
|
|
|
|
|
|
|
|
/obj/structure/window/proc/take_damage(var/damage = 0, var/sound_effect = 1)
|
|
|
|
|
var/initialhealth = health
|
|
|
|
@@ -57,13 +57,16 @@
|
|
|
|
|
shatter()
|
|
|
|
|
else
|
|
|
|
|
if(sound_effect)
|
|
|
|
|
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
|
|
|
|
|
playsound(loc, 'sound/effects/glass_hit.ogg', 100, 1)
|
|
|
|
|
if(health < maxhealth / 4 && initialhealth >= maxhealth / 4)
|
|
|
|
|
visible_message("[src] looks like it's about to shatter!" )
|
|
|
|
|
visible_message(span("danger", "[src] looks like it's about to shatter!"))
|
|
|
|
|
playsound(loc, "glasscrack", 100, 1)
|
|
|
|
|
else if(health < maxhealth / 2 && initialhealth >= maxhealth / 2)
|
|
|
|
|
visible_message("[src] looks seriously damaged!" )
|
|
|
|
|
visible_message(span("warning", "[src] looks seriously damaged!"))
|
|
|
|
|
playsound(loc, "glasscrack", 100, 1)
|
|
|
|
|
else if(health < maxhealth * 3/4 && initialhealth >= maxhealth * 3/4)
|
|
|
|
|
visible_message("Cracks begin to appear in [src]!" )
|
|
|
|
|
visible_message(span("warning", "Cracks begin to appear in [src]!"))
|
|
|
|
|
playsound(loc, "glasscrack", 100, 1)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
/obj/structure/window/proc/apply_silicate(var/amount)
|
|
|
|
@@ -86,7 +89,7 @@
|
|
|
|
|
/obj/structure/window/proc/shatter(var/display_message = 1)
|
|
|
|
|
playsound(src, "shatter", 70, 1)
|
|
|
|
|
if(display_message)
|
|
|
|
|
visible_message("[src] shatters!")
|
|
|
|
|
visible_message(span("warning", "\The [src] shatters!"))
|
|
|
|
|
if(dir == SOUTHWEST)
|
|
|
|
|
var/index = null
|
|
|
|
|
index = 0
|
|
|
|
@@ -154,7 +157,7 @@
|
|
|
|
|
|
|
|
|
|
/obj/structure/window/hitby(AM as mob|obj)
|
|
|
|
|
..()
|
|
|
|
|
visible_message("<span class='danger'>[src] was hit by [AM].</span>")
|
|
|
|
|
visible_message(span("danger", "[src] was hit by [AM]."))
|
|
|
|
|
var/tforce = 0
|
|
|
|
|
if(ismob(AM))
|
|
|
|
|
tforce = 40
|
|
|
|
@@ -172,7 +175,7 @@
|
|
|
|
|
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
|
|
|
|
if(HULK in user.mutations)
|
|
|
|
|
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
|
|
|
|
|
user.visible_message("<span class='danger'>[user] smashes through [src]!</span>")
|
|
|
|
|
user.visible_message(span("danger", "[user] smashes through [src]!"))
|
|
|
|
|
user.do_attack_animation(src)
|
|
|
|
|
shatter()
|
|
|
|
|
|
|
|
|
@@ -183,13 +186,13 @@
|
|
|
|
|
attack_generic(H,25)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
playsound(src.loc, 'sound/effects/glassknock.ogg', 90, 1)
|
|
|
|
|
playsound(src.loc, 'sound/effects/glass_knock.ogg', 90, 1)
|
|
|
|
|
user.do_attack_animation(src)
|
|
|
|
|
user.visible_message("<span class='danger'>\The [user] bangs against \the [src]!</span>",
|
|
|
|
|
"<span class='danger'>You bang against \the [src]!</span>",
|
|
|
|
|
user.visible_message(span("danger", "\The [user] bangs against \the [src]!"),
|
|
|
|
|
span("danger", "You bang against \the [src]!"),
|
|
|
|
|
"You hear a banging sound.")
|
|
|
|
|
else
|
|
|
|
|
playsound(src.loc, 'sound/effects/glassknock.ogg', 60, 1)
|
|
|
|
|
playsound(src.loc, 'sound/effects/glass_knock.ogg', 60, 1)
|
|
|
|
|
user.visible_message("[user] knocks on \the [src.name].",
|
|
|
|
|
"You knock on \the [src.name].",
|
|
|
|
|
"You hear a knocking sound.")
|
|
|
|
@@ -198,17 +201,17 @@
|
|
|
|
|
/obj/structure/window/attack_generic(var/mob/user, var/damage)
|
|
|
|
|
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
|
|
|
|
if(damage >= 10)
|
|
|
|
|
visible_message("<span class='danger'>[user] smashes into [src]!</span>")
|
|
|
|
|
visible_message(span("danger", "[user] smashes into [src]!"))
|
|
|
|
|
take_damage(damage)
|
|
|
|
|
else
|
|
|
|
|
visible_message("<span class='notice'>\The [user] bonks \the [src] harmlessly.</span>")
|
|
|
|
|
playsound(src.loc, 'sound/effects/Glasshit.ogg', 10, 1, -2)
|
|
|
|
|
visible_message(span("notice", "\The [user] bonks \the [src] harmlessly."))
|
|
|
|
|
playsound(src.loc, 'sound/effects/glass_hit.ogg', 10, 1, -2)
|
|
|
|
|
user.do_attack_animation(src)
|
|
|
|
|
return 1
|
|
|
|
|
|
|
|
|
|
/obj/structure/window/do_simple_ranged_interaction(var/mob/user)
|
|
|
|
|
visible_message(span("notice", "Something knocks on \the [src]."))
|
|
|
|
|
playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1)
|
|
|
|
|
playsound(loc, 'sound/effects/glass_hit.ogg', 50, 1)
|
|
|
|
|
return TRUE
|
|
|
|
|
|
|
|
|
|
/obj/structure/window/attackby(obj/item/W as obj, mob/user as mob)
|
|
|
|
@@ -226,26 +229,26 @@
|
|
|
|
|
state = 3 - state
|
|
|
|
|
update_nearby_icons()
|
|
|
|
|
playsound(loc, W.usesound, 75, 1)
|
|
|
|
|
to_chat(user, (state == 1 ? "<span class='notice'>You have unfastened the window from the frame.</span>" : "<span class='notice'>You have fastened the window to the frame.</span>"))
|
|
|
|
|
to_chat(user, (state == 1 ? span("notice", "You have unfastened the window from the frame.") : span("notice", "You have fastened the window to the frame.")))
|
|
|
|
|
else if(reinf && state == 0)
|
|
|
|
|
anchored = !anchored
|
|
|
|
|
update_nearby_icons()
|
|
|
|
|
playsound(loc, W.usesound, 75, 1)
|
|
|
|
|
to_chat(user, (anchored ? "<span class='notice'>You have fastened the frame to the floor.</span>" : "<span class='notice'>You have unfastened the frame from the floor.</span>"))
|
|
|
|
|
to_chat(user, (anchored ? span("notice", "You have fastened the frame to the floor.") : span("notice", "You have unfastened the frame from the floor.")))
|
|
|
|
|
else if(!reinf)
|
|
|
|
|
anchored = !anchored
|
|
|
|
|
update_nearby_icons()
|
|
|
|
|
playsound(loc, W.usesound, 75, 1)
|
|
|
|
|
to_chat(user, (anchored ? "<span class='notice'>You have fastened the window to the floor.</span>" : "<span class='notice'>You have unfastened the window.</span>"))
|
|
|
|
|
to_chat(user, (anchored ? span("notice", "You have fastened the window to the floor.") : span("notice", "You have unfastened the window.")))
|
|
|
|
|
else if(W.iscrowbar() && reinf && state <= 1)
|
|
|
|
|
state = 1 - state
|
|
|
|
|
playsound(loc, W.usesound, 75, 1)
|
|
|
|
|
to_chat(user, (state ? "<span class='notice'>You have pried the window into the frame.</span>" : "<span class='notice'>You have pried the window out of the frame.</span>"))
|
|
|
|
|
to_chat(user, (state ? span("notice", "You have pried the window into the frame.") : span("notice", "You have pried the window out of the frame.")))
|
|
|
|
|
else if(W.iswrench() && !anchored && (!state || !reinf))
|
|
|
|
|
if(!glasstype)
|
|
|
|
|
to_chat(user, "<span class='notice'>You're not sure how to dismantle \the [src] properly.</span>")
|
|
|
|
|
to_chat(user, span("notice", "You're not sure how to dismantle \the [src] properly."))
|
|
|
|
|
else
|
|
|
|
|
visible_message("<span class='notice'>[user] dismantles \the [src].</span>")
|
|
|
|
|
visible_message(span("notice", "[user] dismantles \the [src]."))
|
|
|
|
|
if(dir == SOUTHWEST)
|
|
|
|
|
var/obj/item/stack/material/mats = new glasstype(loc)
|
|
|
|
|
mats.amount = is_fulltile() ? 4 : 2
|
|
|
|
@@ -262,7 +265,7 @@
|
|
|
|
|
update_nearby_icons()
|
|
|
|
|
step(src, get_dir(user, src))
|
|
|
|
|
else
|
|
|
|
|
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
|
|
|
|
playsound(loc, 'sound/effects/glass_hit.ogg', 75, 1)
|
|
|
|
|
..()
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
@@ -277,17 +280,17 @@
|
|
|
|
|
var/blocked = M.run_armor_check(def_zone, "melee")
|
|
|
|
|
switch (state)
|
|
|
|
|
if(1)
|
|
|
|
|
M.visible_message("<span class='warning'>[user] slams [M] against \the [src]!</span>")
|
|
|
|
|
M.visible_message(span("warning", "[user] slams [M] against \the [src]!"))
|
|
|
|
|
M.apply_damage(7, damtype, def_zone, blocked, src)
|
|
|
|
|
hit(10)
|
|
|
|
|
if(2)
|
|
|
|
|
M.visible_message("<span class='danger'>[user] bashes [M] against \the [src]!</span>")
|
|
|
|
|
M.visible_message(span("danger", "[user] bashes [M] against \the [src]!"))
|
|
|
|
|
if (prob(50))
|
|
|
|
|
M.Weaken(1)
|
|
|
|
|
M.apply_damage(10, damtype, def_zone, blocked, src)
|
|
|
|
|
hit(25)
|
|
|
|
|
if(3)
|
|
|
|
|
M.visible_message("<span class='danger'><big>[user] crushes [M] against \the [src]!</big></span>")
|
|
|
|
|
M.visible_message(span("danger", "<big>[user] crushes [M] against \the [src]!</big>"))
|
|
|
|
|
M.Weaken(5)
|
|
|
|
|
M.apply_damage(20, damtype, def_zone, blocked, src)
|
|
|
|
|
hit(50)
|
|
|
|
|