Genericises rotate() on objects. (#8430)

This commit is contained in:
Matt Atlas
2020-03-17 17:17:42 +01:00
committed by GitHub
parent d68a92f48b
commit 72c968eba6
24 changed files with 373 additions and 665 deletions
+1 -39
View File
@@ -4,10 +4,10 @@
icon = 'icons/obj/structures.dmi'
density = 1
w_class = 3
layer = 3.2//Just above doors
anchored = 1.0
flags = ON_BORDER
obj_flags = OBJ_FLAG_ROTATABLE
var/maxhealth = 14.0
var/maximal_heat = T0C + 100 // Maximal heat before this window begins taking damage from fire
var/damage_per_fire_tick = 2.0 // Amount of damage per fire tick. Regular windows are not fireproof so they might as well break quickly.
@@ -300,44 +300,6 @@
take_damage(damage)
return
/obj/structure/window/verb/rotate()
set name = "Rotate Window Counter-Clockwise"
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return 0
if(anchored)
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
return 0
update_nearby_tiles(need_rebuild=1) //Compel updates before
set_dir(turn(dir, 90))
updateSilicate()
update_nearby_tiles(need_rebuild=1)
return
/obj/structure/window/verb/revrotate()
set name = "Rotate Window Clockwise"
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return 0
if(anchored)
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
return 0
update_nearby_tiles(need_rebuild=1) //Compel updates before
set_dir(turn(dir, 270))
updateSilicate()
update_nearby_tiles(need_rebuild=1)
return
/obj/structure/window/Initialize(mapload, start_dir = null, constructed=0)
. = ..()