mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-06 07:22:42 +00:00
Improved window code, mostly formatting and styles, but also general improvements.
I've tested it a fair bit, but there may be bugs, so please report those if you run into them. Added an ismetroidadult() helper Improved L6 code. Made the syndie shuttle console impervious to bullets. Made mirrors breakable. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5187 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -6,8 +6,12 @@
|
||||
icon_state = "mirror"
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/shattered = 0
|
||||
|
||||
|
||||
/obj/structure/mirror/attack_hand(mob/user as mob)
|
||||
if(shattered) return
|
||||
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
|
||||
@@ -29,4 +33,63 @@
|
||||
if(new_style)
|
||||
H.h_style = new_style
|
||||
|
||||
H.update_hair()
|
||||
H.update_hair()
|
||||
|
||||
|
||||
/obj/structure/mirror/proc/shatter()
|
||||
if(shattered) return
|
||||
shattered = 1
|
||||
icon_state = "mirror_broke"
|
||||
playsound(src, "shatter", 70, 1)
|
||||
desc = "Oh no, seven years of bad luck!"
|
||||
|
||||
|
||||
/obj/structure/mirror/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(prob(Proj.damage * 2))
|
||||
if(!shattered)
|
||||
shatter()
|
||||
else
|
||||
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
..()
|
||||
|
||||
|
||||
/obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(shattered)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
return
|
||||
|
||||
if(prob(I.force * 2))
|
||||
visible_message("<span class='warning'>[user] smashes [src] with [I]!</span>")
|
||||
shatter()
|
||||
else
|
||||
visible_message("<span class='warning'>[user] hits [src] with [I]!</span>")
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 70, 1)
|
||||
|
||||
|
||||
/obj/structure/mirror/attack_alien(mob/user as mob)
|
||||
if(islarva(user)) return
|
||||
if(shattered)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user] smashes [src]!</span>")
|
||||
shatter()
|
||||
|
||||
|
||||
/obj/structure/mirror/attack_animal(mob/user as mob)
|
||||
if(!isanimal(user)) return
|
||||
var/mob/living/simple_animal/M = user
|
||||
if(M.melee_damage_upper <= 0) return
|
||||
if(shattered)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user] smashes [src]!</span>")
|
||||
shatter()
|
||||
|
||||
|
||||
/obj/structure/mirror/attack_metroid(mob/user as mob)
|
||||
if(!ismetroidadult(user)) return
|
||||
if(shattered)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user] smashes [src]!</span>")
|
||||
shatter()
|
||||
Reference in New Issue
Block a user