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
+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")