diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 517b9c7fee..744e412240 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -412,6 +412,8 @@ About the new airlock wires panel: if(electrified_until && isAllPowerLoss()) electrify(0) + update_icon() + /obj/machinery/door/airlock/proc/loseBackupPower() backup_power_lost_until = backupPowerCablesCut() ? -1 : world.time + SecondsToTicks(60) @@ -419,6 +421,8 @@ About the new airlock wires panel: if(electrified_until && isAllPowerLoss()) electrify(0) + update_icon() + /obj/machinery/door/airlock/proc/regainMainPower() if(!mainPowerCablesCut()) main_power_lost_until = 0 @@ -426,11 +430,15 @@ About the new airlock wires panel: if(!backup_power_lost_until) backup_power_lost_until = -1 + update_icon() + /obj/machinery/door/airlock/proc/regainBackupPower() if(!backupPowerCablesCut()) // Restore backup power only if main power is offline, otherwise permanently disable backup_power_lost_until = main_power_lost_until == 0 ? -1 : 0 + update_icon() + /obj/machinery/door/airlock/proc/electrify(var/duration, var/feedback = 0) var/message = "" if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY) && arePowerSystemsOn()) @@ -781,7 +789,7 @@ About the new airlock wires panel: if (istype(da, /obj/structure/door_assembly/multi_tile)) da.set_dir(src.dir) - da.anchored = 1 + da.anchored = 1 if(mineral) da.glass = mineral //else if(glass) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index ac2c156fa4..2fea971119 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -65,6 +65,7 @@ bound_height = width * world.icon_size health = maxhealth + update_icon() update_nearby_tiles(need_rebuild=1) return diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 2272cff0cc..ed01c85149 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -24,10 +24,16 @@ src.base_state = src.icon_state return +/obj/machinery/door/window/update_icon() + if(density) + icon_state = base_state + else + icon_state = "[base_state]open" + /obj/machinery/door/window/proc/shatter(var/display_message = 1) new /obj/item/weapon/material/shard(src.loc) - var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src.loc) - CC.amount = 2 + new /obj/item/weapon/material/shard(src.loc) + new /obj/item/stack/cable_coil(src.loc, 1) var/obj/item/weapon/airlock_electronics/ae if(!electronics) ae = new/obj/item/weapon/airlock_electronics( src.loc ) @@ -103,43 +109,39 @@ return 1 /obj/machinery/door/window/open() - if (src.operating == 1) //doors can still open when emag-disabled + if (operating == 1) //doors can still open when emag-disabled return 0 if (!ticker) return 0 - if(!src.operating) //in case of emag - src.operating = 1 - flick(text("[]opening", src.base_state), src) + if (!operating) //in case of emag + operating = 1 + flick(text("[src.base_state]opening"), src) playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) - src.icon_state = text("[]open", src.base_state) sleep(10) explosion_resistance = 0 - src.density = 0 -// src.sd_SetOpacity(0) //TODO: why is this here? Opaque windoors? ~Carn + density = 0 + update_icon() update_nearby_tiles() if(operating == 1) //emag again - src.operating = 0 + operating = 0 return 1 /obj/machinery/door/window/close() - if (src.operating) + if (operating) return 0 src.operating = 1 flick(text("[]closing", src.base_state), src) playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) - src.icon_state = src.base_state - src.density = 1 + density = 1 + update_icon() explosion_resistance = initial(explosion_resistance) -// if(src.visible) -// SetOpacity(1) //TODO: why is this here? Opaque windoors? ~Carn update_nearby_tiles() sleep(10) - - src.operating = 0 + operating = 0 return 1 /obj/machinery/door/window/take_damage(var/damage) @@ -197,12 +199,14 @@ var/obj/structure/windoor_assembly/wa = new/obj/structure/windoor_assembly(src.loc) if (istype(src, /obj/machinery/door/window/brigdoor)) wa.secure = "secure_" - wa.name = "Secure Wired Windoor Assembly" + wa.name = "secure wired windoor assembly" else - wa.name = "Wired Windoor Assembly" + wa.name = "wired windoor assembly" if (src.base_state == "right" || src.base_state == "rightsecure") wa.facing = "r" wa.set_dir(src.dir) + wa.anchored = 1 + wa.created_name = name wa.state = "02" wa.update_icon() @@ -223,7 +227,7 @@ ae.icon_state = "door_electronics_smoked" operating = 0 - shatter(src) + qdel(src) return //If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway) @@ -262,6 +266,10 @@ maxhealth = 300 health = 300.0 //Stronger doors for prison (regular window door health is 150) +/obj/machinery/door/window/brigdoor/shatter() + new /obj/item/stack/rods(src.loc, 2) + ..() + /obj/machinery/door/window/northleft dir = NORTH diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 89e841bc58..cb7dac0684 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -7,7 +7,7 @@ w_class = 5 var/state = 0 var/base_icon_state = "" - var/base_name = "Airlock" + var/base_name = "airlock" var/obj/item/weapon/airlock_electronics/electronics = null var/airlock_type = "" //the type path of the airlock once completed var/glass_type = "/glass" @@ -19,91 +19,91 @@ /obj/structure/door_assembly/door_assembly_com base_icon_state = "com" - base_name = "Command Airlock" + base_name = "Command airlock" glass_type = "/glass_command" airlock_type = "/command" /obj/structure/door_assembly/door_assembly_sec base_icon_state = "sec" - base_name = "Security Airlock" + base_name = "Security airlock" glass_type = "/glass_security" airlock_type = "/security" /obj/structure/door_assembly/door_assembly_eng base_icon_state = "eng" - base_name = "Engineering Airlock" + base_name = "Engineering airlock" glass_type = "/glass_engineering" airlock_type = "/engineering" /obj/structure/door_assembly/door_assembly_eat base_icon_state = "eat" - base_name = "Engineering Atmos Airlock" + base_name = "Engineering atmos airlock" glass_type = "/glass_engineeringatmos" airlock_type = "/engineering" /obj/structure/door_assembly/door_assembly_min base_icon_state = "min" - base_name = "Mining Airlock" + base_name = "Mining airlock" glass_type = "/glass_mining" airlock_type = "/mining" /obj/structure/door_assembly/door_assembly_atmo base_icon_state = "atmo" - base_name = "Atmospherics Airlock" + base_name = "Atmospherics airlock" glass_type = "/glass_atmos" airlock_type = "/atmos" /obj/structure/door_assembly/door_assembly_research base_icon_state = "res" - base_name = "Research Airlock" + base_name = "Research airlock" glass_type = "/glass_research" airlock_type = "/research" /obj/structure/door_assembly/door_assembly_science base_icon_state = "sci" - base_name = "Science Airlock" + base_name = "Science airlock" glass_type = "/glass_science" airlock_type = "/science" /obj/structure/door_assembly/door_assembly_med base_icon_state = "med" - base_name = "Medical Airlock" + base_name = "Medical airlock" glass_type = "/glass_medical" airlock_type = "/medical" /obj/structure/door_assembly/door_assembly_mai base_icon_state = "mai" - base_name = "Maintenance Airlock" + base_name = "Maintenance airlock" airlock_type = "/maintenance" glass = -1 /obj/structure/door_assembly/door_assembly_ext base_icon_state = "ext" - base_name = "External Airlock" + base_name = "External airlock" airlock_type = "/external" glass = -1 /obj/structure/door_assembly/door_assembly_fre base_icon_state = "fre" - base_name = "Freezer Airlock" + base_name = "Freezer airlock" airlock_type = "/freezer" glass = -1 /obj/structure/door_assembly/door_assembly_hatch base_icon_state = "hatch" - base_name = "Airtight Hatch" + base_name = "airtight hatch" airlock_type = "/hatch" glass = -1 /obj/structure/door_assembly/door_assembly_mhatch base_icon_state = "mhatch" - base_name = "Maintenance Hatch" + base_name = "maintenance hatch" airlock_type = "/maintenance_hatch" glass = -1 /obj/structure/door_assembly/door_assembly_highsecurity // Borrowing this until WJohnston makes sprites for the assembly base_icon_state = "highsec" - base_name = "High Security Airlock" + base_name = "high security airlock" airlock_type = "/highsecurity" glass = -1 @@ -221,7 +221,6 @@ W.loc = src user << "You installed the airlock electronics!" src.state = 2 - src.name = "Near finished Airlock Assembly" src.electronics = W else if(istype(W, /obj/item/weapon/crowbar) && state == 2 ) @@ -238,7 +237,6 @@ if(!src) return user << "You removed the airlock electronics!" src.state = 1 - src.name = "Wired Airlock Assembly" electronics.loc = src.loc electronics = null @@ -294,9 +292,9 @@ switch (state) if(0) if (anchored) - name = "Secured " + name = "secured " if(1) - name = "Wired " + name = "wired " if(2) - name = "Near Finished " - name += "[glass == 1 ? "Window " : ""][istext(glass) ? "[glass] Airlock" : base_name] Assembly" + name = "near finished " + name += "[glass == 1 ? "window " : ""][istext(glass) ? "[glass] airlock" : base_name] assembly ([created_name])" diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index aa961f4c10..52afecd66d 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -126,7 +126,8 @@ return ..() /obj/structure/girder/proc/construct_wall(obj/item/stack/material/S, mob/user) - if(S.get_amount() < 2) + var/amount_to_use = reinf_material ? 1 : 2 + if(S.get_amount() < amount_to_use) user << "There isn't enough material here to construct a wall." return 0 @@ -143,7 +144,6 @@ user << "You begin adding the plating..." - var/amount_to_use = reinf_material ? 1 : 2 if(!do_after(user,40) || !S.use(amount_to_use)) return 1 //once we've gotten this far don't call parent attackby() diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index fb48f6249d..3764386679 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -19,12 +19,18 @@ obj/structure/windoor_assembly w_class = 3 var/obj/item/weapon/airlock_electronics/electronics = null + var/created_name = null //Vars to help with the icon's name var/facing = "l" //Does the windoor open to the left or right? var/secure = "" //Whether or not this creates a secure windoor var/state = "01" //How far the door assembly has progressed in terms of sprites +obj/structure/windoor_assembly/secure + name = "secure windoor assembly" + secure = "secure_" + icon_state = "l_secure_windoor_assembly01" + obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0) ..() if(constructed) @@ -65,24 +71,31 @@ obj/structure/windoor_assembly/Destroy() /obj/structure/windoor_assembly/attackby(obj/item/W as obj, mob/user as mob) - //I really should have spread this out across more states but thin little windoors are hard to sprite. + if(istype(W, /obj/item/weapon/pen)) + var/t = sanitizeSafe(input(user, "Enter the name for the windoor.", src.name, src.created_name), MAX_NAME_LEN) + if(!t) return + if(!in_range(src, usr) && src.loc != usr) return + created_name = t + return + switch(state) if("01") if(istype(W, /obj/item/weapon/weldingtool) && !anchored ) var/obj/item/weapon/weldingtool/WT = W if (WT.remove_fuel(0,user)) - user.visible_message("[user] dissassembles the windoor assembly.", "You start to dissassemble the windoor assembly.") + user.visible_message("[user] disassembles the windoor assembly.", "You start to disassemble the windoor assembly.") playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) if(do_after(user, 40)) if(!src || !WT.isOn()) return - user << "You dissasembled the windoor assembly!" - new /obj/item/stack/material/glass/reinforced(get_turf(src), 5) + user << "You disassembled the windoor assembly!" if(secure) - PoolOrNew(/obj/item/stack/rods, list(get_turf(src), 4)) + new /obj/item/stack/material/glass/reinforced(get_turf(src), 2) + else + new /obj/item/stack/material/glass(get_turf(src), 2) qdel(src) else - user << "You need more welding fuel to dissassemble the windoor assembly." + user << "You need more welding fuel to disassemble the windoor assembly." return //Wrenching an unsecure assembly anchors it in place. Step 4 complete @@ -95,9 +108,9 @@ obj/structure/windoor_assembly/Destroy() user << "You've secured the windoor assembly!" src.anchored = 1 if(src.secure) - src.name = "Secure Anchored Windoor Assembly" + src.name = "secure anchored windoor assembly" else - src.name = "Anchored Windoor Assembly" + src.name = "anchored windoor assembly" //Unwrenching an unsecure assembly un-anchors it. Step 4 undone else if(istype(W, /obj/item/weapon/wrench) && anchored) @@ -109,26 +122,9 @@ obj/structure/windoor_assembly/Destroy() user << "You've unsecured the windoor assembly!" src.anchored = 0 if(src.secure) - src.name = "Secure Windoor Assembly" + src.name = "secure windoor assembly" else - src.name = "Windoor Assembly" - - //Adding plasteel makes the assembly a secure windoor assembly. Step 2 (optional) complete. - else if(istype(W, /obj/item/stack/rods) && !secure) - var/obj/item/stack/rods/R = W - if(R.get_amount() < 4) - user << "You need more rods to do this." - return - user << "You start to reinforce the windoor with rods." - - if(do_after(user,40) && !secure) - if (R.use(4)) - user << "You reinforce the windoor." - src.secure = "secure_" - if(src.anchored) - src.name = "Secure Anchored Windoor Assembly" - else - src.name = "Secure Windoor Assembly" + src.name = "windoor assembly" //Adding cable to the assembly. Step 5 complete. else if(istype(W, /obj/item/stack/cable_coil) && anchored) @@ -140,9 +136,9 @@ obj/structure/windoor_assembly/Destroy() user << "You wire the windoor!" src.state = "02" if(src.secure) - src.name = "Secure Wired Windoor Assembly" + src.name = "secure wired windoor assembly" else - src.name = "Wired Windoor Assembly" + src.name = "wired windoor assembly" else ..() @@ -160,9 +156,9 @@ obj/structure/windoor_assembly/Destroy() new/obj/item/stack/cable_coil(get_turf(user), 1) src.state = "01" if(src.secure) - src.name = "Secure Anchored Windoor Assembly" + src.name = "secure anchored windoor assembly" else - src.name = "Anchored Windoor Assembly" + src.name = "anchored windoor assembly" //Adding airlock electronics for access. Step 6 complete. else if(istype(W, /obj/item/weapon/airlock_electronics) && W:icon_state != "door_electronics_smoked") @@ -175,7 +171,7 @@ obj/structure/windoor_assembly/Destroy() user.drop_item() W.loc = src user << "You've installed the airlock electronics!" - src.name = "Near finished Windoor Assembly" + src.name = "near finished windoor assembly" src.electronics = W else W.loc = src.loc @@ -189,9 +185,9 @@ obj/structure/windoor_assembly/Destroy() if(!src || !src.electronics) return user << "You've removed the airlock electronics!" if(src.secure) - src.name = "Secure Wired Windoor Assembly" + src.name = "secure wired windoor assembly" else - src.name = "Wired Windoor Assembly" + src.name = "wired windoor assembly" var/obj/item/weapon/airlock_electronics/ae = electronics electronics = null ae.loc = src.loc @@ -222,6 +218,9 @@ obj/structure/windoor_assembly/Destroy() windoor.base_state = "rightsecure" windoor.set_dir(src.dir) windoor.density = 0 + windoor.name = created_name + spawn(0) + windoor.close() if(src.electronics.one_access) windoor.req_access = null @@ -240,6 +239,9 @@ obj/structure/windoor_assembly/Destroy() windoor.base_state = "right" windoor.set_dir(src.dir) windoor.density = 0 + windoor.name = created_name + spawn(0) + windoor.close() if(src.electronics.one_access) windoor.req_access = null @@ -257,8 +259,11 @@ obj/structure/windoor_assembly/Destroy() ..() //Update to reflect changes(if applicable) - update_icon() + update_state() +/obj/structure/windoor_assembly/proc/update_state() + update_icon() + name += " ([created_name])" //Rotates the windoor assembly clockwise /obj/structure/windoor_assembly/verb/revrotate() diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 8e6c2cd0d5..c419de639d 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -161,6 +161,7 @@ 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) diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 809fa76a3a..b6e2a49fe0 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -395,7 +395,7 @@ var/list/name_to_material weight = 15 door_icon_base = "stone" destruction_desc = "shatters" - window_options = list("One Direction" = 1, "Full Window" = 4) + window_options = list("One Direction" = 1, "Full Window" = 4, "Windoor" = 2) created_window = /obj/structure/window/basic rod_product = /obj/item/stack/material/glass/reinforced @@ -425,6 +425,12 @@ var/list/name_to_material for (var/obj/structure/window/check_window in user.loc) window_count++ possible_directions -= check_window.dir + for (var/obj/structure/windoor_assembly/check_assembly in user.loc) + window_count++ + possible_directions -= check_assembly.dir + for (var/obj/machinery/door/window/check_windoor in user.loc) + window_count++ + possible_directions -= check_windoor.dir // Get the closest available dir to the user's current facing. var/build_dir = SOUTHWEST //Default to southwest for fulltile windows. @@ -435,18 +441,12 @@ var/list/name_to_material else if(choice in list("One Direction","Windoor")) if(possible_directions.len) - for(var/direction in list(user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) )) + for(var/direction in list(user.dir, turn(user.dir,90), turn(user.dir,270), turn(user.dir,180))) if(direction in possible_directions) build_dir = direction break else failed_to_build = 1 - if(!failed_to_build && choice == "Windoor") - if(!is_reinforced()) - user << "This material is not reinforced enough to use for a door." - return - if((locate(/obj/structure/windoor_assembly) in T.contents) || (locate(/obj/machinery/door/window) in T.contents)) - failed_to_build = 1 if(failed_to_build) user << "There is no room in this location." return 1 @@ -454,7 +454,8 @@ var/list/name_to_material var/build_path = /obj/structure/windoor_assembly var/sheets_needed = window_options[choice] if(choice == "Windoor") - build_dir = user.dir + if(is_reinforced()) + build_path = /obj/structure/windoor_assembly/secure else build_path = created_window @@ -484,7 +485,7 @@ var/list/name_to_material weight = 30 stack_origin_tech = "materials=2" composite_material = list(DEFAULT_WALL_MATERIAL = SHEET_MATERIAL_AMOUNT / 2, "glass" = SHEET_MATERIAL_AMOUNT) - window_options = list("One Direction" = 1, "Full Window" = 4, "Windoor" = 5) + window_options = list("One Direction" = 1, "Full Window" = 4, "Windoor" = 2) created_window = /obj/structure/window/reinforced wire_product = null rod_product = null @@ -497,6 +498,7 @@ var/list/name_to_material integrity = 100 icon_colour = "#FC2BC5" stack_origin_tech = list(TECH_MATERIAL = 4) + window_options = list("One Direction" = 1, "Full Window" = 4) created_window = /obj/structure/window/phoronbasic wire_product = null rod_product = /obj/item/stack/material/glass/phoronrglass @@ -507,6 +509,7 @@ var/list/name_to_material stack_type = /obj/item/stack/material/glass/phoronrglass stack_origin_tech = list(TECH_MATERIAL = 5) composite_material = list() //todo + window_options = list("One Direction" = 1, "Full Window" = 4) created_window = /obj/structure/window/phoronreinforced hardness = 40 weight = 30 diff --git a/html/changelogs/Hubblenaut-Master.yml b/html/changelogs/Hubblenaut-Master.yml new file mode 100644 index 0000000000..d3869676d5 --- /dev/null +++ b/html/changelogs/Hubblenaut-Master.yml @@ -0,0 +1,47 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Hubblenaut + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Windoor assemblies can now be named with a pen." + - rscadd: "Windoor and airlock assemblies now show their custom name during construction phase." + - tweak: "Windoors can now be made out of two sheets of glass or reinforced glass, for normal and secure windoors respectively." + - tweak: "Windoors now automatically close after construction." + - tweak: "Adjusts the algorism for how windoors and windows are placed on construction (when there are already windows co on the same turf)." + - bugfix: "Windoors will now drop exactly the materials they were made of." + - bugfix: "Prying a broken circuit out of a windoor will no longer cause duplicates to drop." + - bugfix: "Airlocks no longer spark after spawn and several other icon update issues were fixed." + - bugfix: "Fixes reinforced walls not being constructable with one sheet left in stack." + - bugfix: "Windows that were busted out of their frame by force are now correctly rotatable." + - bugfix: "Lots of spellchecking and code cleanup in windoor and airlock code." + - rscdel: "Killed innocent kittens."