Adds the ability to place flags directly onto windows (#7637)

No need to kerfuffle with a screwdriver to get your consulate looking its best. Now you can just click with your flag to hang it up over windows.
This commit is contained in:
fernerr
2019-12-13 08:24:46 +02:00
committed by Erki
parent 593c1b2b10
commit 4d90bc0573
2 changed files with 13 additions and 11 deletions
+8 -11
View File
@@ -614,14 +614,13 @@
if (!adjacent)
return
var/turf/W = A
if (!iswall(W) || !isturf(user.loc))
to_chat(user, "<span class='warning'>You can't place this here!</span>")
if((!iswall(A) && !istype(A, /obj/structure/window)) || !isturf(user.loc))
to_chat(user, span("warning","You can't place this here!"))
return
var/placement_dir = get_dir(user, W)
var/placement_dir = get_dir(user, A)
if (!(placement_dir in cardinal))
to_chat(user, "<span class='warning'>You must stand directly in front of the wall you wish to place that on.</span>")
to_chat(user, span("warning","You must stand directly in front of the location you wish to place that on."))
return
var/obj/structure/sign/flag/P = new(user.loc)
@@ -666,14 +665,12 @@
/obj/structure/sign/flag/attack_hand(mob/user as mob)
if(alert("Do you want to rip \the [src] from the wall?","You think...","Yes","No") == "Yes")
if(alert("Do you want to rip \the [src] from its place?","You think...","Yes","No") == "Yes")
if(!do_after(user, 2 SECONDS, act_target = src))
return 0
visible_message("<span class='warning'>\The [user] rips \the [src] in a single, decisive motion!</span>" )
visible_message(span("warning","\The [user] rips \the [src] in a single, decisive motion!" ))
playsound(src.loc, 'sound/items/poster_ripped.ogg', 100, 1)
icon_state = "poster_ripped"
name = "ripped poster"
@@ -685,11 +682,11 @@
if(istype(W, /obj/item/flame/lighter))
visible_message("<span class='warning'>\The [user] starts to burn \the [src] down!</span>")
visible_message(span("warning","\The [user] starts to burn \the [src] down!"))
if(!do_after(user, 2 SECONDS, act_target = src))
return 0
visible_message("<span class='warning'>\The [user] burns \the [src] down!</span>")
visible_message(span("warning","\The [user] burns \the [src] down!"))
playsound(src.loc, 'sound/items/cigs_lighters/zippo_on.ogg', 100, 1)
new /obj/effect/decal/cleanable/ash(src.loc)