diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 026195252e..f5474c927d 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -170,7 +170,7 @@ New() ..() - beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large() + beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src) spawn( 5 ) if(orient == "RIGHT") icon_state = "sleeper_0-r" diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index 2502277226..0164199daa 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -228,7 +228,7 @@ if((!src.target || src.target == null) && emagged == 2) if(!src.target || src.target == null) for (var/turf/simulated/floor/D in view(7,src)) - if(!(D in floorbottargets) && D != src.oldtarget && D.floor_tile) + if(!(D in floorbottargets) && D != src.oldtarget && D.floor_type) src.oldtarget = D src.target = D break diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 9ebc550119..984d6816ce 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -296,10 +296,9 @@ var/global/list/holodeck_programs = list( /turf/simulated/floor/holofloor/grass name = "Lush Grass" icon_state = "grass1" - floor_tile = new/obj/item/stack/tile/grass + floor_type = /obj/item/stack/tile/grass New() - floor_tile.New() //I guess New() isn't run on objects spawned without the definition of a turf to house them, ah well. icon_state = "grass[pick("1","2","3","4")]" ..() spawn(4) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 692d4da481..c4b0179a94 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -71,54 +71,55 @@ setup() /obj/machinery/porta_turret/proc/setup() - var/obj/item/weapon/gun/energy/E = new installation //All energy-based weapons are applicable + var/obj/item/weapon/gun/energy/E = installation //All energy-based weapons are applicable //var/obj/item/ammo_casing/shottype = E.projectile_type - projectile = E.projectile_type + projectile = intial(E.projectile_type) eprojectile = projectile - shot_sound = E.fire_sound + shot_sound = intial(E.fire_sound) eshot_sound = shot_sound - weapon_setup(E) + weapon_setup(installation) -/obj/machinery/porta_turret/proc/weapon_setup(var/obj/item/weapon/gun/energy/E) - if(/obj/item/weapon/gun/energy/laser/practice) - iconholder = 1 - eprojectile = /obj/item/projectile/beam +/obj/machinery/porta_turret/proc/weapon_setup(var/guntype) + switch(guntype) + if(/obj/item/weapon/gun/energy/laser/practice) + iconholder = 1 + eprojectile = /obj/item/projectile/beam // if(/obj/item/weapon/gun/energy/laser/practice/sc_laser) // iconholder = 1 // eprojectile = /obj/item/projectile/beam - if(/obj/item/weapon/gun/energy/laser/retro) - iconholder = 1 + if(/obj/item/weapon/gun/energy/laser/retro) + iconholder = 1 // if(/obj/item/weapon/gun/energy/laser/retro/sc_retro) // iconholder = 1 - if(/obj/item/weapon/gun/energy/laser/captain) - iconholder = 1 + if(/obj/item/weapon/gun/energy/laser/captain) + iconholder = 1 - if(/obj/item/weapon/gun/energy/lasercannon) - iconholder = 1 + if(/obj/item/weapon/gun/energy/lasercannon) + iconholder = 1 - if(/obj/item/weapon/gun/energy/taser) - eprojectile = /obj/item/projectile/beam - eshot_sound = 'sound/weapons/Laser.ogg' + if(/obj/item/weapon/gun/energy/taser) + eprojectile = /obj/item/projectile/beam + eshot_sound = 'sound/weapons/Laser.ogg' - if(/obj/item/weapon/gun/energy/stunrevolver) - eprojectile = /obj/item/projectile/beam - eshot_sound = 'sound/weapons/Laser.ogg' + if(/obj/item/weapon/gun/energy/stunrevolver) + eprojectile = /obj/item/projectile/beam + eshot_sound = 'sound/weapons/Laser.ogg' - if(/obj/item/weapon/gun/energy/gun) - eprojectile = /obj/item/projectile/beam //If it has, going to kill mode - eshot_sound = 'sound/weapons/Laser.ogg' - egun = 1 + if(/obj/item/weapon/gun/energy/gun) + eprojectile = /obj/item/projectile/beam //If it has, going to kill mode + eshot_sound = 'sound/weapons/Laser.ogg' + egun = 1 - if(/obj/item/weapon/gun/energy/gun/nuclear) - eprojectile = /obj/item/projectile/beam //If it has, going to kill mode - eshot_sound = 'sound/weapons/Laser.ogg' - egun = 1 + if(/obj/item/weapon/gun/energy/gun/nuclear) + eprojectile = /obj/item/projectile/beam //If it has, going to kill mode + eshot_sound = 'sound/weapons/Laser.ogg' + egun = 1 /obj/machinery/porta_turret/update_icon() if(!anchored) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index ab931c46d3..5a52dde42e 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -130,7 +130,6 @@ var/price = prices[typepath] if(isnull(amount)) amount = 1 - var/atom/temp = new typepath(null) var/datum/data/vending_product/R = new /datum/data/vending_product() R.product_path = typepath @@ -151,7 +150,8 @@ if(delay_product_spawn) sleep(5) //sleep(1) did not seem to cut it, so here we are. - R.product_name = temp.name + var/atom/temp = typepath + R.product_name = initial(temp.name) // world << "Added: [R.product_name]] - [R.amount] - [R.product_path]" return diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index a64a8485af..8a527e1b08 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -337,7 +337,7 @@ var/turf/simulated/floor/T = new_turf if(!T.is_plating()) if(!T.broken && !T.burnt) - new T.floor_tile.type(T) + new T.floor_type(T) T.make_plating() return !new_turf.intact diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 8d60a48a9b..20703363ff 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -48,7 +48,7 @@ // temporary fix for broken icon until somebody gets around to make these player-buildable /turf/simulated/floor/mech_bay_recharge_floor/attackby(obj/item/C as obj, mob/user as mob) ..() - if(floor_tile) + if(floor_type) icon_state = "recharge_floor" else icon_state = "support_lattice" diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index aa58c01ee6..feffa9096d 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -15,9 +15,15 @@ var/obj/item/device/encryptionkey/keyslot2 = null maxf = 1489 + var/ks1type = /obj/item/device/encryptionkey + var/ks2type = null + /obj/item/device/radio/headset/New() ..() - keyslot1 = new /obj/item/device/encryptionkey/ + if(ks1type) + keyslot1 = new ks1type(src) + if(ks2type) + keyslot2 = new ks2type(src) recalculateChannels(1) /obj/item/device/radio/headset/examine(mob/user) @@ -25,7 +31,7 @@ return user << "The following channels are built-in:" - user << radio_desc + user << radio_desc /obj/item/device/radio/headset/handle_message_mode(mob/living/M as mob, message, channel) if (channel == "special") @@ -50,76 +56,68 @@ /obj/item/device/radio/headset/syndicate origin_tech = "syndicate=3" -/obj/item/device/radio/headset/syndicate/New() - ..() - del(keyslot1) - keyslot1 = new /obj/item/device/encryptionkey/syndicate syndie = 1 - recalculateChannels(1) + ks1type = /obj/item/device/encryptionkey/syndicate /obj/item/device/radio/headset/binary origin_tech = "syndicate=3" -/obj/item/device/radio/headset/binary/New() - ..() - del(keyslot1) - keyslot1 = new /obj/item/device/encryptionkey/binary - recalculateChannels(1) + ks1type = /obj/item/device/encryptionkey/binary /obj/item/device/radio/headset/headset_sec name = "security radio headset" desc = "This is used by your elite security force." icon_state = "sec_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_sec + ks2type = /obj/item/device/encryptionkey/headset_sec /obj/item/device/radio/headset/headset_eng name = "engineering radio headset" desc = "When the engineers wish to chat like girls." icon_state = "eng_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_eng + ks2type = /obj/item/device/encryptionkey/headset_eng /obj/item/device/radio/headset/headset_rob name = "robotics radio headset" desc = "Made specifically for the roboticists who cannot decide between departments." icon_state = "rob_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_rob + ks2type = /obj/item/device/encryptionkey/headset_rob /obj/item/device/radio/headset/headset_med name = "medical radio headset" desc = "A headset for the trained staff of the medbay." icon_state = "med_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_med + ks2type = /obj/item/device/encryptionkey/headset_med /obj/item/device/radio/headset/headset_sci name = "science radio headset" desc = "A sciency headset. Like usual." icon_state = "com_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_sci + ks2type = /obj/item/device/encryptionkey/headset_sci /obj/item/device/radio/headset/headset_medsci name = "medical research radio headset" desc = "A headset that is a result of the mating between medical and science." icon_state = "med_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_medsci + ks2type = /obj/item/device/encryptionkey/headset_medsci /obj/item/device/radio/headset/headset_com name = "command radio headset" desc = "A headset with a commanding channel." icon_state = "com_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_com + ks2type = /obj/item/device/encryptionkey/headset_com /obj/item/device/radio/headset/heads/captain name = "captain's headset" desc = "The headset of the boss." icon_state = "com_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/heads/captain + ks2type = /obj/item/device/encryptionkey/heads/captain /obj/item/device/radio/headset/heads/ai_integrated //No need to care about icons, it should be hidden inside the AI anyway. name = "AI Subspace Transceiver" @@ -127,7 +125,7 @@ icon = 'icons/obj/robot_component.dmi' icon_state = "radio" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/heads/ai_integrated + ks2type = /obj/item/device/encryptionkey/heads/ai_integrated var/myAi = null // Atlantis: Reference back to the AI which has this radio. var/disabledAi = 0 // Atlantis: Used to manually disable AI's integrated radio via intellicard menu. @@ -141,35 +139,35 @@ desc = "Headset of the researching God." icon_state = "com_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/heads/rd + ks2type = /obj/item/device/encryptionkey/heads/rd /obj/item/device/radio/headset/heads/hos name = "head of security's headset" desc = "The headset of the man who protects your worthless lifes." icon_state = "com_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/heads/hos + ks2type = /obj/item/device/encryptionkey/heads/hos /obj/item/device/radio/headset/heads/ce name = "chief engineer's headset" desc = "The headset of the guy who is in charge of morons" icon_state = "com_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/heads/ce + ks2type = /obj/item/device/encryptionkey/heads/ce /obj/item/device/radio/headset/heads/cmo name = "chief medical officer's headset" desc = "The headset of the highly trained medical chief." icon_state = "com_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/heads/cmo + ks2type = /obj/item/device/encryptionkey/heads/cmo /obj/item/device/radio/headset/heads/hop name = "head of personnel's headset" desc = "The headset of the guy who will one day be captain." icon_state = "com_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/heads/hop + ks2type = /obj/item/device/encryptionkey/heads/hop /* /obj/item/device/radio/headset/headset_mine name = "mining radio headset" @@ -190,14 +188,14 @@ desc = "A headset used by the QM and his slaves." icon_state = "cargo_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_cargo + ks2type = /obj/item/device/encryptionkey/headset_cargo /obj/item/device/radio/headset/headset_service name = "service radio headset" desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean." icon_state = "srv_headset" item_state = "headset" - keyslot2 = new /obj/item/device/encryptionkey/headset_service + ks2type = /obj/item/device/encryptionkey/headset_service /obj/item/device/radio/headset/ert name = "CentCom Response Team headset" @@ -205,7 +203,7 @@ icon_state = "com_headset" item_state = "headset" freerange = 1 - keyslot2 = new /obj/item/device/encryptionkey/ert + ks2type = /obj/item/device/encryptionkey/ert /obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob) // ..() diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm index 5ce93c76a4..73295477f0 100644 --- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm +++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm @@ -2,7 +2,7 @@ /obj/structure/closet/fireaxecabinet name = "Fire Axe Cabinet" desc = "There is small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if." - var/obj/item/weapon/twohanded/fireaxe/fireaxe = new/obj/item/weapon/twohanded/fireaxe + var/obj/item/weapon/twohanded/fireaxe/fireaxe icon_state = "fireaxe1000" icon_closed = "fireaxe1000" icon_opened = "fireaxe1100" @@ -14,6 +14,10 @@ var/locked = 1 var/smashed = 0 + New() + ..() + fireaxe = new /obj/item/weapon/twohanded/fireaxe(src) + attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri //..() //That's very useful, Erro diff --git a/code/game/objects/structures/crates_lockers/closets/job_closets.dm b/code/game/objects/structures/crates_lockers/closets/job_closets.dm index 821fd8ef9a..061f34266e 100644 --- a/code/game/objects/structures/crates_lockers/closets/job_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/job_closets.dm @@ -25,7 +25,7 @@ new /obj/item/clothing/under/sl_suit(src) new /obj/item/clothing/under/rank/bartender(src) new /obj/item/clothing/under/rank/bartender(src) - new /obj/item/clothing/under/dress/dress_saloon + new /obj/item/clothing/under/dress/dress_saloon(src) new /obj/item/clothing/suit/wcoat(src) new /obj/item/clothing/suit/wcoat(src) new /obj/item/clothing/shoes/black(src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index 3abf6d61d3..867dc9cd91 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -21,7 +21,9 @@ /obj/structure/closet/secure_closet/personal/patient/New() ..() spawn(4) - contents = list() + // Not really the best way to do this, but it's better than "contents = list()"! + for(var/atom/movable/AM in contents) + del(AM) new /obj/item/clothing/under/color/white( src ) new /obj/item/clothing/shoes/white( src ) return @@ -51,7 +53,9 @@ /obj/structure/closet/secure_closet/personal/cabinet/New() ..() spawn(4) - contents = list() + // Not really the best way to do this, but it's better than "contents = list()"! + for(var/atom/movable/AM in contents) + del(AM) new /obj/item/weapon/storage/backpack/satchel/withwallet( src ) new /obj/item/device/radio/headset( src ) return diff --git a/code/game/objects/structures/crates_lockers/closets/wardrobe.dm b/code/game/objects/structures/crates_lockers/closets/wardrobe.dm index c00f8a9054..a4c0ca78e8 100644 --- a/code/game/objects/structures/crates_lockers/closets/wardrobe.dm +++ b/code/game/objects/structures/crates_lockers/closets/wardrobe.dm @@ -246,9 +246,9 @@ new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/slippers - new /obj/item/clothing/shoes/slippers - new /obj/item/clothing/shoes/slippers + new /obj/item/clothing/shoes/slippers(src) + new /obj/item/clothing/shoes/slippers(src) + new /obj/item/clothing/shoes/slippers(src) return diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index cf61e68b50..40ba963efd 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -5,9 +5,12 @@ icon_state = "extinguisher_closed" anchored = 1 density = 0 - var/obj/item/weapon/extinguisher/has_extinguisher = new/obj/item/weapon/extinguisher + var/obj/item/weapon/extinguisher/has_extinguisher var/opened = 0 +/obj/structure/extinguisher_cabinet/New() + ..() + has_extinguisher = new/obj/item/weapon/extinguisher(src) /obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user) if(isrobot(user)) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index f3dc6f5eb1..e90f9ddec1 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -34,8 +34,23 @@ var/list/wood_icons = list("wood","wood-broken") var/broken = 0 var/burnt = 0 var/mineral = "metal" - var/obj/item/stack/tile/floor_tile = new/obj/item/stack/tile/plasteel + var/floor_type = /obj/item/stack/tile/plasteel + var/lightfloor_state // for light floors, this is the state of the tile. 0-7, 0x4 is on-bit + proc/get_lightfloor_state() + return lightfloor_state & 3 + + proc/get_lightfloor_on() + return lightfloor_state & 4 + + proc/set_lightfloor_state(n) + lightfloor_state = get_lightfloor_on() | n + + proc/set_lightfloor_on(n) + lightfloor_state = get_lightfloor_state() | n + + proc/toggle_lightfloor_on() + lightfloor_state ^= 4 /turf/simulated/floor/New() ..() @@ -103,9 +118,8 @@ turf/simulated/floor/proc/update_icon() if(!broken && !burnt) icon_state = icon_plating //Because asteroids are 'platings' too. else if(is_light_floor()) - var/obj/item/stack/tile/light/T = floor_tile - if(T.on) - switch(T.state) + if(get_lightfloor_on()) + switch(get_lightfloor_state()) if(0) icon_state = "light_on" SetLuminosity(5) @@ -194,8 +208,7 @@ turf/simulated/floor/proc/update_icon() /turf/simulated/floor/attack_hand(mob/user as mob) if (is_light_floor()) - var/obj/item/stack/tile/light/T = floor_tile - T.on = !T.on + toggle_lightfloor_on() update_icon() if ((!( user.canmove ) || user.restrained() || !( user.pulling ))) return @@ -227,37 +240,37 @@ turf/simulated/floor/proc/update_icon() break_tile() /turf/simulated/floor/is_plasteel_floor() - if(istype(floor_tile,/obj/item/stack/tile/plasteel)) + if(ispath(floor_type, /obj/item/stack/tile/plasteel)) return 1 else return 0 /turf/simulated/floor/is_light_floor() - if(istype(floor_tile,/obj/item/stack/tile/light)) + if(ispath(floor_type, /obj/item/stack/tile/light)) return 1 else return 0 /turf/simulated/floor/is_grass_floor() - if(istype(floor_tile,/obj/item/stack/tile/grass)) + if(ispath(floor_type, /obj/item/stack/tile/grass)) return 1 else return 0 /turf/simulated/floor/is_wood_floor() - if(istype(floor_tile,/obj/item/stack/tile/wood)) + if(ispath(floor_type, /obj/item/stack/tile/wood)) return 1 else return 0 /turf/simulated/floor/is_carpet_floor() - if(istype(floor_tile,/obj/item/stack/tile/carpet)) + if(ispath(floor_type, /obj/item/stack/tile/carpet)) return 1 else return 0 /turf/simulated/floor/is_plating() - if(!floor_tile) + if(!floor_type) return 1 return 0 @@ -308,7 +321,7 @@ turf/simulated/floor/proc/update_icon() src.icon_state = "sand[pick("1","2","3")]" burnt = 1 -//This proc will delete the floor_tile and the update_iocn() proc will then change the icon_state of the turf +//This proc will delete the floor_ tile and the update_iocn() proc will then change the icon_state of the turf //This proc auto corrects the grass tiles' siding. /turf/simulated/floor/proc/make_plating() if(istype(src,/turf/simulated/floor/engine)) return @@ -326,11 +339,10 @@ turf/simulated/floor/proc/update_icon() var/turf/simulated/floor/FF = get_step(src,direction) FF.update_icon() //so siding get updated properly - if(!floor_tile) return - del(floor_tile) + if(!floor_type) return icon_plating = "plating" SetLuminosity(0) - floor_tile = null + floor_type = null intact = 0 broken = 0 burnt = 0 @@ -348,7 +360,7 @@ turf/simulated/floor/proc/update_icon() SetLuminosity(0) if(T) if(istype(T,/obj/item/stack/tile/plasteel)) - floor_tile = T + floor_type = T.type if (icon_regular_floor) icon_state = icon_regular_floor else @@ -358,7 +370,7 @@ turf/simulated/floor/proc/update_icon() levelupdate() return //if you gave a valid parameter, it won't get thisf ar. - floor_tile = new/obj/item/stack/tile/plasteel + floor_type = /obj/item/stack/tile/plasteel icon_state = "floor" icon_regular_floor = icon_state @@ -374,12 +386,12 @@ turf/simulated/floor/proc/update_icon() intact = 1 if(T) if(istype(T,/obj/item/stack/tile/light)) - floor_tile = T + floor_type = T.type update_icon() levelupdate() return //if you gave a valid parameter, it won't get thisf ar. - floor_tile = new/obj/item/stack/tile/light + floor_type = /obj/item/stack/tile/light update_icon() levelupdate() @@ -392,12 +404,12 @@ turf/simulated/floor/proc/update_icon() intact = 1 if(T) if(istype(T,/obj/item/stack/tile/grass)) - floor_tile = T + floor_type = T.type update_icon() levelupdate() return //if you gave a valid parameter, it won't get thisf ar. - floor_tile = new/obj/item/stack/tile/grass + floor_type = /obj/item/stack/tile/grass update_icon() levelupdate() @@ -410,12 +422,12 @@ turf/simulated/floor/proc/update_icon() intact = 1 if(T) if(istype(T,/obj/item/stack/tile/wood)) - floor_tile = T + floor_type = T.type update_icon() levelupdate() return //if you gave a valid parameter, it won't get thisf ar. - floor_tile = new/obj/item/stack/tile/wood + floor_type = /obj/item/stack/tile/wood update_icon() levelupdate() @@ -428,12 +440,12 @@ turf/simulated/floor/proc/update_icon() intact = 1 if(T) if(istype(T,/obj/item/stack/tile/carpet)) - floor_tile = T + floor_type = T.type update_icon() levelupdate() return //if you gave a valid parameter, it won't get thisf ar. - floor_tile = new/obj/item/stack/tile/carpet + floor_type = /obj/item/stack/tile/carpet update_icon() levelupdate() @@ -445,11 +457,10 @@ turf/simulated/floor/proc/update_icon() if(istype(C,/obj/item/weapon/light/bulb)) //only for light tiles if(is_light_floor()) - var/obj/item/stack/tile/light/T = floor_tile - if(T.state) + if(get_lightfloor_state()) user.drop_item(C) del(C) - T.state = C //fixing it by bashing it with a light bulb, fun eh? + set_lightfloor_state(0) //fixing it by bashing it with a light bulb, fun eh? update_icon() user << "\blue You replace the light bulb." else @@ -462,8 +473,8 @@ turf/simulated/floor/proc/update_icon() if(is_wood_floor()) user << "\red You forcefully pry off the planks, destroying them in the process." else - user << "\red You remove the [floor_tile.name]." - new floor_tile.type(src) + var/obj/item/I = new floor_type(src) + user << "\red You remove the [I.name]." make_plating() playsound(src, 'sound/items/Crowbar.ogg', 80, 1) @@ -476,7 +487,7 @@ turf/simulated/floor/proc/update_icon() else if(is_wood_floor()) user << "\red You unscrew the planks." - new floor_tile.type(src) + new floor_type(src) make_plating() playsound(src, 'sound/items/Screwdriver.ogg', 80, 1) @@ -506,13 +517,12 @@ turf/simulated/floor/proc/update_icon() var/obj/item/stack/tile/T = C if (T.get_amount() < 1) return - floor_tile = new T.type + floor_type = T.type intact = 1 if(istype(T,/obj/item/stack/tile/light)) var/obj/item/stack/tile/light/L = T - var/obj/item/stack/tile/light/F = floor_tile - F.state = L.state - F.on = L.on + set_lightfloor_state(L.state) + set_lightfloor_on(L.on) if(istype(T,/obj/item/stack/tile/grass)) for(var/direction in cardinal) if(istype(get_step(src,direction),/turf/simulated/floor)) diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index 087a03eb40..669048cbf4 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -16,17 +16,16 @@ name = "catwalk" icon = 'icons/turf/catwalks.dmi' icon_state = "catwalk0" - floor_tile = null + floor_type = null intact = 0 /turf/simulated/floor/light name = "Light floor" luminosity = 5 icon_state = "light_on" - floor_tile = new/obj/item/stack/tile/light + floor_type = /obj/item/stack/tile/light New() - floor_tile.New() //I guess New() isn't run on objects spawned without the definition of a turf to house them, ah well. var/n = name //just in case commands rename it in the ..() call ..() spawn(4) @@ -39,7 +38,7 @@ /turf/simulated/floor/wood name = "floor" icon_state = "wood" - floor_tile = new/obj/item/stack/tile/wood + floor_type = /obj/item/stack/tile/wood /turf/simulated/floor/vault icon_state = "rockvault" @@ -100,7 +99,7 @@ /turf/simulated/floor/plating name = "plating" icon_state = "plating" - floor_tile = null + floor_type = null intact = 0 /turf/simulated/floor/plating/airless @@ -183,10 +182,9 @@ /turf/simulated/floor/grass name = "Grass patch" icon_state = "grass1" - floor_tile = new/obj/item/stack/tile/grass + floor_type = /obj/item/stack/tile/grass New() - floor_tile.New() //I guess New() isn't ran on objects spawned without the definition of a turf to house them, ah well. icon_state = "grass[pick("1","2","3","4")]" ..() spawn(4) @@ -200,10 +198,9 @@ /turf/simulated/floor/carpet name = "Carpet" icon_state = "carpet" - floor_tile = new/obj/item/stack/tile/carpet + floor_type = /obj/item/stack/tile/carpet New() - floor_tile.New() //I guess New() isn't ran on objects spawned without the definition of a turf to house them, ah well. if(!icon_state) icon_state = "carpet" ..() diff --git a/code/modules/projectiles/guns/projectile/pneumatic.dm b/code/modules/projectiles/guns/projectile/pneumatic.dm index 0da7f7fa4b..feb32d15bd 100644 --- a/code/modules/projectiles/guns/projectile/pneumatic.dm +++ b/code/modules/projectiles/guns/projectile/pneumatic.dm @@ -14,7 +14,7 @@ var/max_w_class = 3 // Hopper intake size. var/max_combined_w_class = 20 // Total internal storage size. var/obj/item/weapon/tank/tank = null // Tank of gas for use in firing the cannon. - var/obj/item/weapon/storage/tank_container = new() // Something to hold the tank item so we don't accidentally fire it. + var/obj/item/weapon/storage/tank_container // Something to hold the tank item so we don't accidentally fire it. var/pressure_setting = 10 // Percentage of the gas in the tank used to fire the projectile. var/possible_pressure_amounts = list(5,10,20,25,50) // Possible pressure settings. var/minimum_tank_pressure = 10 // Minimum pressure to fire the gun. @@ -23,6 +23,7 @@ // analyzer with a force_divisor of 10 hit with a damage multiplier of 3000+. /obj/item/weapon/gun/launcher/pneumatic/New() ..() + tank_container = new(src) tank_container.tag = "gas_tank_holder" /obj/item/weapon/gun/launcher/pneumatic/verb/set_pressure() //set amount of tank pressure. diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm index 9c91717774..5db46df399 100644 --- a/code/modules/vehicles/cargo_train.dm +++ b/code/modules/vehicles/cargo_train.dm @@ -40,8 +40,8 @@ //------------------------------------------- /obj/vehicle/train/cargo/engine/New() ..() - cell = new /obj/item/weapon/cell/high - key = new() + cell = new /obj/item/weapon/cell/high(src) + key = new(src) var/image/I = new(icon = 'icons/obj/vehicles.dmi', icon_state = "cargo_engine_overlay", layer = src.layer + 0.2) //over mobs overlays += I turn_off() //so engine verbs are correctly set