mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +01:00
new->init refactor
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
icon = 'icons/mob/alien.dmi'
|
||||
|
||||
/*
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
* Resin
|
||||
*/
|
||||
/obj/effect/alien/resin
|
||||
@@ -149,7 +147,6 @@
|
||||
|
||||
|
||||
/*
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
* Weeds
|
||||
*/
|
||||
#define NODERANGE 3
|
||||
@@ -427,9 +424,6 @@
|
||||
visible_message("<span class='alium'>[src.target] begins to crumble under the acid!</span>")
|
||||
spawn(rand(150, 200)) tick()
|
||||
|
||||
<<<<<<< HEAD
|
||||
//Xenomorph Effect egg removed, replaced with Structure Egg.
|
||||
=======
|
||||
/*
|
||||
* Egg
|
||||
*/
|
||||
@@ -556,4 +550,3 @@
|
||||
if(exposed_temperature > 500 + T0C)
|
||||
health -= 5
|
||||
healthcheck()
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
|
||||
@@ -21,26 +21,16 @@
|
||||
delete_me = 1
|
||||
if("JoinLate") // Bit difference, since we need the spawn point to move.
|
||||
latejoin += src
|
||||
<<<<<<< HEAD
|
||||
simulated = TRUE
|
||||
// delete_me = 1
|
||||
return
|
||||
=======
|
||||
simulated = 1
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
if("JoinLateGateway")
|
||||
latejoin_gateway += loc
|
||||
delete_me = 1
|
||||
if("JoinLateElevator")
|
||||
latejoin_elevator += loc
|
||||
delete_me = 1
|
||||
<<<<<<< HEAD
|
||||
return
|
||||
=======
|
||||
if("JoinLateCheckpoint")
|
||||
latejoin_checkpoint += loc
|
||||
delete_me = 1
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
if("JoinLateCryo")
|
||||
latejoin_cryo += loc
|
||||
delete_me = 1
|
||||
@@ -157,27 +147,17 @@
|
||||
new /obj/item/clothing/head/helmet/gladiator(src.loc)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/effect/landmark/costume/madscientist/New()
|
||||
new /obj/item/clothing/under/suit_jacket/green(src.loc)
|
||||
=======
|
||||
/obj/effect/landmark/costume/madscientist/Initialize()
|
||||
..()
|
||||
new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
new /obj/item/clothing/under/suit_jacket/green(src.loc)
|
||||
new /obj/item/clothing/head/flatcap(src.loc)
|
||||
new /obj/item/clothing/suit/storage/toggle/labcoat/mad(src.loc)
|
||||
new /obj/item/clothing/glasses/gglasses(src.loc)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/effect/landmark/costume/elpresidente/New()
|
||||
new /obj/item/clothing/under/suit_jacket/green(src.loc)
|
||||
=======
|
||||
/obj/effect/landmark/costume/elpresidente/Initialize()
|
||||
..()
|
||||
new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
new /obj/item/clothing/under/suit_jacket/green(src.loc)
|
||||
new /obj/item/clothing/head/flatcap(src.loc)
|
||||
new /obj/item/clothing/mask/smokable/cigarette/cigar/havana(src.loc)
|
||||
new /obj/item/clothing/shoes/boots/jackboots(src.loc)
|
||||
|
||||
@@ -159,7 +159,6 @@
|
||||
/obj/effect/spider/spiderling/frost
|
||||
grow_as = list(/mob/living/simple_mob/animal/giant_spider/frost)
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/effect/spider/spiderling/varied
|
||||
grow_as = list(/mob/living/simple_mob/animal/giant_spider, /mob/living/simple_mob/animal/giant_spider/nurse, /mob/living/simple_mob/animal/giant_spider/hunter,
|
||||
/mob/living/simple_mob/animal/giant_spider/frost, /mob/living/simple_mob/animal/giant_spider/electric, /mob/living/simple_mob/animal/giant_spider/lurker,
|
||||
@@ -167,10 +166,7 @@
|
||||
/mob/living/simple_mob/animal/giant_spider/webslinger, /mob/living/simple_mob/animal/giant_spider/phorogenic, /mob/living/simple_mob/animal/giant_spider/carrier,
|
||||
/mob/living/simple_mob/animal/giant_spider/ion)
|
||||
|
||||
/obj/effect/spider/spiderling/New(var/location, var/atom/parent)
|
||||
=======
|
||||
/obj/effect/spider/spiderling/Initialize(var/ml, var/atom/parent)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
pixel_x = rand(6,-6)
|
||||
pixel_y = rand(6,-6)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
@@ -504,15 +504,9 @@
|
||||
on = 1 //Bio-luminesence has one setting, on.
|
||||
power_use = 0
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/item/device/flashlight/slime/New()
|
||||
..()
|
||||
set_light(light_range, light_power, light_color)
|
||||
=======
|
||||
/obj/item/device/flashlight/slime/Initialize()
|
||||
. = ..()
|
||||
set_light(brightness_on, flashlight_power, flashlight_colour)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
set_light(light_range, light_power, light_color)
|
||||
|
||||
/obj/item/device/flashlight/slime/update_brightness()
|
||||
return
|
||||
|
||||
@@ -22,15 +22,9 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
|
||||
if(istype(rig))
|
||||
rig.forced_move(direction, user)
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/item/device/paicard/New()
|
||||
..()
|
||||
add_overlay("pai-off")
|
||||
=======
|
||||
/obj/item/device/paicard/Initialize()
|
||||
. = ..()
|
||||
overlays += "pai-off"
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
add_overlay("pai-off")
|
||||
|
||||
/obj/item/device/paicard/Destroy()
|
||||
//Will stop people throwing friend pAIs into the singularity so they can respawn
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Access check is of the type requires one. These have been carefully selected to avoid allowing the janitor to see channels he shouldn't
|
||||
//VOREStation Edit Start - Updating this for Virgo
|
||||
var/global/list/default_internal_channels = list(
|
||||
<<<<<<< HEAD
|
||||
num2text(PUB_FREQ) = list(),
|
||||
num2text(AI_FREQ) = list(access_synth),
|
||||
num2text(ENT_FREQ) = list(),
|
||||
@@ -22,27 +21,6 @@ var/global/list/default_medbay_channels = list(
|
||||
num2text(PUB_FREQ) = list(),
|
||||
num2text(MED_FREQ) = list(),
|
||||
num2text(MED_I_FREQ) = list()
|
||||
=======
|
||||
num2text(PUB_FREQ) = list(),
|
||||
num2text(AI_FREQ) = list(access_synth),
|
||||
num2text(ENT_FREQ) = list(),
|
||||
num2text(ERT_FREQ) = list(access_cent_specops),
|
||||
num2text(COMM_FREQ) = list(access_heads),
|
||||
num2text(ENG_FREQ) = list(access_engine_equip, access_atmospherics),
|
||||
num2text(MED_FREQ) = list(access_medical_equip),
|
||||
num2text(MED_I_FREQ) = list(access_medical_equip),
|
||||
num2text(SEC_FREQ) = list(access_security),
|
||||
num2text(SEC_I_FREQ) = list(access_security),
|
||||
num2text(SCI_FREQ) = list(access_tox,access_robotics,access_xenobiology),
|
||||
num2text(SUP_FREQ) = list(access_cargo),
|
||||
num2text(SRV_FREQ) = list(access_janitor, access_hydroponics)
|
||||
)
|
||||
|
||||
var/global/list/default_medbay_channels = list(
|
||||
num2text(PUB_FREQ) = list(),
|
||||
num2text(MED_FREQ) = list(access_medical_equip),
|
||||
num2text(MED_I_FREQ) = list(access_medical_equip)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
)
|
||||
//VOREStation Edit End
|
||||
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
tool_qualities = list(TOOL_WIRECUTTER)
|
||||
var/random_color = TRUE
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/item/weapon/tool/wirecutters/New()
|
||||
/obj/item/weapon/tool/wirecutters/Initialize()
|
||||
if(random_color)
|
||||
switch(pick("red","blue","yellow"))
|
||||
if ("red")
|
||||
@@ -42,14 +41,7 @@
|
||||
|
||||
if (prob(75))
|
||||
src.pixel_y = rand(0, 16)
|
||||
..()
|
||||
=======
|
||||
/obj/item/weapon/tool/wirecutters/Initialize()
|
||||
if(random_color && prob(50))
|
||||
icon_state = "cutters-y"
|
||||
item_state = "cutters_yellow"
|
||||
. = ..()
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
|
||||
/obj/item/weapon/tool/wirecutters/attack(mob/living/carbon/C as mob, mob/user as mob)
|
||||
if(istype(C) && user.a_intent == I_HELP && (C.handcuffed) && (istype(C.handcuffed, /obj/item/weapon/handcuffs/cable)))
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
|
||||
/obj/structure/bed/chair/e_chair/Initialize()
|
||||
. = ..()
|
||||
<<<<<<< HEAD
|
||||
add_overlay(image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir))
|
||||
=======
|
||||
overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
return
|
||||
|
||||
/obj/structure/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
@@ -9,21 +9,13 @@
|
||||
var/obj/item/weapon/extinguisher/has_extinguisher
|
||||
var/opened = 0
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/structure/extinguisher_cabinet/Initialize(var/mapload, var/dir, var/building = 0)
|
||||
. = ..()
|
||||
|
||||
if(building)
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -27 : 27)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? -27 : 27) : 0
|
||||
=======
|
||||
/obj/structure/extinguisher_cabinet/Initialize(var/ml, var/dir, var/building = 0)
|
||||
. = ..()
|
||||
if(building)
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -27 : 27)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? -27 : 27) : 0
|
||||
update_icon()
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
else
|
||||
has_extinguisher = new/obj/item/weapon/extinguisher(src)
|
||||
|
||||
|
||||
@@ -11,12 +11,9 @@
|
||||
var/glass = 1
|
||||
var/datum/tgui_module/appearance_changer/mirror/M
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/structure/mirror/Initialize(mapload, var/dir, var/building = 0, mob/user as mob)
|
||||
=======
|
||||
|
||||
/obj/structure/mirror/Initialize(var/ml, var/dir, var/building = 0, mob/user as mob)
|
||||
. = ..()
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
M = new(src, null)
|
||||
if(building)
|
||||
glass = 0
|
||||
|
||||
@@ -22,12 +22,15 @@
|
||||
hardness -= material.combustion_effect(get_turf(src),temperature, 0.3)
|
||||
CheckHardness()
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/structure/simple_door/Initialize(mapload, var/material_name)
|
||||
. = ..()
|
||||
set_material(material_name)
|
||||
if(material_name && !material)
|
||||
material = material_name
|
||||
else if(!material)
|
||||
material = DEFAULT_WALL_MATERIAL
|
||||
if(!material)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
material = get_material_by_name(material)
|
||||
|
||||
/obj/structure/simple_door/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
@@ -40,17 +43,6 @@
|
||||
material = get_material_by_name(material_name)
|
||||
if(!material)
|
||||
return
|
||||
=======
|
||||
/obj/structure/simple_door/Initialize(var/ml, var/material_name)
|
||||
. = ..()
|
||||
if(material_name && !material)
|
||||
material = material_name
|
||||
else if(!material)
|
||||
material = DEFAULT_WALL_MATERIAL
|
||||
if(!material)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
material = get_material_by_name(material)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
hardness = max(1,round(material.integrity/10))
|
||||
icon_state = material.door_icon_base
|
||||
name = "[material.display_name] door"
|
||||
@@ -229,44 +221,15 @@
|
||||
return
|
||||
SSradiation.radiate(src, round(material.radioactivity/3))
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/structure/simple_door/iron/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "iron")
|
||||
|
||||
/obj/structure/simple_door/silver/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "silver")
|
||||
|
||||
/obj/structure/simple_door/gold/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "gold")
|
||||
|
||||
/obj/structure/simple_door/uranium/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "uranium")
|
||||
|
||||
/obj/structure/simple_door/sandstone/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "sandstone")
|
||||
|
||||
/obj/structure/simple_door/phoron/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "phoron")
|
||||
|
||||
/obj/structure/simple_door/diamond/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "diamond")
|
||||
|
||||
/obj/structure/simple_door/wood/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || MAT_WOOD)
|
||||
/obj/structure/simple_door/wood/Initialize(mapload)
|
||||
knock_sound = 'sound/machines/door/knock_wood.wav'
|
||||
|
||||
/obj/structure/simple_door/hardwood/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || MAT_HARDWOOD)
|
||||
/obj/structure/simple_door/hardwood/Initialize(mapload)
|
||||
knock_sound = 'sound/machines/door/knock_wood.wav'
|
||||
|
||||
/obj/structure/simple_door/sifwood/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || MAT_SIFWOOD)
|
||||
/obj/structure/simple_door/sifwood/Initialize(mapload)
|
||||
knock_sound = 'sound/machines/door/knock_wood.wav'
|
||||
|
||||
/obj/structure/simple_door/resin/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "resin")
|
||||
|
||||
/obj/structure/simple_door/cult/Initialize(mapload,var/material_name)
|
||||
..(mapload, material_name || "cult")
|
||||
=======
|
||||
/obj/structure/simple_door/iron
|
||||
material = MAT_IRON
|
||||
|
||||
@@ -291,6 +254,9 @@
|
||||
/obj/structure/simple_door/wood
|
||||
material = MAT_WOOD
|
||||
|
||||
/obj/structure/simple_door/hardwood
|
||||
material = MAT_HARDWOOD
|
||||
|
||||
/obj/structure/simple_door/sifwood
|
||||
material = MAT_SIFWOOD
|
||||
|
||||
@@ -299,7 +265,6 @@
|
||||
|
||||
/obj/structure/simple_door/cult
|
||||
material = "cult"
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
|
||||
/obj/structure/simple_door/cult/TryToSwitchState(atom/user)
|
||||
if(isliving(user))
|
||||
|
||||
@@ -22,14 +22,8 @@
|
||||
var/base_icon = "bed"
|
||||
var/applies_material_colour = 1
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/structure/bed/New(var/newloc, var/new_material, var/new_padding_material)
|
||||
..(newloc)
|
||||
color = null
|
||||
=======
|
||||
/obj/structure/bed/Initialize(var/ml, var/new_material, var/new_padding_material)
|
||||
. = ..(ml)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
if(!new_material)
|
||||
new_material = MAT_STEEL
|
||||
material = get_material_by_name(new_material)
|
||||
|
||||
@@ -210,13 +210,8 @@
|
||||
return
|
||||
..()
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/structure/bed/chair/wood/New(var/newloc)
|
||||
..(newloc, "wood")
|
||||
=======
|
||||
/obj/structure/bed/chair/wood/Initialize(var/ml, var/newmaterial)
|
||||
. = ..(ml, MAT_WOOD)
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
|
||||
/obj/structure/bed/chair/wood/wings
|
||||
icon_state = "wooden_chair_wings"
|
||||
|
||||
@@ -149,8 +149,6 @@ var/global/list/stool_cache = list() //haha stool
|
||||
remove_padding()
|
||||
else
|
||||
..()
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
/obj/item/weapon/stool/barstool
|
||||
name = "bar stool"
|
||||
@@ -169,5 +167,4 @@ var/global/list/stool_cache = list() //haha stool
|
||||
icon_state = "bar_stool_padded_preview" //set for the map
|
||||
|
||||
/obj/item/weapon/stool/barstool/padded/Initialize(var/ml, var/new_material)
|
||||
. = ..(ml, MAT_STEEL, "carpet")
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
. = ..(ml, MAT_STEEL, "carpet")
|
||||
@@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/structure/window
|
||||
name = "window"
|
||||
desc = "A window."
|
||||
@@ -387,25 +386,28 @@
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
return
|
||||
|
||||
/obj/structure/window/New(Loc, start_dir=null, constructed=0)
|
||||
..()
|
||||
|
||||
if (start_dir)
|
||||
set_dir(start_dir)
|
||||
|
||||
//player-constructed windows
|
||||
if (constructed)
|
||||
anchored = FALSE
|
||||
state = 0
|
||||
update_verbs()
|
||||
|
||||
health = maxhealth
|
||||
|
||||
ini_dir = dir
|
||||
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
update_nearby_icons()
|
||||
|
||||
/obj/structure/window/Initialize(var/ml, start_dir=null, constructed=0)
|
||||
. = ..()
|
||||
|
||||
if (start_dir)
|
||||
set_dir(start_dir)
|
||||
|
||||
//player-constructed windows
|
||||
if (constructed)
|
||||
anchored = 0
|
||||
state = 0
|
||||
update_verbs()
|
||||
|
||||
health = maxhealth
|
||||
|
||||
ini_dir = dir
|
||||
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
update_nearby_icons()
|
||||
|
||||
for(var/obj/structure/table/T in view(src, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
|
||||
/obj/structure/window/Destroy()
|
||||
density = FALSE
|
||||
@@ -695,705 +697,4 @@
|
||||
to_chat(user, span("notice", "You deconstruct \the [src]."))
|
||||
qdel(src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
=======
|
||||
/obj/structure/window
|
||||
name = "window"
|
||||
desc = "A window."
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
density = 1
|
||||
can_atmos_pass = ATMOS_PASS_PROC
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
|
||||
layer = WINDOW_LAYER
|
||||
pressure_resistance = 4*ONE_ATMOSPHERE
|
||||
anchored = 1.0
|
||||
flags = ON_BORDER
|
||||
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.
|
||||
var/health
|
||||
var/force_threshold = 0
|
||||
var/ini_dir = null
|
||||
var/state = 2
|
||||
var/reinf = 0
|
||||
var/basestate
|
||||
var/shardtype = /obj/item/weapon/material/shard
|
||||
var/glasstype = null // Set this in subtypes. Null is assumed strange or otherwise impossible to dismantle, such as for shuttle glass.
|
||||
var/silicate = 0 // number of units of silicate
|
||||
var/fulltile = FALSE // Set to true on full-tile variants.
|
||||
|
||||
/obj/structure/window/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
if(health == maxhealth)
|
||||
. += "<span class='notice'>It looks fully intact.</span>"
|
||||
else
|
||||
var/perc = health / maxhealth
|
||||
if(perc > 0.75)
|
||||
. += "<span class='notice'>It has a few cracks.</span>"
|
||||
else if(perc > 0.5)
|
||||
. += "<span class='warning'>It looks slightly damaged.</span>"
|
||||
else if(perc > 0.25)
|
||||
. += "<span class='warning'>It looks moderately damaged.</span>"
|
||||
else
|
||||
. += "<span class='danger'>It looks heavily damaged.</span>"
|
||||
if(silicate)
|
||||
if (silicate < 30)
|
||||
. += "<span class='notice'>It has a thin layer of silicate.</span>"
|
||||
else if (silicate < 70)
|
||||
. += "<span class='notice'>It is covered in silicate.</span>"
|
||||
else
|
||||
. += "<span class='notice'>There is a thick layer of silicate covering it.</span>"
|
||||
|
||||
/obj/structure/window/examine_icon()
|
||||
return icon(icon=initial(icon),icon_state=initial(icon_state))
|
||||
|
||||
/obj/structure/window/take_damage(var/damage = 0, var/sound_effect = 1)
|
||||
var/initialhealth = health
|
||||
|
||||
if(silicate)
|
||||
damage = damage * (1 - silicate / 200)
|
||||
|
||||
health = max(0, health - damage)
|
||||
|
||||
if(health <= 0)
|
||||
shatter()
|
||||
else
|
||||
if(sound_effect)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 100, 1)
|
||||
if(health < maxhealth / 4 && initialhealth >= maxhealth / 4)
|
||||
visible_message("[src] looks like it's about to shatter!" )
|
||||
update_icon()
|
||||
else if(health < maxhealth / 2 && initialhealth >= maxhealth / 2)
|
||||
visible_message("[src] looks seriously damaged!" )
|
||||
update_icon()
|
||||
else if(health < maxhealth * 3/4 && initialhealth >= maxhealth * 3/4)
|
||||
visible_message("Cracks begin to appear in [src]!" )
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/structure/window/proc/apply_silicate(var/amount)
|
||||
if(health < maxhealth) // Mend the damage
|
||||
health = min(health + amount * 3, maxhealth)
|
||||
if(health == maxhealth)
|
||||
visible_message("[src] looks fully repaired." )
|
||||
else // Reinforce
|
||||
silicate = min(silicate + amount, 100)
|
||||
updateSilicate()
|
||||
|
||||
/obj/structure/window/proc/updateSilicate()
|
||||
if (overlays)
|
||||
overlays.Cut()
|
||||
update_icon()
|
||||
|
||||
var/image/img = image(src)
|
||||
img.color = "#ffffff"
|
||||
img.alpha = silicate * 255 / 100
|
||||
overlays += img
|
||||
|
||||
/obj/structure/window/proc/shatter(var/display_message = 1)
|
||||
playsound(src, "shatter", 70, 1)
|
||||
if(display_message)
|
||||
visible_message("[src] shatters!")
|
||||
new shardtype(loc)
|
||||
if(reinf)
|
||||
new /obj/item/stack/rods(loc)
|
||||
if(is_fulltile())
|
||||
new shardtype(loc) //todo pooling?
|
||||
if(reinf)
|
||||
new /obj/item/stack/rods(loc)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
var/proj_damage = Proj.get_structure_damage()
|
||||
if(!proj_damage) return
|
||||
|
||||
..()
|
||||
take_damage(proj_damage)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
shatter(0)
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(50))
|
||||
shatter(0)
|
||||
return
|
||||
|
||||
/obj/structure/window/blob_act()
|
||||
take_damage(50)
|
||||
|
||||
/obj/structure/window/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return TRUE
|
||||
if(is_fulltile())
|
||||
return FALSE //full tile window, you can't move into it!
|
||||
if((get_dir(loc, target) & dir) || (get_dir(mover, target) == turn(dir, 180)))
|
||||
return !density
|
||||
else
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/CanZASPass(turf/T, is_zone)
|
||||
if(is_fulltile() || get_dir(T, loc) == turn(dir, 180)) // Make sure we're handling the border correctly.
|
||||
return !anchored // If it's anchored, it'll block air.
|
||||
return TRUE // Don't stop airflow from the other sides.
|
||||
|
||||
/obj/structure/window/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
if(istype(O) && O.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(get_dir(O.loc, target) == dir)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/window/hitby(AM as mob|obj)
|
||||
..()
|
||||
visible_message("<span class='danger'>[src] was hit by [AM].</span>")
|
||||
var/tforce = 0
|
||||
if(ismob(AM))
|
||||
tforce = 40
|
||||
else if(isobj(AM))
|
||||
var/obj/item/I = AM
|
||||
tforce = I.throwforce
|
||||
if(reinf) tforce *= 0.25
|
||||
if(health - tforce <= 7 && !reinf)
|
||||
anchored = 0
|
||||
update_verbs()
|
||||
update_nearby_icons()
|
||||
step(src, get_dir(AM, src))
|
||||
take_damage(tforce)
|
||||
|
||||
/obj/structure/window/attack_tk(mob/user as mob)
|
||||
user.visible_message("<span class='notice'>Something knocks on [src].</span>")
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 50, 1)
|
||||
|
||||
/obj/structure/window/attack_hand(mob/user as mob)
|
||||
user.setClickCooldown(user.get_attack_speed())
|
||||
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.do_attack_animation(src)
|
||||
shatter()
|
||||
|
||||
else if (usr.a_intent == I_HURT)
|
||||
|
||||
if (istype(usr,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(H.species.can_shred(H))
|
||||
attack_generic(H,25)
|
||||
return
|
||||
|
||||
playsound(src, 'sound/effects/glassknock.ogg', 80, 1)
|
||||
user.do_attack_animation(src)
|
||||
usr.visible_message("<span class='danger'>\The [usr] bangs against \the [src]!</span>",
|
||||
"<span class='danger'>You bang against \the [src]!</span>",
|
||||
"You hear a banging sound.")
|
||||
else
|
||||
playsound(src, 'sound/effects/glassknock.ogg', 80, 1)
|
||||
usr.visible_message("[usr.name] knocks on the [src.name].",
|
||||
"You knock on the [src.name].",
|
||||
"You hear a knocking sound.")
|
||||
return
|
||||
|
||||
/obj/structure/window/attack_generic(var/mob/user, var/damage)
|
||||
user.setClickCooldown(user.get_attack_speed())
|
||||
if(!damage)
|
||||
return
|
||||
if(damage >= STRUCTURE_MIN_DAMAGE_THRESHOLD)
|
||||
visible_message("<span class='danger'>[user] smashes into [src]!</span>")
|
||||
if(reinf)
|
||||
damage = damage / 2
|
||||
take_damage(damage)
|
||||
else
|
||||
visible_message("<span class='notice'>\The [user] bonks \the [src] harmlessly.</span>")
|
||||
user.do_attack_animation(src)
|
||||
return 1
|
||||
|
||||
/obj/structure/window/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(!istype(W)) return//I really wish I did not need this
|
||||
|
||||
// Fixing.
|
||||
if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent == I_HELP)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(health < maxhealth)
|
||||
if(WT.remove_fuel(1 ,user))
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
if(do_after(user, 40 * WT.toolspeed, target = src))
|
||||
health = maxhealth
|
||||
// playsound(src, 'sound/items/Welder.ogg', 50, 1)
|
||||
update_icon()
|
||||
to_chat(user, "<span class='notice'>You repair [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
|
||||
return
|
||||
|
||||
// Slamming.
|
||||
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
|
||||
var/obj/item/weapon/grab/G = W
|
||||
if(istype(G.affecting,/mob/living))
|
||||
var/mob/living/M = G.affecting
|
||||
var/state = G.state
|
||||
qdel(W) //gotta delete it here because if window breaks, it won't get deleted
|
||||
switch (state)
|
||||
if(1)
|
||||
M.visible_message("<span class='warning'>[user] slams [M] against \the [src]!</span>")
|
||||
M.apply_damage(7)
|
||||
hit(10)
|
||||
if(2)
|
||||
M.visible_message("<span class='danger'>[user] bashes [M] against \the [src]!</span>")
|
||||
if (prob(50))
|
||||
M.Weaken(1)
|
||||
M.apply_damage(10)
|
||||
hit(25)
|
||||
if(3)
|
||||
M.visible_message("<span class='danger'><big>[user] crushes [M] against \the [src]!</big></span>")
|
||||
M.Weaken(5)
|
||||
M.apply_damage(20)
|
||||
hit(50)
|
||||
return
|
||||
|
||||
if(W.flags & NOBLUDGEON) return
|
||||
|
||||
if(W.is_screwdriver())
|
||||
if(reinf && state >= 1)
|
||||
state = 3 - state
|
||||
update_nearby_icons()
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
to_chat(user, "<span class='notice'>You have [state == 1 ? "un" : ""]fastened the window [state ? "from" : "to"] the frame.</span>")
|
||||
else if(reinf && state == 0)
|
||||
anchored = !anchored
|
||||
update_nearby_icons()
|
||||
update_verbs()
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
to_chat(user, "<span class='notice'>You have [anchored ? "" : "un"]fastened the frame [anchored ? "to" : "from"] the floor.</span>")
|
||||
else if(!reinf)
|
||||
anchored = !anchored
|
||||
update_nearby_icons()
|
||||
update_verbs()
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
to_chat(user, "<span class='notice'>You have [anchored ? "" : "un"]fastened the window [anchored ? "to" : "from"] the floor.</span>")
|
||||
else if(W.is_crowbar() && reinf && state <= 1)
|
||||
state = 1 - state
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
to_chat(user, "<span class='notice'>You have pried the window [state ? "into" : "out of"] the frame.</span>")
|
||||
else if(W.is_wrench() && !anchored && (!state || !reinf))
|
||||
if(!glasstype)
|
||||
to_chat(user, "<span class='notice'>You're not sure how to dismantle \the [src] properly.</span>")
|
||||
else
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
visible_message("<span class='notice'>[user] dismantles \the [src].</span>")
|
||||
var/obj/item/stack/material/mats = new glasstype(loc)
|
||||
if(is_fulltile())
|
||||
mats.amount = 4
|
||||
qdel(src)
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && reinf && state == 0 && !istype(src, /obj/structure/window/reinforced/polarized))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if (C.use(1))
|
||||
playsound(src, 'sound/effects/sparks1.ogg', 75, 1)
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] begins to wire \the [src] for electrochromic tinting.</span>", \
|
||||
"<span class='notice'>You begin to wire \the [src] for electrochromic tinting.</span>", \
|
||||
"You hear sparks.")
|
||||
if(do_after(user, 20 * C.toolspeed, src) && state == 0)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
var/obj/structure/window/reinforced/polarized/P = new(loc, dir)
|
||||
if(is_fulltile())
|
||||
P.fulltile = TRUE
|
||||
P.icon_state = "fwindow"
|
||||
P.maxhealth = maxhealth
|
||||
P.health = health
|
||||
P.state = state
|
||||
P.anchored = anchored
|
||||
qdel(src)
|
||||
else if(istype(W,/obj/item/frame) && anchored)
|
||||
var/obj/item/frame/F = W
|
||||
F.try_build(src, user)
|
||||
else
|
||||
user.setClickCooldown(user.get_attack_speed(W))
|
||||
if(W.damtype == BRUTE || W.damtype == BURN)
|
||||
user.do_attack_animation(src)
|
||||
hit(W.force)
|
||||
if(health <= 7)
|
||||
anchored = 0
|
||||
update_nearby_icons()
|
||||
step(src, get_dir(user, src))
|
||||
else
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/structure/window/proc/hit(var/damage, var/sound_effect = 1)
|
||||
if(damage < force_threshold || force_threshold < 0)
|
||||
return
|
||||
if(reinf) damage *= 0.5
|
||||
take_damage(damage)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/verb/rotate_counterclockwise()
|
||||
set name = "Rotate Window Counterclockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.incapacitated())
|
||||
return 0
|
||||
|
||||
if(is_fulltile())
|
||||
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
|
||||
src.set_dir(turn(src.dir, 90))
|
||||
updateSilicate()
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/verb/rotate_clockwise()
|
||||
set name = "Rotate Window Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.incapacitated())
|
||||
return 0
|
||||
|
||||
if(is_fulltile())
|
||||
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
|
||||
src.set_dir(turn(src.dir, 270))
|
||||
updateSilicate()
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
return
|
||||
|
||||
/obj/structure/window/Initialize(var/ml, start_dir=null, constructed=0)
|
||||
. = ..()
|
||||
|
||||
if (start_dir)
|
||||
set_dir(start_dir)
|
||||
|
||||
//player-constructed windows
|
||||
if (constructed)
|
||||
anchored = 0
|
||||
state = 0
|
||||
update_verbs()
|
||||
|
||||
health = maxhealth
|
||||
|
||||
ini_dir = dir
|
||||
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
update_nearby_icons()
|
||||
|
||||
for(var/obj/structure/table/T in view(src, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
|
||||
/obj/structure/window/Destroy()
|
||||
density = 0
|
||||
update_nearby_tiles()
|
||||
var/turf/location = loc
|
||||
. = ..()
|
||||
for(var/obj/structure/window/W in orange(location, 1))
|
||||
W.update_icon()
|
||||
for(var/obj/structure/table/T in view(location, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
|
||||
/obj/structure/window/Move()
|
||||
var/ini_dir = dir
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
var/oldloc = loc
|
||||
. = ..()
|
||||
set_dir(ini_dir)
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
if(loc != oldloc)
|
||||
for(var/obj/structure/table/T in view(oldloc, 1) | view(loc, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
|
||||
//checks if this window is full-tile one
|
||||
/obj/structure/window/proc/is_fulltile()
|
||||
return fulltile
|
||||
|
||||
/obj/structure/window/is_between_turfs(var/turf/origin, var/turf/target)
|
||||
if(fulltile)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
//This proc is used to update the icons of nearby windows. It should not be confused with update_nearby_tiles(), which is an atmos proc!
|
||||
/obj/structure/window/proc/update_nearby_icons()
|
||||
update_icon()
|
||||
for(var/obj/structure/window/W in orange(src, 1))
|
||||
W.update_icon()
|
||||
|
||||
//Updates the availabiliy of the rotation verbs
|
||||
/obj/structure/window/proc/update_verbs()
|
||||
if(anchored || is_fulltile())
|
||||
verbs -= /obj/structure/window/verb/rotate_counterclockwise
|
||||
verbs -= /obj/structure/window/verb/rotate_clockwise
|
||||
else if(!is_fulltile())
|
||||
verbs += /obj/structure/window/verb/rotate_counterclockwise
|
||||
verbs += /obj/structure/window/verb/rotate_clockwise
|
||||
|
||||
//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
|
||||
/obj/structure/window/update_icon()
|
||||
//A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
|
||||
//this way it will only update full-tile ones
|
||||
overlays.Cut()
|
||||
if(!is_fulltile())
|
||||
// Rotate the sprite somewhat so non-fulltiled windows can be seen as needing repair.
|
||||
var/full_tilt_degrees = 15
|
||||
var/tilt_to_apply = abs((health / maxhealth) - 1)
|
||||
if(tilt_to_apply && prob(50))
|
||||
tilt_to_apply = -tilt_to_apply
|
||||
adjust_rotation(LERP(0, full_tilt_degrees, tilt_to_apply))
|
||||
|
||||
icon_state = "[basestate]"
|
||||
return
|
||||
var/list/dirs = list()
|
||||
if(anchored)
|
||||
for(var/obj/structure/window/W in orange(src,1))
|
||||
if(W.anchored && W.density && W.glasstype == src.glasstype && W.is_fulltile()) //Only counts anchored, not-destroyed fill-tile windows.
|
||||
dirs += get_dir(src, W)
|
||||
|
||||
var/list/connections = dirs_to_corner_states(dirs)
|
||||
|
||||
icon_state = ""
|
||||
for(var/i = 1 to 4)
|
||||
var/image/I = image(icon, "[basestate][connections[i]]", dir = 1<<(i-1))
|
||||
overlays += I
|
||||
|
||||
// Damage overlays.
|
||||
var/ratio = health / maxhealth
|
||||
ratio = CEILING(ratio * 4, 1) * 25
|
||||
|
||||
if(ratio > 75)
|
||||
return
|
||||
var/image/I = image(icon, "damage[ratio]", layer = layer + 0.1)
|
||||
overlays += I
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/window/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > maximal_heat)
|
||||
hit(damage_per_fire_tick, 0)
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/obj/structure/window/basic
|
||||
desc = "It looks thin and flimsy. A few knocks with... almost anything, really should shatter it."
|
||||
icon_state = "window"
|
||||
basestate = "window"
|
||||
glasstype = /obj/item/stack/material/glass
|
||||
maximal_heat = T0C + 100
|
||||
damage_per_fire_tick = 2.0
|
||||
maxhealth = 12.0
|
||||
force_threshold = 3
|
||||
|
||||
/obj/structure/window/basic/full
|
||||
icon_state = "window-full"
|
||||
maxhealth = 24
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/phoronbasic
|
||||
name = "phoron window"
|
||||
desc = "A borosilicate alloy window. It seems to be quite strong."
|
||||
basestate = "phoronwindow"
|
||||
icon_state = "phoronwindow"
|
||||
shardtype = /obj/item/weapon/material/shard/phoron
|
||||
glasstype = /obj/item/stack/material/glass/phoronglass
|
||||
maximal_heat = T0C + 2000
|
||||
damage_per_fire_tick = 1.0
|
||||
maxhealth = 40.0
|
||||
force_threshold = 5
|
||||
|
||||
/obj/structure/window/phoronbasic/full
|
||||
icon_state = "phoronwindow-full"
|
||||
maxhealth = 80
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/phoronreinforced
|
||||
name = "reinforced borosilicate window"
|
||||
desc = "A borosilicate alloy window, with rods supporting it. It seems to be very strong."
|
||||
basestate = "phoronrwindow"
|
||||
icon_state = "phoronrwindow"
|
||||
shardtype = /obj/item/weapon/material/shard/phoron
|
||||
glasstype = /obj/item/stack/material/glass/phoronrglass
|
||||
reinf = 1
|
||||
maximal_heat = T0C + 4000
|
||||
damage_per_fire_tick = 1.0 // This should last for 80 fire ticks if the window is not damaged at all. The idea is that borosilicate windows have something like ablative layer that protects them for a while.
|
||||
maxhealth = 80.0
|
||||
force_threshold = 10
|
||||
|
||||
/obj/structure/window/phoronreinforced/full
|
||||
icon_state = "phoronrwindow-full"
|
||||
maxhealth = 160
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/reinforced
|
||||
name = "reinforced window"
|
||||
desc = "It looks rather strong. Might take a few good hits to shatter it."
|
||||
icon_state = "rwindow"
|
||||
basestate = "rwindow"
|
||||
maxhealth = 40.0
|
||||
reinf = 1
|
||||
maximal_heat = T0C + 750
|
||||
damage_per_fire_tick = 2.0
|
||||
glasstype = /obj/item/stack/material/glass/reinforced
|
||||
force_threshold = 6
|
||||
|
||||
/obj/structure/window/reinforced/full
|
||||
icon_state = "rwindow-full"
|
||||
maxhealth = 80
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/reinforced/tinted
|
||||
name = "tinted window"
|
||||
desc = "It looks rather strong and opaque. Might take a few good hits to shatter it."
|
||||
icon_state = "twindow"
|
||||
basestate = "twindow"
|
||||
opacity = 1
|
||||
|
||||
/obj/structure/window/reinforced/tinted/frosted
|
||||
name = "frosted window"
|
||||
desc = "It looks rather strong and frosted over. Looks like it might take a few less hits then a normal reinforced window."
|
||||
icon_state = "fwindow"
|
||||
basestate = "fwindow"
|
||||
maxhealth = 30
|
||||
force_threshold = 5
|
||||
|
||||
/obj/structure/window/shuttle
|
||||
name = "shuttle window"
|
||||
desc = "It looks rather strong. Might take a few good hits to shatter it."
|
||||
icon = 'icons/obj/podwindows.dmi'
|
||||
icon_state = "window"
|
||||
basestate = "window"
|
||||
maxhealth = 40
|
||||
reinf = 1
|
||||
basestate = "w"
|
||||
dir = 5
|
||||
force_threshold = 7
|
||||
|
||||
/obj/structure/window/reinforced/polarized
|
||||
name = "electrochromic window"
|
||||
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
|
||||
var/id
|
||||
|
||||
/obj/structure/window/reinforced/polarized/full
|
||||
icon_state = "rwindow-full"
|
||||
maxhealth = 80
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/reinforced/polarized/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool) && !anchored) // Only allow programming if unanchored!
|
||||
var/obj/item/device/multitool/MT = W
|
||||
// First check if they have a windowtint button buffered
|
||||
if(istype(MT.connectable, /obj/machinery/button/windowtint))
|
||||
var/obj/machinery/button/windowtint/buffered_button = MT.connectable
|
||||
src.id = buffered_button.id
|
||||
to_chat(user, "<span class='notice'>\The [src] is linked to \the [buffered_button].</span>")
|
||||
return TRUE
|
||||
// Otherwise fall back to asking them
|
||||
var/t = sanitizeSafe(input(user, "Enter the ID for the window.", src.name, null), MAX_NAME_LEN)
|
||||
if (!t && user.get_active_hand() != W && in_range(src, user))
|
||||
src.id = t
|
||||
to_chat(user, "<span class='notice'>The new ID of \the [src] is [id]</span>")
|
||||
return TRUE
|
||||
. = ..()
|
||||
|
||||
/obj/structure/window/reinforced/polarized/proc/toggle()
|
||||
if(opacity)
|
||||
animate(src, color="#FFFFFF", time=5)
|
||||
set_opacity(0)
|
||||
else
|
||||
animate(src, color="#222222", time=5)
|
||||
set_opacity(1)
|
||||
|
||||
|
||||
|
||||
/obj/machinery/button/windowtint
|
||||
name = "window tint control"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "light0"
|
||||
desc = "A remote control switch for polarized windows."
|
||||
var/range = 7
|
||||
|
||||
/obj/machinery/button/windowtint/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
toggle_tint()
|
||||
|
||||
/obj/machinery/button/windowtint/proc/toggle_tint()
|
||||
use_power(5)
|
||||
|
||||
active = !active
|
||||
update_icon()
|
||||
|
||||
for(var/obj/structure/window/reinforced/polarized/W in range(src,range))
|
||||
if (W.id == src.id || !W.id)
|
||||
spawn(0)
|
||||
W.toggle()
|
||||
return
|
||||
|
||||
/obj/machinery/button/windowtint/power_change()
|
||||
..()
|
||||
if(active && !powered(power_channel))
|
||||
toggle_tint()
|
||||
|
||||
/obj/machinery/button/windowtint/update_icon()
|
||||
icon_state = "light[active]"
|
||||
|
||||
/obj/machinery/button/windowtint/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/MT = W
|
||||
if(!id)
|
||||
// If no ID is set yet (newly built button?) let them select an ID for first-time use!
|
||||
var/t = sanitizeSafe(input(user, "Enter an ID for \the [src].", src.name, null), MAX_NAME_LEN)
|
||||
if (t && user.get_active_hand() != W && in_range(src, user))
|
||||
src.id = t
|
||||
to_chat(user, "<span class='notice'>The new ID of \the [src] is [id]</span>")
|
||||
if(id)
|
||||
// It already has an ID (or they just set one), buffer it for copying to windows.
|
||||
to_chat(user, "<span class='notice'>You store \the [src] in \the [MT]'s buffer!</span>")
|
||||
MT.connectable = src
|
||||
MT.update_icon()
|
||||
return TRUE
|
||||
. = ..()
|
||||
|
||||
/obj/structure/window/rcd_values(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
switch(passed_mode)
|
||||
if(RCD_DECONSTRUCT)
|
||||
return list(
|
||||
RCD_VALUE_MODE = RCD_DECONSTRUCT,
|
||||
RCD_VALUE_DELAY = 5 SECONDS,
|
||||
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 5
|
||||
)
|
||||
|
||||
/obj/structure/window/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
switch(passed_mode)
|
||||
if(RCD_DECONSTRUCT)
|
||||
to_chat(user, span("notice", "You deconstruct \the [src]."))
|
||||
qdel(src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
>>>>>>> 2f0a618d451... /atom New() => Initialize() [MDB IGNORE] (#8298)
|
||||
return FALSE
|
||||
Reference in New Issue
Block a user