next new to init (#17400)

* next new to init

* .

* this needs thorough testing

* .

* needs an istype

* also vnotice

* mvoe to defines
This commit is contained in:
Kashargul
2025-03-24 06:18:39 -04:00
committed by GitHub
parent 8a4ac36d15
commit d3b7ba8b43
141 changed files with 529 additions and 601 deletions
+4 -4
View File
@@ -17,8 +17,8 @@
var/obj/item/projectile/BB = null //The loaded bullet - make it so that the projectiles are created only when needed?
var/caseless = null //Caseless ammo deletes its self once the projectile is fired.
/obj/item/ammo_casing/New()
..()
/obj/item/ammo_casing/Initialize(mapload)
. = ..()
if(ispath(projectile_type))
BB = new projectile_type(src)
randpixel_xy()
@@ -120,8 +120,8 @@
var/list/icon_keys = list() //keys
var/list/ammo_states = list() //values
/obj/item/ammo_magazine/New()
..()
/obj/item/ammo_magazine/Initialize(mapload)
. = ..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
if(multiple_sprites)
@@ -26,13 +26,13 @@
var/emagged = 0 // If you emag the smart mag, you can get the bullets out by clicking it
/obj/item/ammo_magazine/smart/New()
/obj/item/ammo_magazine/smart/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
..()
/obj/item/ammo_magazine/smart/Destroy()
STOP_PROCESSING(SSobj, src)
..()
. = ..()
/obj/item/ammo_magazine/smart/process()
if(!holding_gun) // Yes, this is awful, sorry. Don't know a better way to figure out if we've been moved into or out of a gun.
+8 -9
View File
@@ -9,19 +9,18 @@
var/do_rotation = TRUE
/obj/item/broken_gun/New(var/newloc, var/path)
..()
/obj/item/broken_gun/Initialize(mapload, path)
. = ..()
if(path)
if(!setup_gun(path))
qdel(src)
return
return INITIALIZE_HINT_QDEL
setup_repair_needs()
/obj/item/broken_gun/Initialize(mapload)
. = ..()
spawn(30 SECONDS)
if(!my_guntype && !QDELETED(src))
qdel(src)
addtimer(CALLBACK(src, PROC_REF(validate_gun_type)), 30 SECONDS, TIMER_DELETE_ME)
/obj/item/broken_gun/proc/validate_gun_type()
if(!my_guntype)
qdel(src)
/obj/item/broken_gun/examine(mob/user)
. = ..()
@@ -1,9 +1,9 @@
/obj/item/broken_gun/laserrifle/New(var/newloc)
..(newloc, /obj/item/gun/energy/laser/empty)
/obj/item/broken_gun/laserrifle/Initialize(mapload)
. = ..(mapload, /obj/item/gun/energy/laser/empty)
/obj/item/broken_gun/laser_retro/New(var/newloc)
..(newloc, /obj/item/gun/energy/retro/empty)
/obj/item/broken_gun/laser_retro/Initialize(mapload)
. = ..(mapload, /obj/item/gun/energy/retro/empty)
/obj/item/broken_gun/ionrifle/New(var/newloc)
..(newloc, /obj/item/gun/energy/ionrifle/empty)
/obj/item/broken_gun/ionrifle/Initialize(mapload)
. = ..(mapload, /obj/item/gun/energy/ionrifle/empty)
@@ -1,3 +1,3 @@
/obj/item/broken_gun/grenadelauncher/New(var/newloc)
..(newloc, /obj/item/gun/launcher/grenade)
/obj/item/broken_gun/grenadelauncher/Initialize(mapload)
. = ..(mapload, /obj/item/gun/launcher/grenade)
@@ -1,3 +1,3 @@
/obj/item/broken_gun/flechette/New(var/newloc)
..(newloc, /obj/item/gun/magnetic/railgun/flechette)
/obj/item/broken_gun/flechette/Initialize(mapload)
. = ..(mapload, /obj/item/gun/magnetic/railgun/flechette)
@@ -1,18 +1,18 @@
/obj/item/broken_gun/c20r/New(var/newloc)
..(newloc, /obj/item/gun/projectile/automatic/c20r/empty)
/obj/item/broken_gun/c20r/Initialize(mapload)
. = ..(mapload, /obj/item/gun/projectile/automatic/c20r/empty)
/obj/item/broken_gun/silenced45/New(var/newloc)
..(newloc, /obj/item/gun/projectile/silenced/empty)
/obj/item/broken_gun/silenced45/Initialize(mapload)
. = ..(mapload, /obj/item/gun/projectile/silenced/empty)
/obj/item/broken_gun/pumpshotgun/New(var/newloc)
..(newloc, /obj/item/gun/projectile/shotgun/pump/empty)
/obj/item/broken_gun/pumpshotgun/Initialize(mapload)
. = ..(mapload, /obj/item/gun/projectile/shotgun/pump/empty)
/obj/item/broken_gun/pumpshotgun_combat/New(var/newloc)
..(newloc, /obj/item/gun/projectile/shotgun/pump/combat/empty)
/obj/item/broken_gun/pumpshotgun_combat/Initialize(mapload)
. = ..(mapload, /obj/item/gun/projectile/shotgun/pump/combat/empty)
/obj/item/broken_gun/z8/New(var/newloc)
..(newloc, /obj/item/gun/projectile/automatic/z8/empty)
/obj/item/broken_gun/z8/Initialize(mapload)
. = ..(mapload, /obj/item/gun/projectile/automatic/z8/empty)
/obj/item/broken_gun/dartgun/New(var/newloc)
..(newloc, /obj/item/gun/projectile/dartgun)
/obj/item/broken_gun/dartgun/Initialize(mapload)
. = ..(mapload, /obj/item/gun/projectile/dartgun)
+2 -2
View File
@@ -126,8 +126,8 @@
update_icon()
//VOREStation Add End
/obj/item/gun/New()
..()
/obj/item/gun/Initialize(mapload)
. = ..()
for(var/i in 1 to firemodes.len)
firemodes[i] = new /datum/firemode(src, firemodes[i])
@@ -14,14 +14,12 @@
var/active = 0//Just tells us that it was clicked on so we should start shooting
var/delay_del = 0//Delays the del if we retarget without shooting
/obj/screen/auto_target/New(loc, var/obj/item/gun/G)
..()
gun = G
var/image/I = image('icons/effects/Targeted.dmi', src, "locked")
I.override = 1
usr << I
//autodel() //Currently doesn't really work right.
return
/obj/screen/auto_target/Initialize(mapload, var/obj/item/gun/G)
. = ..()
gun = G
var/image/I = image('icons/effects/Targeted.dmi', src, "locked")
I.override = 1
usr << I
/obj/screen/auto_target/CanPass()//Everything should ignore this guy and just pass by
return 1
+2 -2
View File
@@ -28,8 +28,8 @@
var/battery_lock = 0 //If set, weapon cannot switch batteries
var/random_start_ammo = FALSE //if TRUE, the weapon will spawn with randomly-determined ammo
/obj/item/gun/energy/New()
..()
/obj/item/gun/energy/Initialize(mapload)
. = ..()
if(self_recharge)
power_supply = new /obj/item/cell/device/weapon(src)
START_PROCESSING(SSobj, src)
@@ -246,8 +246,8 @@
max_w_class = ITEMSIZE_NORMAL
can_hold = list(/obj/item/gun/projectile/cell_loaded,/obj/item/ammo_magazine/cell_mag,/obj/item/ammo_casing/microbattery)
/obj/item/storage/secure/briefcase/nsfw_pack_hybrid/New()
..()
/obj/item/storage/secure/briefcase/nsfw_pack_hybrid/Initialize(mapload)
. = ..()
new /obj/item/gun/projectile/cell_loaded(src)
new /obj/item/ammo_magazine/cell_mag/advanced(src)
new /obj/item/ammo_casing/microbattery/combat/stun(src)
@@ -268,8 +268,8 @@
max_w_class = ITEMSIZE_NORMAL
can_hold = list(/obj/item/gun/projectile/cell_loaded,/obj/item/ammo_magazine/cell_mag,/obj/item/ammo_casing/microbattery)
/obj/item/storage/secure/briefcase/nsfw_pack_hybrid_combat/New()
..()
/obj/item/storage/secure/briefcase/nsfw_pack_hybrid_combat/Initialize(mapload)
. = ..()
new /obj/item/gun/projectile/cell_loaded(src)
new /obj/item/ammo_magazine/cell_mag/advanced(src)
new /obj/item/ammo_casing/microbattery/combat/shotstun(src)
@@ -50,8 +50,8 @@
max_w_class = ITEMSIZE_NORMAL
can_hold = list(/obj/item/gun/projectile/cell_loaded/medical,/obj/item/ammo_magazine/cell_mag/medical,/obj/item/ammo_casing/microbattery/medical)
/obj/item/storage/secure/briefcase/ml3m_pack_med/New()
..()
/obj/item/storage/secure/briefcase/ml3m_pack_med/Initialize(mapload)
. = ..()
new /obj/item/gun/projectile/cell_loaded/medical(src)
new /obj/item/ammo_magazine/cell_mag/medical(src)
new /obj/item/ammo_casing/microbattery/medical/brute(src)
@@ -66,8 +66,8 @@
max_w_class = ITEMSIZE_NORMAL
can_hold = list(/obj/item/gun/projectile/cell_loaded/medical,/obj/item/ammo_magazine/cell_mag/medical,/obj/item/ammo_casing/microbattery/medical)
/obj/item/storage/secure/briefcase/ml3m_pack_cmo/New()
..()
/obj/item/storage/secure/briefcase/ml3m_pack_cmo/Initialize(mapload)
. = ..()
new /obj/item/gun/projectile/cell_loaded/medical/cmo(src)
new /obj/item/ammo_magazine/cell_mag/medical(src)
new /obj/item/ammo_casing/microbattery/medical/brute(src)
@@ -48,8 +48,8 @@
max_w_class = ITEMSIZE_NORMAL
can_hold = list(/obj/item/gun/projectile/cell_loaded/combat,/obj/item/ammo_magazine/cell_mag/combat,/obj/item/ammo_casing/microbattery/combat)
/obj/item/storage/secure/briefcase/nsfw_pack/New()
..()
/obj/item/storage/secure/briefcase/nsfw_pack/Initialize(mapload)
. = ..()
new /obj/item/gun/projectile/cell_loaded/combat(src)
new /obj/item/ammo_magazine/cell_mag/combat(src)
for(var/path in subtypesof(/obj/item/ammo_casing/microbattery/combat))
@@ -62,8 +62,8 @@
max_w_class = ITEMSIZE_NORMAL
can_hold = list(/obj/item/gun/projectile/cell_loaded/combat,/obj/item/ammo_magazine/cell_mag/combat,/obj/item/ammo_casing/microbattery/combat)
/obj/item/storage/secure/briefcase/nsfw_pack_hos/New()
..()
/obj/item/storage/secure/briefcase/nsfw_pack_hos/Initialize(mapload)
. = ..()
new /obj/item/gun/projectile/cell_loaded/combat(src)
new /obj/item/ammo_magazine/cell_mag/combat(src)
new /obj/item/ammo_casing/microbattery/combat/lethal(src)
@@ -20,8 +20,8 @@
var/force_divisor = 400 // Force equates to speed. Speed/5 equates to a damage multiplier for whoever you hit.
// For reference, a fully pressurized oxy tank at 50% gas release firing a health
// analyzer with a force_divisor of 10 hit with a damage multiplier of 3000+.
/obj/item/gun/launcher/pneumatic/New()
..()
/obj/item/gun/launcher/pneumatic/Initialize(mapload)
. = ..()
item_storage = new(src)
item_storage.name = "hopper"
item_storage.max_w_class = max_w_class
@@ -303,7 +303,7 @@
return new projectile_type(src)
/obj/item/gun/magnetic/fuelrod/New()
/obj/item/gun/magnetic/fuelrod/Initialize(mapload)
cell = new /obj/item/cell/high
capacitor = new /obj/item/stock_parts/capacitor
. = ..()
@@ -28,8 +28,8 @@
//Excessively long because it won't accept subtypes for some reason!
/obj/item/gun/energy/modular/New() //Initialize our components.
..()
/obj/item/gun/energy/modular/Initialize(mapload)
. = ..()
guncomponents = list()
guncomponents += new /obj/item/stock_parts/capacitor
guncomponents += new /obj/item/stock_parts/micro_laser
+2 -2
View File
@@ -33,8 +33,8 @@
var/random_start_ammo = FALSE //randomize amount of starting ammo
/obj/item/gun/projectile/New(loc, var/starts_loaded = 1)
..()
/obj/item/gun/projectile/Initialize(mapload, var/starts_loaded = 1)
. = ..()
if(starts_loaded)
if(ispath(ammo_type) && (load_method & (SINGLE_CASING|SPEEDLOADER)))
for(var/i in 1 to max_shells)
@@ -214,8 +214,8 @@
var/use_launcher = 0
var/obj/item/gun/launcher/grenade/underslung/launcher
/obj/item/gun/projectile/automatic/z8/New()
..()
/obj/item/gun/projectile/automatic/z8/Initialize(mapload)
. = ..()
launcher = new(src)
/obj/item/gun/projectile/automatic/z8/attackby(obj/item/I, mob/user)
@@ -7,7 +7,8 @@
muzzle_type = null
/obj/item/projectile/bullet/chemdart/New()
/obj/item/projectile/bullet/chemdart/Initialize(mapload)
. = ..()
reagents = new/datum/reagents(reagent_amount)
reagents.my_atom = src
@@ -69,8 +70,8 @@
var/container_type = /obj/item/reagent_containers/glass/beaker
var/list/starting_chems = null
/obj/item/gun/projectile/dartgun/New()
..()
/obj/item/gun/projectile/dartgun/Initialize(mapload)
. = ..()
if(starting_chems)
for(var/chem in starting_chems)
var/obj/B = new container_type(src)
@@ -351,13 +351,13 @@
/obj/item/ammo_casing/a545 = "5.45mm"
)
/obj/item/gun/projectile/pirate/New()
/obj/item/gun/projectile/pirate/Initialize(mapload)
ammo_type = pick(ammo_types)
desc += " Uses [ammo_types[ammo_type]] rounds."
var/obj/item/ammo_casing/ammo = ammo_type
caliber = initial(ammo.caliber)
..()
. = ..()
/*
* Derringer
@@ -239,10 +239,10 @@
var/list/tertiary_loaded = list()
/obj/item/gun/projectile/revolver/lemat/New()
/obj/item/gun/projectile/revolver/lemat/Initialize(mapload)
. = ..()
for(var/i in 1 to secondary_max_shells)
secondary_loaded += new secondary_ammo_type(src)
..()
/obj/item/gun/projectile/revolver/lemat/verb/swap_firingmode()
set name = "Swap Firing Mode"
@@ -49,24 +49,24 @@
name = "AM rifle barrel"
icon_state = "heavysniper-barrel"
/obj/item/sniper_rifle_part/barrel/New()
..()
/obj/item/sniper_rifle_part/barrel/Initialize(mapload)
. = ..()
barrel = src
/obj/item/sniper_rifle_part/stock
name = "AM rifle stock"
icon_state = "heavysniper-stock"
/obj/item/sniper_rifle_part/stock/New()
..()
/obj/item/sniper_rifle_part/stock/Initialize(mapload)
. = ..()
stock = src
/obj/item/sniper_rifle_part/trigger_group
name = "AM rifle trigger assembly"
icon_state = "heavysniper-trig"
/obj/item/sniper_rifle_part/trigger_group/New()
..()
/obj/item/sniper_rifle_part/trigger_group/Initialize(mapload)
. = ..()
trigger_group = src
/obj/item/sniper_rifle_part/attack_self(mob/user)
+3 -3
View File
@@ -18,14 +18,14 @@
fire_sound = 'sound/weapons/bladeslice.ogg'
fire_sound_text = "a strange noise"
/obj/item/gun/launcher/spikethrower/New()
..()
/obj/item/gun/launcher/spikethrower/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
last_regen = world.time
/obj/item/gun/launcher/spikethrower/Destroy()
STOP_PROCESSING(SSobj, src)
..()
. = ..()
/obj/item/gun/launcher/spikethrower/process()
if(spikes < max_spikes && world.time > last_regen + spike_gen_time)
+2 -2
View File
@@ -149,10 +149,10 @@
var/obj/item/ammo_casing/my_case = null
/obj/item/projectile/New()
/obj/item/projectile/Initialize(mapload)
. = ..()
if(istype(loc, /obj/item/ammo_casing))
my_case = loc
. = ..()
/obj/item/projectile/proc/Range()
range--
+2 -2
View File
@@ -14,11 +14,11 @@
/obj/item/projectile/energy/blob/splattering
splatter = TRUE
/obj/item/projectile/energy/blob/New()
/obj/item/projectile/energy/blob/Initialize(mapload)
. = ..()
if(splatter)
create_reagents(splatter_volume)
ready_chemicals()
..()
/obj/item/projectile/energy/blob/on_impact(var/atom/A)
if(splatter)
@@ -18,10 +18,12 @@
var/active = 0 // Is our owner intending to take hostages?
var/target_permissions = 0 // Permission bitflags.
/obj/aiming_overlay/New(var/newowner)
..()
owner = newowner
loc = null
/obj/aiming_overlay/Initialize(mapload)
. = ..()
owner = loc
if(!istype(owner))
return INITIALIZE_HINT_QDEL
moveToNullspace()
verbs.Cut()
/obj/aiming_overlay/proc/toggle_permission(var/perm)