Make every obj/.../New() call it's parents

This commit is contained in:
joep van der velden
2020-01-29 10:43:32 +01:00
parent 076ef673cd
commit fd913498bf
39 changed files with 77 additions and 32 deletions
@@ -326,6 +326,7 @@
on = TRUE //Bio-luminesence has one setting, on.
/obj/item/flashlight/slime/New()
..()
set_light(brightness_on)
spawn(1) //Might be sloppy, but seems to be necessary to prevent further runtimes and make these work as intended... don't judge me!
update_brightness()
@@ -9,6 +9,7 @@
var/datum/nano_module/crew_monitor/crew_monitor
/obj/item/sensor_device/New()
..()
crew_monitor = new(src)
/obj/item/sensor_device/Destroy()
@@ -15,11 +15,14 @@
var/obj/item/tape/mytape
var/open_panel = 0
var/canprint = 1
var/starts_with_tape = TRUE
/obj/item/taperecorder/New()
mytape = new /obj/item/tape/random(src)
update_icon()
..()
if(starts_with_tape)
mytape = new /obj/item/tape/random(src)
update_icon()
/obj/item/taperecorder/Destroy()
QDEL_NULL(mytape)
@@ -243,8 +246,8 @@
canprint = 1
//empty tape recorders
/obj/item/taperecorder/empty/New()
return
/obj/item/taperecorder/empty
starts_with_tape = FALSE
/obj/item/tape
@@ -317,4 +320,5 @@
//Random colour tapes
/obj/item/tape/random/New()
..()
icon_state = "tape_[pick("white", "blue", "red", "yellow", "purple")]"
@@ -10,6 +10,7 @@
var/datum/effect_system/spark_spread/spark_system
/obj/item/thermal_drill/New()
..()
soundloop = new(list(src), FALSE)
spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(1, 0, src)
@@ -316,6 +316,7 @@ var/list/world_uplinks = list()
// implant uplink (not the implant tool) and a preset headset uplink.
/obj/item/radio/uplink/New()
..()
hidden_uplink = new(src)
icon_state = "radio"
@@ -339,6 +340,7 @@ var/list/world_uplinks = list()
hidden_uplink.uplink_type = "sst"
/obj/item/multitool/uplink/New()
..()
hidden_uplink = new(src)
/obj/item/multitool/uplink/attack_self(mob/user as mob)
+2
View File
@@ -38,6 +38,7 @@
item_state = "balloon-empty"
/obj/item/toy/balloon/New()
..()
create_reagents(10)
/obj/item/toy/balloon/attack(mob/living/carbon/human/M as mob, mob/user as mob)
@@ -799,6 +800,7 @@ obj/item/toy/cards/deck/syndicate/black
resistance_flags = FLAMMABLE
/obj/item/toy/therapy/New()
..()
if(item_color)
name = "[item_color] therapy doll"
desc += " This one is [item_color]."
+1 -1
View File
@@ -18,6 +18,7 @@ RSF
var/list/configured_items = list()
/obj/item/rsf/New()
..()
desc = "A RSF. It currently holds [matter]/30 fabrication-units."
// configured_items[ID_NUMBER] = list("Human-readable name", price in energy, /type/path)
configured_items[++configured_items.len] = list("Dosh", 50, /obj/item/stack/spacecash/c10)
@@ -30,7 +31,6 @@ RSF
configured_items[++configured_items.len] = list("Snack - Donut", 4000, /obj/item/reagent_containers/food/snacks/donut)
configured_items[++configured_items.len] = list("Snack - Chicken Soup", 4000, /obj/item/reagent_containers/food/drinks/chicken_soup)
configured_items[++configured_items.len] = list("Snack - Turkey Burger", 4000, /obj/item/reagent_containers/food/snacks/tofuburger)
return
/obj/item/rsf/attackby(obj/item/W as obj, mob/user as mob, params)
..()
@@ -681,6 +681,7 @@
/obj/item/card/id/prisoner/random
/obj/item/card/id/prisoner/random/New()
..()
var/random_number = "#[rand(0, 99)]-[rand(0, 999)]"
name = "Prisoner [random_number]"
registered_name = name
@@ -48,6 +48,7 @@
name = "lipstick"
/obj/item/lipstick/random/New()
..()
var/lscolor = pick(lipstick_colors)//A random color is picked from the var defined initially in a new var.
colour = lipstick_colors[lscolor]//The color of the lipstick is pulled from the new variable (right hand side, HTML & Hex RGB)
name = "[lscolor] lipstick"//The new variable is also used to match the name to the color of the lipstick. Kudos to Desolate & Lemon
@@ -46,6 +46,7 @@
/obj/item/extinguisher/New()
..()
create_reagents(max_water)
reagents.add_reagent("water", max_water)
@@ -26,6 +26,7 @@
var/cores = "" // Also for logging
/obj/item/grenade/chem_grenade/New()
..()
create_reagents(1000)
if(payload_name)
payload_name += " " // formatting, ignore me
@@ -47,4 +47,5 @@
hitsound = 'sound/weapons/pierce.ogg'
/obj/item/embedded/shrapnel/New()
..()
icon_state = pick("shrapnel1", "shrapnel2", "shrapnel3")
@@ -556,6 +556,7 @@
var/faith = 99 //a conversion requires 100 faith to attempt. faith recharges over time while you are wearing missionary robes that have been linked to the staff.
/obj/item/nullrod/missionary_staff/New()
..()
team_color = pick("red", "blue")
icon_state = "godstaff-[team_color]"
item_state = "godstaff-[team_color]"
+1 -1
View File
@@ -36,11 +36,11 @@
var/max_contents = 1
/obj/item/kitchen/utensil/New()
..()
if(prob(60))
src.pixel_y = rand(0, 4)
create_reagents(5)
return
/obj/item/kitchen/utensil/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!istype(M))
+5 -4
View File
@@ -26,10 +26,11 @@
icon_off = "zippo"
/obj/item/lighter/random/New()
var/color = pick("r","c","y","g")
icon_on = "lighter-[color]-on"
icon_off = "lighter-[color]"
icon_state = icon_off
..()
var/color = pick("r","c","y","g")
icon_on = "lighter-[color]-on"
icon_off = "lighter-[color]"
icon_state = icon_off
/obj/item/lighter/attack_self(mob/living/user)
if(user.r_hand == src || user.l_hand == src || isrobot(user))
@@ -119,6 +119,7 @@
var/hacked = 0
/obj/item/melee/energy/sword/New()
..()
if(item_color == null)
item_color = pick("red", "blue", "green", "purple")
@@ -220,7 +221,7 @@
light_color = LIGHT_COLOR_RED
/obj/item/melee/energy/sword/pirate/New()
return
..()
/obj/item/melee/energy/blade
name = "energy blade"
+2 -1
View File
@@ -90,7 +90,8 @@
desc = "test lightning"
/obj/item/lightning/New()
icon_state = "1"
..()
icon_state = "1"
/obj/item/lightning/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
var/angle = get_angle(A, user)
@@ -68,6 +68,7 @@
usesound = 'sound/items/deconstruct.ogg'
/obj/item/stock_parts/New()
..()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
@@ -63,7 +63,6 @@
/obj/item/storage/backpack/holding/New()
..()
return
/obj/item/storage/backpack/holding/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/storage/backpack/holding))
@@ -1099,6 +1099,7 @@
desc = "Contains a variety of deluxe stock parts."
/obj/item/storage/box/stockparts/deluxe/New()
..()
for(var/i in 1 to 3)
new /obj/item/stock_parts/capacitor/quadratic(src)
new /obj/item/stock_parts/scanning_module/triphasic(src)
@@ -240,6 +240,7 @@
var/colormap = list(red=LIGHT_COLOR_RED, blue=LIGHT_COLOR_LIGHTBLUE, green=LIGHT_COLOR_GREEN, purple=LIGHT_COLOR_PURPLE, rainbow=LIGHT_COLOR_WHITE)
/obj/item/twohanded/dualsaber/New()
..()
if(!blade_color)
blade_color = pick("red", "blue", "green", "purple")