Fix most nullspace items, rewrite floor tiles not to del() on every place/remove

This commit is contained in:
GinjaNinja32
2014-11-24 17:05:46 +00:00
parent 8d9fad0af6
commit 48343a23fb
17 changed files with 138 additions and 121 deletions

View File

@@ -170,7 +170,7 @@
New() New()
..() ..()
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large() beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
spawn( 5 ) spawn( 5 )
if(orient == "RIGHT") if(orient == "RIGHT")
icon_state = "sleeper_0-r" icon_state = "sleeper_0-r"

View File

@@ -228,7 +228,7 @@
if((!src.target || src.target == null) && emagged == 2) if((!src.target || src.target == null) && emagged == 2)
if(!src.target || src.target == null) if(!src.target || src.target == null)
for (var/turf/simulated/floor/D in view(7,src)) 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.oldtarget = D
src.target = D src.target = D
break break

View File

@@ -296,10 +296,9 @@ var/global/list/holodeck_programs = list(
/turf/simulated/floor/holofloor/grass /turf/simulated/floor/holofloor/grass
name = "Lush Grass" name = "Lush Grass"
icon_state = "grass1" icon_state = "grass1"
floor_tile = new/obj/item/stack/tile/grass floor_type = /obj/item/stack/tile/grass
New() 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")]" icon_state = "grass[pick("1","2","3","4")]"
..() ..()
spawn(4) spawn(4)

View File

@@ -71,54 +71,55 @@
setup() setup()
/obj/machinery/porta_turret/proc/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 //var/obj/item/ammo_casing/shottype = E.projectile_type
projectile = E.projectile_type projectile = intial(E.projectile_type)
eprojectile = projectile eprojectile = projectile
shot_sound = E.fire_sound shot_sound = intial(E.fire_sound)
eshot_sound = shot_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) /obj/machinery/porta_turret/proc/weapon_setup(var/guntype)
if(/obj/item/weapon/gun/energy/laser/practice) switch(guntype)
iconholder = 1 if(/obj/item/weapon/gun/energy/laser/practice)
eprojectile = /obj/item/projectile/beam iconholder = 1
eprojectile = /obj/item/projectile/beam
// if(/obj/item/weapon/gun/energy/laser/practice/sc_laser) // if(/obj/item/weapon/gun/energy/laser/practice/sc_laser)
// iconholder = 1 // iconholder = 1
// eprojectile = /obj/item/projectile/beam // eprojectile = /obj/item/projectile/beam
if(/obj/item/weapon/gun/energy/laser/retro) if(/obj/item/weapon/gun/energy/laser/retro)
iconholder = 1 iconholder = 1
// if(/obj/item/weapon/gun/energy/laser/retro/sc_retro) // if(/obj/item/weapon/gun/energy/laser/retro/sc_retro)
// iconholder = 1 // iconholder = 1
if(/obj/item/weapon/gun/energy/laser/captain) if(/obj/item/weapon/gun/energy/laser/captain)
iconholder = 1 iconholder = 1
if(/obj/item/weapon/gun/energy/lasercannon) if(/obj/item/weapon/gun/energy/lasercannon)
iconholder = 1 iconholder = 1
if(/obj/item/weapon/gun/energy/taser) if(/obj/item/weapon/gun/energy/taser)
eprojectile = /obj/item/projectile/beam eprojectile = /obj/item/projectile/beam
eshot_sound = 'sound/weapons/Laser.ogg' eshot_sound = 'sound/weapons/Laser.ogg'
if(/obj/item/weapon/gun/energy/stunrevolver) if(/obj/item/weapon/gun/energy/stunrevolver)
eprojectile = /obj/item/projectile/beam eprojectile = /obj/item/projectile/beam
eshot_sound = 'sound/weapons/Laser.ogg' eshot_sound = 'sound/weapons/Laser.ogg'
if(/obj/item/weapon/gun/energy/gun) if(/obj/item/weapon/gun/energy/gun)
eprojectile = /obj/item/projectile/beam //If it has, going to kill mode eprojectile = /obj/item/projectile/beam //If it has, going to kill mode
eshot_sound = 'sound/weapons/Laser.ogg' eshot_sound = 'sound/weapons/Laser.ogg'
egun = 1 egun = 1
if(/obj/item/weapon/gun/energy/gun/nuclear) if(/obj/item/weapon/gun/energy/gun/nuclear)
eprojectile = /obj/item/projectile/beam //If it has, going to kill mode eprojectile = /obj/item/projectile/beam //If it has, going to kill mode
eshot_sound = 'sound/weapons/Laser.ogg' eshot_sound = 'sound/weapons/Laser.ogg'
egun = 1 egun = 1
/obj/machinery/porta_turret/update_icon() /obj/machinery/porta_turret/update_icon()
if(!anchored) if(!anchored)

View File

@@ -130,7 +130,6 @@
var/price = prices[typepath] var/price = prices[typepath]
if(isnull(amount)) amount = 1 if(isnull(amount)) amount = 1
var/atom/temp = new typepath(null)
var/datum/data/vending_product/R = new /datum/data/vending_product() var/datum/data/vending_product/R = new /datum/data/vending_product()
R.product_path = typepath R.product_path = typepath
@@ -151,7 +150,8 @@
if(delay_product_spawn) if(delay_product_spawn)
sleep(5) //sleep(1) did not seem to cut it, so here we are. 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]" // world << "Added: [R.product_name]] - [R.amount] - [R.product_path]"
return return

View File

@@ -337,7 +337,7 @@
var/turf/simulated/floor/T = new_turf var/turf/simulated/floor/T = new_turf
if(!T.is_plating()) if(!T.is_plating())
if(!T.broken && !T.burnt) if(!T.broken && !T.burnt)
new T.floor_tile.type(T) new T.floor_type(T)
T.make_plating() T.make_plating()
return !new_turf.intact return !new_turf.intact

View File

@@ -48,7 +48,7 @@
// temporary fix for broken icon until somebody gets around to make these player-buildable // 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) /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" icon_state = "recharge_floor"
else else
icon_state = "support_lattice" icon_state = "support_lattice"

View File

@@ -15,9 +15,15 @@
var/obj/item/device/encryptionkey/keyslot2 = null var/obj/item/device/encryptionkey/keyslot2 = null
maxf = 1489 maxf = 1489
var/ks1type = /obj/item/device/encryptionkey
var/ks2type = null
/obj/item/device/radio/headset/New() /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) recalculateChannels(1)
/obj/item/device/radio/headset/examine(mob/user) /obj/item/device/radio/headset/examine(mob/user)
@@ -25,7 +31,7 @@
return return
user << "The following channels are built-in:" 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) /obj/item/device/radio/headset/handle_message_mode(mob/living/M as mob, message, channel)
if (channel == "special") if (channel == "special")
@@ -50,76 +56,68 @@
/obj/item/device/radio/headset/syndicate /obj/item/device/radio/headset/syndicate
origin_tech = "syndicate=3" origin_tech = "syndicate=3"
/obj/item/device/radio/headset/syndicate/New()
..()
del(keyslot1)
keyslot1 = new /obj/item/device/encryptionkey/syndicate
syndie = 1 syndie = 1
recalculateChannels(1) ks1type = /obj/item/device/encryptionkey/syndicate
/obj/item/device/radio/headset/binary /obj/item/device/radio/headset/binary
origin_tech = "syndicate=3" origin_tech = "syndicate=3"
/obj/item/device/radio/headset/binary/New() ks1type = /obj/item/device/encryptionkey/binary
..()
del(keyslot1)
keyslot1 = new /obj/item/device/encryptionkey/binary
recalculateChannels(1)
/obj/item/device/radio/headset/headset_sec /obj/item/device/radio/headset/headset_sec
name = "security radio headset" name = "security radio headset"
desc = "This is used by your elite security force." desc = "This is used by your elite security force."
icon_state = "sec_headset" icon_state = "sec_headset"
item_state = "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 /obj/item/device/radio/headset/headset_eng
name = "engineering radio headset" name = "engineering radio headset"
desc = "When the engineers wish to chat like girls." desc = "When the engineers wish to chat like girls."
icon_state = "eng_headset" icon_state = "eng_headset"
item_state = "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 /obj/item/device/radio/headset/headset_rob
name = "robotics radio headset" name = "robotics radio headset"
desc = "Made specifically for the roboticists who cannot decide between departments." desc = "Made specifically for the roboticists who cannot decide between departments."
icon_state = "rob_headset" icon_state = "rob_headset"
item_state = "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 /obj/item/device/radio/headset/headset_med
name = "medical radio headset" name = "medical radio headset"
desc = "A headset for the trained staff of the medbay." desc = "A headset for the trained staff of the medbay."
icon_state = "med_headset" icon_state = "med_headset"
item_state = "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 /obj/item/device/radio/headset/headset_sci
name = "science radio headset" name = "science radio headset"
desc = "A sciency headset. Like usual." desc = "A sciency headset. Like usual."
icon_state = "com_headset" icon_state = "com_headset"
item_state = "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 /obj/item/device/radio/headset/headset_medsci
name = "medical research radio headset" name = "medical research radio headset"
desc = "A headset that is a result of the mating between medical and science." desc = "A headset that is a result of the mating between medical and science."
icon_state = "med_headset" icon_state = "med_headset"
item_state = "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 /obj/item/device/radio/headset/headset_com
name = "command radio headset" name = "command radio headset"
desc = "A headset with a commanding channel." desc = "A headset with a commanding channel."
icon_state = "com_headset" icon_state = "com_headset"
item_state = "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 /obj/item/device/radio/headset/heads/captain
name = "captain's headset" name = "captain's headset"
desc = "The headset of the boss." desc = "The headset of the boss."
icon_state = "com_headset" icon_state = "com_headset"
item_state = "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. /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" name = "AI Subspace Transceiver"
@@ -127,7 +125,7 @@
icon = 'icons/obj/robot_component.dmi' icon = 'icons/obj/robot_component.dmi'
icon_state = "radio" icon_state = "radio"
item_state = "headset" 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/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. 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." desc = "Headset of the researching God."
icon_state = "com_headset" icon_state = "com_headset"
item_state = "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 /obj/item/device/radio/headset/heads/hos
name = "head of security's headset" name = "head of security's headset"
desc = "The headset of the man who protects your worthless lifes." desc = "The headset of the man who protects your worthless lifes."
icon_state = "com_headset" icon_state = "com_headset"
item_state = "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 /obj/item/device/radio/headset/heads/ce
name = "chief engineer's headset" name = "chief engineer's headset"
desc = "The headset of the guy who is in charge of morons" desc = "The headset of the guy who is in charge of morons"
icon_state = "com_headset" icon_state = "com_headset"
item_state = "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 /obj/item/device/radio/headset/heads/cmo
name = "chief medical officer's headset" name = "chief medical officer's headset"
desc = "The headset of the highly trained medical chief." desc = "The headset of the highly trained medical chief."
icon_state = "com_headset" icon_state = "com_headset"
item_state = "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 /obj/item/device/radio/headset/heads/hop
name = "head of personnel's headset" name = "head of personnel's headset"
desc = "The headset of the guy who will one day be captain." desc = "The headset of the guy who will one day be captain."
icon_state = "com_headset" icon_state = "com_headset"
item_state = "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 /obj/item/device/radio/headset/headset_mine
name = "mining radio headset" name = "mining radio headset"
@@ -190,14 +188,14 @@
desc = "A headset used by the QM and his slaves." desc = "A headset used by the QM and his slaves."
icon_state = "cargo_headset" icon_state = "cargo_headset"
item_state = "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 /obj/item/device/radio/headset/headset_service
name = "service radio headset" name = "service radio headset"
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean." desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean."
icon_state = "srv_headset" icon_state = "srv_headset"
item_state = "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 /obj/item/device/radio/headset/ert
name = "CentCom Response Team headset" name = "CentCom Response Team headset"
@@ -205,7 +203,7 @@
icon_state = "com_headset" icon_state = "com_headset"
item_state = "headset" item_state = "headset"
freerange = 1 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) /obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob)
// ..() // ..()

View File

@@ -2,7 +2,7 @@
/obj/structure/closet/fireaxecabinet /obj/structure/closet/fireaxecabinet
name = "Fire Axe Cabinet" 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." 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_state = "fireaxe1000"
icon_closed = "fireaxe1000" icon_closed = "fireaxe1000"
icon_opened = "fireaxe1100" icon_opened = "fireaxe1100"
@@ -14,6 +14,10 @@
var/locked = 1 var/locked = 1
var/smashed = 0 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 attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
//..() //That's very useful, Erro //..() //That's very useful, Erro

View File

@@ -25,7 +25,7 @@
new /obj/item/clothing/under/sl_suit(src) 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/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/suit/wcoat(src) new /obj/item/clothing/suit/wcoat(src)
new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src)

View File

@@ -21,7 +21,9 @@
/obj/structure/closet/secure_closet/personal/patient/New() /obj/structure/closet/secure_closet/personal/patient/New()
..() ..()
spawn(4) 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/under/color/white( src )
new /obj/item/clothing/shoes/white( src ) new /obj/item/clothing/shoes/white( src )
return return
@@ -51,7 +53,9 @@
/obj/structure/closet/secure_closet/personal/cabinet/New() /obj/structure/closet/secure_closet/personal/cabinet/New()
..() ..()
spawn(4) 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/weapon/storage/backpack/satchel/withwallet( src )
new /obj/item/device/radio/headset( src ) new /obj/item/device/radio/headset( src )
return return

View File

@@ -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/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(src)
new /obj/item/clothing/shoes/slippers new /obj/item/clothing/shoes/slippers(src)
new /obj/item/clothing/shoes/slippers new /obj/item/clothing/shoes/slippers(src)
return return

View File

@@ -5,9 +5,12 @@
icon_state = "extinguisher_closed" icon_state = "extinguisher_closed"
anchored = 1 anchored = 1
density = 0 density = 0
var/obj/item/weapon/extinguisher/has_extinguisher = new/obj/item/weapon/extinguisher var/obj/item/weapon/extinguisher/has_extinguisher
var/opened = 0 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) /obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user)
if(isrobot(user)) if(isrobot(user))

View File

@@ -34,8 +34,23 @@ var/list/wood_icons = list("wood","wood-broken")
var/broken = 0 var/broken = 0
var/burnt = 0 var/burnt = 0
var/mineral = "metal" 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() /turf/simulated/floor/New()
..() ..()
@@ -103,9 +118,8 @@ turf/simulated/floor/proc/update_icon()
if(!broken && !burnt) if(!broken && !burnt)
icon_state = icon_plating //Because asteroids are 'platings' too. icon_state = icon_plating //Because asteroids are 'platings' too.
else if(is_light_floor()) else if(is_light_floor())
var/obj/item/stack/tile/light/T = floor_tile if(get_lightfloor_on())
if(T.on) switch(get_lightfloor_state())
switch(T.state)
if(0) if(0)
icon_state = "light_on" icon_state = "light_on"
SetLuminosity(5) SetLuminosity(5)
@@ -194,8 +208,7 @@ turf/simulated/floor/proc/update_icon()
/turf/simulated/floor/attack_hand(mob/user as mob) /turf/simulated/floor/attack_hand(mob/user as mob)
if (is_light_floor()) if (is_light_floor())
var/obj/item/stack/tile/light/T = floor_tile toggle_lightfloor_on()
T.on = !T.on
update_icon() update_icon()
if ((!( user.canmove ) || user.restrained() || !( user.pulling ))) if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
return return
@@ -227,37 +240,37 @@ turf/simulated/floor/proc/update_icon()
break_tile() break_tile()
/turf/simulated/floor/is_plasteel_floor() /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 return 1
else else
return 0 return 0
/turf/simulated/floor/is_light_floor() /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 return 1
else else
return 0 return 0
/turf/simulated/floor/is_grass_floor() /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 return 1
else else
return 0 return 0
/turf/simulated/floor/is_wood_floor() /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 return 1
else else
return 0 return 0
/turf/simulated/floor/is_carpet_floor() /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 return 1
else else
return 0 return 0
/turf/simulated/floor/is_plating() /turf/simulated/floor/is_plating()
if(!floor_tile) if(!floor_type)
return 1 return 1
return 0 return 0
@@ -308,7 +321,7 @@ turf/simulated/floor/proc/update_icon()
src.icon_state = "sand[pick("1","2","3")]" src.icon_state = "sand[pick("1","2","3")]"
burnt = 1 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. //This proc auto corrects the grass tiles' siding.
/turf/simulated/floor/proc/make_plating() /turf/simulated/floor/proc/make_plating()
if(istype(src,/turf/simulated/floor/engine)) return 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) var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding get updated properly FF.update_icon() //so siding get updated properly
if(!floor_tile) return if(!floor_type) return
del(floor_tile)
icon_plating = "plating" icon_plating = "plating"
SetLuminosity(0) SetLuminosity(0)
floor_tile = null floor_type = null
intact = 0 intact = 0
broken = 0 broken = 0
burnt = 0 burnt = 0
@@ -348,7 +360,7 @@ turf/simulated/floor/proc/update_icon()
SetLuminosity(0) SetLuminosity(0)
if(T) if(T)
if(istype(T,/obj/item/stack/tile/plasteel)) if(istype(T,/obj/item/stack/tile/plasteel))
floor_tile = T floor_type = T.type
if (icon_regular_floor) if (icon_regular_floor)
icon_state = icon_regular_floor icon_state = icon_regular_floor
else else
@@ -358,7 +370,7 @@ turf/simulated/floor/proc/update_icon()
levelupdate() levelupdate()
return return
//if you gave a valid parameter, it won't get thisf ar. //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_state = "floor"
icon_regular_floor = icon_state icon_regular_floor = icon_state
@@ -374,12 +386,12 @@ turf/simulated/floor/proc/update_icon()
intact = 1 intact = 1
if(T) if(T)
if(istype(T,/obj/item/stack/tile/light)) if(istype(T,/obj/item/stack/tile/light))
floor_tile = T floor_type = T.type
update_icon() update_icon()
levelupdate() levelupdate()
return return
//if you gave a valid parameter, it won't get thisf ar. //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() update_icon()
levelupdate() levelupdate()
@@ -392,12 +404,12 @@ turf/simulated/floor/proc/update_icon()
intact = 1 intact = 1
if(T) if(T)
if(istype(T,/obj/item/stack/tile/grass)) if(istype(T,/obj/item/stack/tile/grass))
floor_tile = T floor_type = T.type
update_icon() update_icon()
levelupdate() levelupdate()
return return
//if you gave a valid parameter, it won't get thisf ar. //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() update_icon()
levelupdate() levelupdate()
@@ -410,12 +422,12 @@ turf/simulated/floor/proc/update_icon()
intact = 1 intact = 1
if(T) if(T)
if(istype(T,/obj/item/stack/tile/wood)) if(istype(T,/obj/item/stack/tile/wood))
floor_tile = T floor_type = T.type
update_icon() update_icon()
levelupdate() levelupdate()
return return
//if you gave a valid parameter, it won't get thisf ar. //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() update_icon()
levelupdate() levelupdate()
@@ -428,12 +440,12 @@ turf/simulated/floor/proc/update_icon()
intact = 1 intact = 1
if(T) if(T)
if(istype(T,/obj/item/stack/tile/carpet)) if(istype(T,/obj/item/stack/tile/carpet))
floor_tile = T floor_type = T.type
update_icon() update_icon()
levelupdate() levelupdate()
return return
//if you gave a valid parameter, it won't get thisf ar. //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() update_icon()
levelupdate() levelupdate()
@@ -445,11 +457,10 @@ turf/simulated/floor/proc/update_icon()
if(istype(C,/obj/item/weapon/light/bulb)) //only for light tiles if(istype(C,/obj/item/weapon/light/bulb)) //only for light tiles
if(is_light_floor()) if(is_light_floor())
var/obj/item/stack/tile/light/T = floor_tile if(get_lightfloor_state())
if(T.state)
user.drop_item(C) user.drop_item(C)
del(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() update_icon()
user << "\blue You replace the light bulb." user << "\blue You replace the light bulb."
else else
@@ -462,8 +473,8 @@ turf/simulated/floor/proc/update_icon()
if(is_wood_floor()) if(is_wood_floor())
user << "\red You forcefully pry off the planks, destroying them in the process." user << "\red You forcefully pry off the planks, destroying them in the process."
else else
user << "\red You remove the [floor_tile.name]." var/obj/item/I = new floor_type(src)
new floor_tile.type(src) user << "\red You remove the [I.name]."
make_plating() make_plating()
playsound(src, 'sound/items/Crowbar.ogg', 80, 1) playsound(src, 'sound/items/Crowbar.ogg', 80, 1)
@@ -476,7 +487,7 @@ turf/simulated/floor/proc/update_icon()
else else
if(is_wood_floor()) if(is_wood_floor())
user << "\red You unscrew the planks." user << "\red You unscrew the planks."
new floor_tile.type(src) new floor_type(src)
make_plating() make_plating()
playsound(src, 'sound/items/Screwdriver.ogg', 80, 1) 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 var/obj/item/stack/tile/T = C
if (T.get_amount() < 1) if (T.get_amount() < 1)
return return
floor_tile = new T.type floor_type = T.type
intact = 1 intact = 1
if(istype(T,/obj/item/stack/tile/light)) if(istype(T,/obj/item/stack/tile/light))
var/obj/item/stack/tile/light/L = T var/obj/item/stack/tile/light/L = T
var/obj/item/stack/tile/light/F = floor_tile set_lightfloor_state(L.state)
F.state = L.state set_lightfloor_on(L.on)
F.on = L.on
if(istype(T,/obj/item/stack/tile/grass)) if(istype(T,/obj/item/stack/tile/grass))
for(var/direction in cardinal) for(var/direction in cardinal)
if(istype(get_step(src,direction),/turf/simulated/floor)) if(istype(get_step(src,direction),/turf/simulated/floor))

View File

@@ -16,17 +16,16 @@
name = "catwalk" name = "catwalk"
icon = 'icons/turf/catwalks.dmi' icon = 'icons/turf/catwalks.dmi'
icon_state = "catwalk0" icon_state = "catwalk0"
floor_tile = null floor_type = null
intact = 0 intact = 0
/turf/simulated/floor/light /turf/simulated/floor/light
name = "Light floor" name = "Light floor"
luminosity = 5 luminosity = 5
icon_state = "light_on" icon_state = "light_on"
floor_tile = new/obj/item/stack/tile/light floor_type = /obj/item/stack/tile/light
New() 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 var/n = name //just in case commands rename it in the ..() call
..() ..()
spawn(4) spawn(4)
@@ -39,7 +38,7 @@
/turf/simulated/floor/wood /turf/simulated/floor/wood
name = "floor" name = "floor"
icon_state = "wood" icon_state = "wood"
floor_tile = new/obj/item/stack/tile/wood floor_type = /obj/item/stack/tile/wood
/turf/simulated/floor/vault /turf/simulated/floor/vault
icon_state = "rockvault" icon_state = "rockvault"
@@ -100,7 +99,7 @@
/turf/simulated/floor/plating /turf/simulated/floor/plating
name = "plating" name = "plating"
icon_state = "plating" icon_state = "plating"
floor_tile = null floor_type = null
intact = 0 intact = 0
/turf/simulated/floor/plating/airless /turf/simulated/floor/plating/airless
@@ -183,10 +182,9 @@
/turf/simulated/floor/grass /turf/simulated/floor/grass
name = "Grass patch" name = "Grass patch"
icon_state = "grass1" icon_state = "grass1"
floor_tile = new/obj/item/stack/tile/grass floor_type = /obj/item/stack/tile/grass
New() 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")]" icon_state = "grass[pick("1","2","3","4")]"
..() ..()
spawn(4) spawn(4)
@@ -200,10 +198,9 @@
/turf/simulated/floor/carpet /turf/simulated/floor/carpet
name = "Carpet" name = "Carpet"
icon_state = "carpet" icon_state = "carpet"
floor_tile = new/obj/item/stack/tile/carpet floor_type = /obj/item/stack/tile/carpet
New() 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) if(!icon_state)
icon_state = "carpet" icon_state = "carpet"
..() ..()

View File

@@ -14,7 +14,7 @@
var/max_w_class = 3 // Hopper intake size. var/max_w_class = 3 // Hopper intake size.
var/max_combined_w_class = 20 // Total internal storage 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/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/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/possible_pressure_amounts = list(5,10,20,25,50) // Possible pressure settings.
var/minimum_tank_pressure = 10 // Minimum pressure to fire the gun. 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+. // analyzer with a force_divisor of 10 hit with a damage multiplier of 3000+.
/obj/item/weapon/gun/launcher/pneumatic/New() /obj/item/weapon/gun/launcher/pneumatic/New()
..() ..()
tank_container = new(src)
tank_container.tag = "gas_tank_holder" tank_container.tag = "gas_tank_holder"
/obj/item/weapon/gun/launcher/pneumatic/verb/set_pressure() //set amount of tank pressure. /obj/item/weapon/gun/launcher/pneumatic/verb/set_pressure() //set amount of tank pressure.

View File

@@ -40,8 +40,8 @@
//------------------------------------------- //-------------------------------------------
/obj/vehicle/train/cargo/engine/New() /obj/vehicle/train/cargo/engine/New()
..() ..()
cell = new /obj/item/weapon/cell/high cell = new /obj/item/weapon/cell/high(src)
key = new() key = new(src)
var/image/I = new(icon = 'icons/obj/vehicles.dmi', icon_state = "cargo_engine_overlay", layer = src.layer + 0.2) //over mobs var/image/I = new(icon = 'icons/obj/vehicles.dmi', icon_state = "cargo_engine_overlay", layer = src.layer + 0.2) //over mobs
overlays += I overlays += I
turn_off() //so engine verbs are correctly set turn_off() //so engine verbs are correctly set