Replaces ammo_casing/caseless and bullet/reusable with elements. (#76335)

The reusable and caseless types only purposes are the behaviors of
deleting the casing when fired and spawning a new object when the
projectile ultimately reaches its maximum range or hits a target, both
of which are easily "elementizable". Also, I don't like those barely
filled sub-folders in the projectile module, and the fact we've
divergent reusable and single use arrow types.
This commit is contained in:
Ghom
2023-06-28 01:14:59 +00:00
committed by GitHub
parent 13ce8d6d40
commit 6b007f758b
41 changed files with 345 additions and 275 deletions
+1 -1
View File
@@ -352,6 +352,6 @@
overlay_state_active = "module_donk_safe_recycler"
complexity = 1
efficiency = 1
allowed_item_types = list(/obj/item/ammo_casing/caseless/foam_dart)
allowed_item_types = list(/obj/item/ammo_casing/foam_dart)
ammobox_type = /obj/item/ammo_box/foambox/mini
required_amount = SMALL_MATERIAL_AMOUNT*2.5
+10 -9
View File
@@ -533,7 +533,7 @@
. = ..()
if(!.)
return
var/obj/projectile/bomb = new /obj/projectile/bullet/reusable/mining_bomb(mod.wearer.loc)
var/obj/projectile/bomb = new /obj/projectile/bullet/mining_bomb(mod.wearer.loc)
bomb.preparePixelProjectile(target, mod.wearer)
bomb.firer = mod.wearer
playsound(src, 'sound/weapons/gun/general/grenade_launch.ogg', 75, TRUE)
@@ -553,7 +553,7 @@
return
on_deactivation()
/obj/projectile/bullet/reusable/mining_bomb
/obj/projectile/bullet/mining_bomb
name = "mining bomb"
desc = "A bomb. Why are you examining this?"
icon_state = "mine_bomb"
@@ -566,13 +566,15 @@
light_range = 1
light_power = 1
light_color = COLOR_LIGHT_ORANGE
ammo_type = /obj/structure/mining_bomb
/obj/projectile/bullet/reusable/mining_bomb/handle_drop()
if(dropped)
return
dropped = TRUE
new ammo_type(get_turf(src), firer)
/obj/projectile/bullet/mining_bomb/Initialize(mapload)
. = ..()
AddElement(/datum/element/projectile_drop, /obj/structure/mining_bomb)
RegisterSignal(src, COMSIG_PROJECTILE_ON_SPAWN_DROP, PROC_REF(handle_drop))
/obj/projectile/bullet/mining_bomb/proc/handle_drop(datum/source, obj/structure/mining_bomb/mining_bomb)
SIGNAL_HANDLER
addtimer(CALLBACK(mining_bomb, TYPE_PROC_REF(/obj/structure/mining_bomb, prime), firer), mining_bomb.prime_time)
/obj/structure/mining_bomb
name = "mining bomb"
@@ -599,7 +601,6 @@
/obj/structure/mining_bomb/Initialize(mapload, atom/movable/firer)
. = ..()
generate_image()
addtimer(CALLBACK(src, PROC_REF(prime), firer), prime_time)
/obj/structure/mining_bomb/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents)
if(same_z_layer)