Revert "Singletons + refactor of /datum/observ (#15487)" (#15515)

This commit is contained in:
Matt Atlas
2023-01-05 19:21:22 +01:00
committed by GitHub
parent 34b1bcd055
commit b1869884c1
506 changed files with 7214 additions and 7561 deletions

View File

@@ -16,7 +16,7 @@
var/obj/item/projectile/BB = null //The loaded bullet - make it so that the projectiles are created only when needed?
var/spent_icon = "s-casing-spent"
drop_sound = /singleton/sound_category/casing_drop_sound
drop_sound = /decl/sound_category/casing_drop_sound
pickup_sound = 'sound/items/pickup/ring.ogg'
var/reload_sound = 'sound/weapons/reload_bullet.ogg' //sound that plays when inserted into gun.
@@ -112,7 +112,7 @@
var/list/icon_keys = list() //keys
var/list/ammo_states = list() //values
var/insert_sound = /singleton/sound_category/metal_slide_reload //sound it plays when it gets inserted into a gun.
var/insert_sound = /decl/sound_category/metal_slide_reload //sound it plays when it gets inserted into a gun.
var/eject_sound = 'sound/weapons/magazine_eject.ogg'
/obj/item/ammo_magazine/Initialize()
@@ -153,7 +153,7 @@
to_chat(user, "<span class='notice'>You empty [src].</span>")
for(var/obj/item/ammo_casing/C in stored_ammo)
C.forceMove(user.loc)
playsound(C, /singleton/sound_category/casing_drop_sound, 50, FALSE)
playsound(C, /decl/sound_category/casing_drop_sound, 50, FALSE)
C.set_dir(pick(alldirs))
stored_ammo.Cut()
update_icon()

View File

@@ -3,7 +3,7 @@
name = "speed loader (.357)"
icon_state = "T38"
caliber = "357"
insert_sound = /singleton/sound_category/revolver_reload
insert_sound = /decl/sound_category/revolver_reload
ammo_type = /obj/item/ammo_casing/a357
matter = list(DEFAULT_WALL_MATERIAL = 1260)
max_ammo = 8
@@ -13,7 +13,7 @@
name = "speed loader (.454)"
icon_state = "a454"
caliber = "454"
insert_sound = /singleton/sound_category/revolver_reload
insert_sound = /decl/sound_category/revolver_reload
ammo_type = /obj/item/ammo_casing/a454
matter = list(DEFAULT_WALL_MATERIAL = 1260)
max_ammo = 7
@@ -23,7 +23,7 @@
name = "speed loader (.38)"
icon_state = "38"
caliber = "38"
insert_sound = /singleton/sound_category/revolver_reload
insert_sound = /decl/sound_category/revolver_reload
matter = list(DEFAULT_WALL_MATERIAL = 360)
ammo_type = /obj/item/ammo_casing/c38
max_ammo = 6
@@ -188,7 +188,7 @@
origin_tech = list(TECH_COMBAT = 2)
matter = list(DEFAULT_WALL_MATERIAL = 1800)
caliber = "9mm"
insert_sound = /singleton/sound_category/polymer_slide_reload
insert_sound = /decl/sound_category/polymer_slide_reload
ammo_type = /obj/item/ammo_casing/c9mm
max_ammo = 30
@@ -202,7 +202,7 @@
ammo_type = /obj/item/ammo_casing/c9mm
matter = list(DEFAULT_WALL_MATERIAL = 1200)
caliber = "9mm"
insert_sound = /singleton/sound_category/polymer_slide_reload
insert_sound = /decl/sound_category/polymer_slide_reload
max_ammo = 20
multiple_sprites = 1
@@ -235,7 +235,7 @@
origin_tech = list(TECH_COMBAT = 2)
mag_type = MAGAZINE
caliber = "10mm"
insert_sound = /singleton/sound_category/polymer_slide_reload
insert_sound = /decl/sound_category/polymer_slide_reload
matter = list(DEFAULT_WALL_MATERIAL = 1500)
ammo_type = /obj/item/ammo_casing/c10mm
max_ammo = 20
@@ -252,7 +252,7 @@
matter = list(DEFAULT_WALL_MATERIAL = 1200)
caliber = ".45"
max_ammo = 16
insert_sound = /singleton/sound_category/polymer_slide_reload
insert_sound = /decl/sound_category/polymer_slide_reload
multiple_sprites = 1
/obj/item/ammo_magazine/c45uzi/empty
@@ -265,7 +265,7 @@
ammo_type = /obj/item/ammo_casing/c45
matter = list(DEFAULT_WALL_MATERIAL = 1500)
caliber = ".45"
insert_sound = /singleton/sound_category/polymer_slide_reload
insert_sound = /decl/sound_category/polymer_slide_reload
max_ammo = 20
/obj/item/ammo_magazine/submachinemag/empty
@@ -279,7 +279,7 @@
ammo_type = /obj/item/ammo_casing/c45
matter = list(DEFAULT_WALL_MATERIAL = 3750)
caliber = ".45"
insert_sound = /singleton/sound_category/polymer_slide_reload
insert_sound = /decl/sound_category/polymer_slide_reload
max_ammo = 50
// End of SMGs and PDWs //
@@ -291,7 +291,7 @@
origin_tech = list(TECH_COMBAT = 2)
mag_type = MAGAZINE
caliber = "a556"
insert_sound = /singleton/sound_category/rifle_slide_reload
insert_sound = /decl/sound_category/rifle_slide_reload
matter = list(DEFAULT_WALL_MATERIAL = 1800)
ammo_type = /obj/item/ammo_casing/a556
max_ammo = 30
@@ -361,7 +361,7 @@
icon_state = "75"
mag_type = MAGAZINE
caliber = "75"
insert_sound = /singleton/sound_category/rifle_slide_reload
insert_sound = /decl/sound_category/rifle_slide_reload
ammo_type = /obj/item/ammo_casing/a75
multiple_sprites = 1
max_ammo = 4
@@ -388,7 +388,7 @@
origin_tech = list(TECH_COMBAT = 2)
mag_type = MAGAZINE
caliber = "a762"
insert_sound = /singleton/sound_category/rifle_slide_reload
insert_sound = /decl/sound_category/rifle_slide_reload
matter = list(DEFAULT_WALL_MATERIAL = 4500)
ammo_type = /obj/item/ammo_casing/a762
max_ammo = 50
@@ -402,7 +402,7 @@
icon_state = "c762"
mag_type = MAGAZINE
caliber = "a762"
insert_sound = /singleton/sound_category/rifle_slide_reload
insert_sound = /decl/sound_category/rifle_slide_reload
matter = list(DEFAULT_WALL_MATERIAL = 1800)
ammo_type = /obj/item/ammo_casing/a762
max_ammo = 20
@@ -450,7 +450,7 @@
icon_state = "flechette"
mag_type = MAGAZINE
caliber = "flechette"
insert_sound = /singleton/sound_category/rifle_slide_reload
insert_sound = /decl/sound_category/rifle_slide_reload
matter = list(DEFAULT_WALL_MATERIAL = 1200)
ammo_type = /obj/item/ammo_casing/flechette
max_ammo = 40
@@ -478,7 +478,7 @@
name = "magazine (slug)"
icon_state = "csmb"
caliber = "shotgun"
insert_sound = /singleton/sound_category/rifle_slide_reload
insert_sound = /decl/sound_category/rifle_slide_reload
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/shotgun
max_ammo = 8

View File

@@ -107,8 +107,8 @@
caliber = "shotgun"
projectile_type = /obj/item/projectile/bullet/shotgun
matter = list(DEFAULT_WALL_MATERIAL = 360)
reload_sound = /singleton/sound_category/shotgun_reload
drop_sound = /singleton/sound_category/casing_drop_sound_shotgun
reload_sound = /decl/sound_category/shotgun_reload
drop_sound = /decl/sound_category/casing_drop_sound_shotgun
/obj/item/ammo_casing/shotgun/used/Initialize()
. = ..()
@@ -358,7 +358,7 @@
slot_flags = null
max_stack = 1
reload_sound = 'sound/weapons/reloads/shotgun_pump.ogg'
drop_sound = /singleton/sound_category/generic_drop_sound
drop_sound = /decl/sound_category/generic_drop_sound
/obj/item/ammo_casing/cannon/explosive
name = "explosive cannonball"
@@ -379,7 +379,7 @@
slot_flags = null
desc = "A miniaturized version of a nuclear bomb."
projectile_type = /obj/item/projectile/bullet/nuke
drop_sound = /singleton/sound_category/generic_drop_sound
drop_sound = /decl/sound_category/generic_drop_sound
max_stack = 2
/obj/item/ammo_casing/musket

View File

@@ -83,8 +83,8 @@
var/displays_maptext = FALSE
var/can_ammo_display = TRUE
var/obj/item/ammo_display
var/empty_sound = /singleton/sound_category/out_of_ammo
var/casing_drop_sound = /singleton/sound_category/casing_drop_sound
var/empty_sound = /decl/sound_category/out_of_ammo
var/casing_drop_sound = /decl/sound_category/casing_drop_sound
maptext_x = 22
maptext_y = 2
@@ -109,7 +109,7 @@
var/wielded = 0
var/needspin = TRUE
var/is_wieldable = FALSE
var/wield_sound = /singleton/sound_category/generic_wield_sound
var/wield_sound = /decl/sound_category/generic_wield_sound
var/unwield_sound = null
var/one_hand_fa_penalty = 0 // Additional accuracy/dispersion penalty for using full auto one-handed

View File

@@ -24,7 +24,7 @@
origin_tech = list(TECH_MATERIAL = 2, TECH_BIO = 3, TECH_POWER = 3)
modifystate = "floramut"
self_recharge = 1
var/singleton/plantgene/gene = null
var/decl/plantgene/gene = null
firemodes = list(
list(mode_name="induce mutations", projectile_type=/obj/item/projectile/energy/floramut, modifystate="floramut"),

View File

@@ -11,7 +11,7 @@
sharp = TRUE
edge = FALSE
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = /singleton/sound_category/sword_pickup_sound
pickup_sound = /decl/sound_category/sword_pickup_sound
/obj/item/arrow/proc/removed() //Helper for metal rods falling apart.
return
@@ -27,7 +27,7 @@
icon_state = "metal-rod"
item_state = "bolt"
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = /singleton/sound_category/sword_pickup_sound
pickup_sound = /decl/sound_category/sword_pickup_sound
/obj/item/arrow/quill
name = "alien quill"

View File

@@ -51,7 +51,7 @@
var/mob/living/L = hit_atom
//unfortuately we don't know where the dart will actually hit, since that's done by the parent.
if(L.can_inject() && syringe.reagents)
var/singleton/reagent/reagent_log = syringe.reagents.get_reagents()
var/decl/reagent/reagent_log = syringe.reagents.get_reagents()
syringe.reagents.trans_to_mob(L, 15, CHEM_BLOOD)
admin_inject_log(thrower, L, src, reagent_log, syringe.reagents.get_temperature(), 15, violent=1)

View File

@@ -112,7 +112,7 @@
if(EJECT_CASINGS) //eject casing onto ground.
chambered.forceMove(get_turf(src))
chambered.throw_at(get_ranged_target_turf(get_turf(src),turn(loc.dir,270),1), rand(0,1), 5)
playsound(chambered, /singleton/sound_category/casing_drop_sound, 50, FALSE)
playsound(chambered, /decl/sound_category/casing_drop_sound, 50, FALSE)
if(CYCLE_CASINGS) //cycle the casing back to the end.
if(ammo_magazine)
ammo_magazine.stored_ammo += chambered
@@ -197,7 +197,7 @@
if(T)
for(var/obj/item/ammo_casing/C in loaded)
C.forceMove(T)
playsound(C, /singleton/sound_category/casing_drop_sound, 50, FALSE)
playsound(C, /decl/sound_category/casing_drop_sound, 50, FALSE)
count++
loaded.Cut()
if(count)

View File

@@ -126,7 +126,7 @@
slot_flags = SLOT_BACK
load_method = MAGAZINE
fire_sound = 'sound/weapons/gunshot/gunshot_rifle.ogg'
empty_sound = /singleton/sound_category/out_of_ammo_rifle
empty_sound = /decl/sound_category/out_of_ammo_rifle
magazine_type = /obj/item/ammo_magazine/c762
allowed_magazines = list(/obj/item/ammo_magazine/c762)

View File

@@ -102,7 +102,7 @@
to_chat(user, "<span class='notice'>[src] contains:</span>")
for(var/obj/item/reagent_containers/glass/beaker/B in beakers)
for(var/_R in B.reagents.reagent_volumes)
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
to_chat(user, "<span class='notice'>[B.reagents.reagent_volumes[_R]] units of [R.name]</span>")
/obj/item/gun/projectile/dartgun/attackby(obj/item/I as obj, mob/user as mob)
@@ -138,7 +138,7 @@
dat += "Beaker [i] contains: "
if(LAZYLEN(B.reagents.reagent_volumes))
for(var/_R in B.reagents.reagent_volumes)
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
dat += "<br> [B.reagents.reagent_volumes[_R]] units of [R.name], "
if (check_beaker_mixing(B))
dat += text("<A href='?src=\ref[src];stop_mix=[i]'><font color='green'>Mixing</font></A> ")

View File

@@ -51,11 +51,11 @@
to_chat(user, SPAN_WARNING("\The [src] is already full of gunpowder."))
return
var/obj/item/reagent_containers/C = W
if(C.reagents.has_reagent(/singleton/reagent/gunpowder, 5))
if(C.reagents.has_reagent(/decl/reagent/gunpowder, 5))
if(do_after(user, 15))
if(has_powder)
return
C.reagents.remove_reagent(/singleton/reagent/gunpowder, 5)
C.reagents.remove_reagent(/decl/reagent/gunpowder, 5)
has_powder = TRUE
to_chat(user, SPAN_NOTICE("You fill \the [src] with gunpowder."))
@@ -69,4 +69,4 @@
amount_per_transfer_from_this = 5
possible_transfer_amounts = list(5)
volume = 30
reagents_to_add = list(/singleton/reagent/gunpowder = 30)
reagents_to_add = list(/decl/reagent/gunpowder = 30)

View File

@@ -13,7 +13,7 @@
ammo_type = /obj/item/ammo_casing/a357
magazine_type = /obj/item/ammo_magazine/a357
fire_sound = 'sound/weapons/gunshot/gunshot_revolver.ogg'
empty_sound = /singleton/sound_category/out_of_ammo_revolver
empty_sound = /decl/sound_category/out_of_ammo_revolver
var/chamber_offset = 0 //how many empty chambers in the cylinder until you hit a round
/obj/item/gun/projectile/revolver/verb/spin_cylinder()

View File

@@ -294,7 +294,7 @@
item_state = "gauss_thumper"
caliber = "gauss"
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2)
fire_sound = /singleton/sound_category/gauss_fire_sound
fire_sound = /decl/sound_category/gauss_fire_sound
load_method = MAGAZINE
handle_casings = DELETE_CASINGS
@@ -321,7 +321,7 @@
desc = "An outdated and power hungry gauss cannon, modified to deliver high explosive rounds at high velocities."
icon = 'icons/obj/guns/gauss_thumper.dmi'
icon_state = "gauss_thumper"
fire_sound = /singleton/sound_category/gauss_fire_sound
fire_sound = /decl/sound_category/gauss_fire_sound
fire_delay = 30
charge_meter = 0
max_shots = 3

View File

@@ -58,7 +58,7 @@
fire_sound = 'sound/weapons/gunshot/gunshot_shotgun2.ogg'
is_wieldable = TRUE
var/recentpump = 0 // to prevent spammage
var/rack_sound = /singleton/sound_category/shotgun_pump
var/rack_sound = /decl/sound_category/shotgun_pump
var/rack_verb = "pump"
/obj/item/gun/projectile/shotgun/pump/consume_next_projectile()

View File

@@ -208,7 +208,7 @@
if(!point_blank)
if(!silenced)
target_mob.visible_message("<span class='notice'>\The [src] misses [target_mob] narrowly!</span>")
playsound(target_mob, /singleton/sound_category/bulletflyby_sound, 50, 1)
playsound(target_mob, /decl/sound_category/bulletflyby_sound, 50, 1)
return FALSE
if(PROJECTILE_DODGED)
return FALSE

View File

@@ -289,14 +289,14 @@
if(blocked < 100 && !(blocked < 20))
L.emote("yawns")
if(blocked < 20)
if(L.reagents) L.reagents.add_reagent(/singleton/reagent/soporific, 10)
if(L.reagents) L.reagents.add_reagent(/decl/reagent/soporific, 10)
if(def_zone == BP_HEAD && blocked < 100)
if(L.reagents) L.reagents.add_reagent(/singleton/reagent/soporific, 15)
if(L.reagents) L.reagents.add_reagent(/decl/reagent/soporific, 15)
if(def_zone != "torso" && def_zone != BP_HEAD)
if(blocked < 100 && !(blocked < 20))
L.emote("yawns")
if(blocked < 20)
if(L.reagents) L.reagents.add_reagent(/singleton/reagent/soporific, 5)
if(L.reagents) L.reagents.add_reagent(/decl/reagent/soporific, 5)
if(isanimal(target))
target.visible_message("<b>[target]</b> twitches, foaming at the mouth.")

View File

@@ -146,7 +146,7 @@
damage = 0
damage_type = TOX
nodamage = TRUE
var/singleton/plantgene/gene = null
var/decl/plantgene/gene = null
/obj/item/projectile/energy/floramut/on_hit(var/atom/target, var/blocked = 0)
var/mob/living/M = target
@@ -265,7 +265,7 @@
/obj/item/projectile/magic/teleport/on_hit(var/atom/hit_atom)
var/turf/T = get_turf(hit_atom)
single_spark(T)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 50, 1)
if(isliving(hit_atom))
blink_mob(hit_atom)
return ..()