Sideports a couple of init unit tests from Neb.

This commit is contained in:
MistakeNot4892
2021-02-27 13:05:16 -05:00
committed by Unknown
parent db9968a3ff
commit 3e804dc799
132 changed files with 2133 additions and 248 deletions
+1 -1
View File
@@ -33,7 +33,7 @@
var/cell_type = /obj/item/weapon/cell/device
/obj/item/device/flash/Initialize()
..()
. = ..()
power_supply = new cell_type(src)
/obj/item/device/flash/attackby(var/obj/item/W, var/mob/user)
@@ -7,15 +7,12 @@
var/obj/item/stack/type_to_spawn = null
/obj/fiftyspawner/Initialize()
..() //We're not returning . because we're going to ask to be deleted.
..()
var/turf/T = get_turf(src)
var/obj/item/stack/M = new type_to_spawn(T)
var/obj/structure/closet/C = locate() in T
var/obj/item/stack/M = new type_to_spawn(C || T)
M.amount = M.max_amount //some stuff spawns with 60, we're still calling it fifty
M.update_icon() // Some stacks have different sprites depending on how full they are.
var/obj/structure/closet/C = locate() in T
if(C)
C.contents += M
return INITIALIZE_HINT_QDEL //Bye!
/obj/fiftyspawner/rods
+2 -2
View File
@@ -24,8 +24,8 @@
stacktype = /obj/item/stack/rods
no_variants = TRUE
/obj/item/stack/rods/New()
..()
/obj/item/stack/rods/Initialize()
. = ..()
recipes = rods_recipes
update_icon()
+6 -14
View File
@@ -32,19 +32,15 @@
bag_material = MAT_SYNCLOTH
/obj/item/stack/sandbags/New(var/newloc, var/amt, var/bag_mat)
..()
/obj/item/stack/sandbags/Initialize(var/ml, var/amt, var/bag_mat)
. = ..(ml, amt)
recipes = sandbag_recipes
update_icon()
if(bag_mat)
bag_material = bag_mat
var/datum/material/M = get_material_by_name("[bag_material]")
if(!M)
qdel(src)
return
return INITIALIZE_HINT_QDEL
color = M.icon_colour
/obj/item/stack/sandbags/update_icon()
@@ -136,17 +132,13 @@ var/global/list/datum/stack_recipe/sandbag_recipes = list( \
var/bag_material = "cloth"
/obj/item/stack/emptysandbag/New(var/newloc, var/amt, var/bag_mat)
..(newloc, amt)
/obj/item/stack/emptysandbag/Initialize(var/ml, var/amt, var/bag_mat)
. = ..(ml, amt)
if(bag_mat)
bag_material = bag_mat
var/datum/material/M = get_material_by_name("[bag_material]")
if(!M)
qdel(src)
return
return INITIALIZE_HINT_QDEL
color = M.icon_colour
/obj/item/stack/emptysandbag/attack_self(var/mob/user)
+4 -5
View File
@@ -29,14 +29,13 @@
var/pass_color = FALSE // Will the item pass its own color var to the created item? Dyed cloth, wood, etc.
var/strict_color_stacking = FALSE // Will the stack merge with other stacks that are different colors? (Dyed cloth, wood, etc)
/obj/item/stack/New(var/loc, var/amount=null)
..()
if (!stacktype)
/obj/item/stack/Initialize(var/ml, var/amount)
. = ..()
if(!stacktype)
stacktype = type
if (amount)
if(amount)
src.amount = amount
update_icon()
return
/obj/item/stack/Destroy()
if(uses_charge)
+1 -1
View File
@@ -7,7 +7,7 @@
w_class = ITEMSIZE_TINY
max_amount = 30
/obj/item/stack/arcadeticket/New(loc, amount = null)
/obj/item/stack/arcadeticket/Initialize()
. = ..()
update_icon()
@@ -20,8 +20,8 @@
drop_sound = 'sound/items/drop/axe.ogg'
pickup_sound = 'sound/items/pickup/axe.ogg'
/obj/item/stack/tile/New()
..()
/obj/item/stack/tile/Initialize()
. = ..()
randpixel_xy()
/*
@@ -77,14 +77,14 @@
//visible_message("[user] has smashed the snowball in their hand!", "You smash the snowball in your hand.")
to_chat(user, "<span class='notice'>You smash the snowball in your hand.</span>")
var/atom/S = new /obj/item/stack/material/snow(user.loc)
del(src)
qdel(src)
user.put_in_hands(S)
else
//visible_message("[user] starts compacting the snowball.", "You start compacting the snowball.")
to_chat(user, "<span class='notice'>You start compacting the snowball.</span>")
if(do_after(user, 2 SECONDS))
var/atom/S = new /obj/item/weapon/material/snow/snowball/reinforced(user.loc)
del(src)
qdel(src)
user.put_in_hands(S)
/obj/item/weapon/material/snow/snowball/reinforced
@@ -174,7 +174,7 @@
gauge_icon = "indicator_emergency"
/obj/item/weapon/tank/emergency/nitrogen/Initialize()
..()
. = ..()
src.air_contents.adjust_gas("nitrogen", (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/weapon/tank/emergency/nitrogen/double
@@ -671,7 +671,7 @@
always_process = TRUE
/obj/item/weapon/weldingtool/electric/mounted/exosuit/Initialize()
..()
. = ..()
if(istype(loc, /obj/item/mecha_parts/mecha_equipment))
equip_mount = loc