From a1ea7f13dbaf07babeb54bb9fc584aecc680199b Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 4 Jul 2023 15:06:52 +0200 Subject: [PATCH] [MIRROR] Replaces ammo_casing/caseless and bullet/reusable with elements. [MDB IGNORE] (#22102) * Replaces ammo_casing/caseless and bullet/reusable with elements. * stupid --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> Co-authored-by: Jolly-66 <70232195+Jolly-66@users.noreply.github.com> --- _maps/map_files/MetaStation/MetaStation.dmm | 2 +- code/__DEFINES/dcs/signals/signals_object.dm | 5 +- code/datums/components/pellet_cloud.dm | 10 +-- code/datums/elements/caseless.dm | 30 +++++++ code/datums/elements/projectile_drop.dm | 20 +++++ code/datums/storage/subtypes/pockets.dm | 4 +- code/game/objects/items/cardboard_cutouts.dm | 2 +- code/game/objects/items/robot/items/food.dm | 81 ++++++++++--------- code/game/objects/items/shooting_range.dm | 2 +- code/game/objects/items/storage/bags.dm | 4 +- code/game/objects/items/toys.dm | 6 +- .../modules/capture_the_flag/ctf_equipment.dm | 70 ++++++++-------- code/modules/mod/modules/modules_maint.dm | 2 +- code/modules/mod/modules/modules_supply.dm | 19 ++--- .../modules/projectiles/ammunition/_firing.dm | 14 ++-- .../{caseless => ballistic}/foam.dm | 24 +++--- .../ammunition/ballistic/harpoon.dm | 14 ++++ .../{caseless => ballistic}/rocket.dm | 27 ++++++- .../ammunition/caseless/_caseless.dm | 18 ----- .../projectiles/ammunition/caseless/energy.dm | 9 --- .../ammunition/caseless/harpoon.dm | 5 -- .../projectiles/ammunition/energy/laser.dm | 20 +++++ .../projectiles/boxes_magazines/ammo_boxes.dm | 4 +- .../boxes_magazines/external/grenade.dm | 2 +- .../boxes_magazines/external/rechargable.dm | 2 +- .../boxes_magazines/external/toy.dm | 16 ++-- .../boxes_magazines/internal/grenade.dm | 2 +- .../boxes_magazines/internal/rifle.dm | 2 +- .../boxes_magazines/internal/toy.dm | 2 +- .../projectiles/guns/ballistic/bows/_bow.dm | 4 +- .../guns/ballistic/bows/bow_arrows.dm | 29 +++---- .../guns/ballistic/bows/bow_quivers.dm | 8 +- .../guns/ballistic/bows/bow_types.dm | 2 +- .../{reusable => bullets}/foam_dart.dm | 23 +++--- .../projectile/reusable/_reusable.dm | 22 ----- .../reagent_containers/cups/glassbottle.dm | 16 ++-- code/modules/religion/pyre_rites.dm | 10 +-- .../designs/autolathe/security_designs.dm | 2 +- code/modules/uplink/uplink_items/nukeops.dm | 4 +- .../mob/living/simple_animal/friendly/dogs.dm | 2 +- .../reagent_forging/code/forge_weapons.dm | 12 +-- .../code/ammo/caseless/arrow.dm | 12 +-- .../code/ammo/reusable/arrow.dm | 16 ++-- .../modules/tribal_extended/code/recipes.dm | 12 +-- .../research/xenoarch/xenoarch_reward.dm | 2 +- tgstation.dme | 13 ++- .../Scripts/76335_remove_caseless.txt | 3 + 47 files changed, 340 insertions(+), 270 deletions(-) create mode 100644 code/datums/elements/caseless.dm create mode 100644 code/datums/elements/projectile_drop.dm rename code/modules/projectiles/ammunition/{caseless => ballistic}/foam.dm (72%) create mode 100644 code/modules/projectiles/ammunition/ballistic/harpoon.dm rename code/modules/projectiles/ammunition/{caseless => ballistic}/rocket.dm (54%) delete mode 100644 code/modules/projectiles/ammunition/caseless/_caseless.dm delete mode 100644 code/modules/projectiles/ammunition/caseless/energy.dm delete mode 100644 code/modules/projectiles/ammunition/caseless/harpoon.dm rename code/modules/projectiles/projectile/{reusable => bullets}/foam_dart.dm (54%) delete mode 100644 code/modules/projectiles/projectile/reusable/_reusable.dm create mode 100644 tools/UpdatePaths/Scripts/76335_remove_caseless.txt diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 9b28d8effa1..78b7875fb46 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -3634,7 +3634,7 @@ pixel_x = -3; pixel_y = 10 }, -/obj/item/ammo_casing/caseless/rocket{ +/obj/item/ammo_casing/rocket{ desc = "Your grandpappy brought this home after the war. You're pretty sure it's a dud."; name = "Dud Rocket"; pixel_x = -4; diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index 180f3145320..3418dfcb119 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -356,7 +356,10 @@ #define COMSIG_ITEM_EMBEDDING_UPDATE "item_embedding_update" ///sent to targets during the process_hit proc of projectiles -#define COMSIG_PELLET_CLOUD_INIT "pellet_cloud_init" +#define COMSIG_FIRE_CASING "fire_casing" + +///sent to the projectile after an item is spawned by the projectile_drop element: (new_casing) +#define COMSIG_PROJECTILE_ON_SPAWN_DROP "projectile_on_spawn_drop" // /obj/vehicle/sealed/car/vim signals diff --git a/code/datums/components/pellet_cloud.dm b/code/datums/components/pellet_cloud.dm index 1f90f148247..40381df8e86 100644 --- a/code/datums/components/pellet_cloud.dm +++ b/code/datums/components/pellet_cloud.dm @@ -10,7 +10,7 @@ * * Pellet cloud currently works on two classes of sources: directed (ammo casings), and circular (grenades, landmines). * -Directed: This means you're shooting multiple pellets, like buckshot. If an ammo casing is defined as having multiple pellets, it will automatically create a pellet cloud - * and call COMSIG_PELLET_CLOUD_INIT (see [/obj/item/ammo_casing/proc/fire_casing]). Thus, the only projectiles fired will be the ones fired here. + * and call COMSIG_FIRE_CASING (see [/obj/item/ammo_casing/proc/fire_casing]). Thus, the only projectiles fired will be the ones fired here. * The magnitude var controls how many pellets are created. * -Circular: This results in a big spray of shrapnel flying all around the detonation point when the grenade fires COMSIG_GRENADE_DETONATE or landmine triggers COMSIG_MINE_TRIGGERED. * The magnitude var controls how big the detonation radius is (the bigger the magnitude, the more shrapnel is created). Grenades can be covered with bodies to reduce shrapnel output. @@ -80,7 +80,7 @@ /datum/component/pellet_cloud/RegisterWithParent() RegisterSignal(parent, COMSIG_PREQDELETED, PROC_REF(nullspace_parent)) if(isammocasing(parent)) - RegisterSignal(parent, COMSIG_PELLET_CLOUD_INIT, PROC_REF(create_casing_pellets)) + RegisterSignal(parent, COMSIG_FIRE_CASING, PROC_REF(create_casing_pellets)) else if(isgrenade(parent)) RegisterSignal(parent, COMSIG_GRENADE_ARMED, PROC_REF(grenade_armed)) RegisterSignal(parent, COMSIG_GRENADE_DETONATE, PROC_REF(create_blast_pellets)) @@ -94,15 +94,15 @@ //SKYRAT EDIT END /datum/component/pellet_cloud/UnregisterFromParent() - UnregisterSignal(parent, list(COMSIG_PREQDELETED, COMSIG_PELLET_CLOUD_INIT, COMSIG_GRENADE_DETONATE, COMSIG_GRENADE_ARMED, COMSIG_MOVABLE_MOVED, COMSIG_MINE_TRIGGERED, COMSIG_ITEM_DROPPED)) + UnregisterSignal(parent, list(COMSIG_PREQDELETED, COMSIG_FIRE_CASING, COMSIG_GRENADE_DETONATE, COMSIG_GRENADE_ARMED, COMSIG_MOVABLE_MOVED, COMSIG_MINE_TRIGGERED, COMSIG_ITEM_DROPPED)) /** * create_casing_pellets() is for directed pellet clouds for ammo casings that have multiple pellets (buckshot and scatter lasers for instance) * * Honestly this is mostly just a rehash of [/obj/item/ammo_casing/proc/fire_casing] for pellet counts > 1, except this lets us tamper with the pellets and hook onto them for tracking purposes. - * The arguments really don't matter, this proc is triggered by COMSIG_PELLET_CLOUD_INIT which is only for this really, it's just a big mess of the state vars we need for doing the stuff over here. + * The arguments really don't matter, while this proc is triggered by COMSIG_FIRE_CASING, it's just a big mess of the state vars we need for doing the stuff over here. */ -/datum/component/pellet_cloud/proc/create_casing_pellets(obj/item/ammo_casing/shell, atom/target, mob/living/user, fired_from, randomspread, spread, zone_override, params, distro) +/datum/component/pellet_cloud/proc/create_casing_pellets(obj/item/ammo_casing/shell, atom/target, mob/living/user, fired_from, randomspread, spread, zone_override, params, distro, obj/projectile/proj) SIGNAL_HANDLER shooter = user diff --git a/code/datums/elements/caseless.dm b/code/datums/elements/caseless.dm new file mode 100644 index 00000000000..9f3dd1431f4 --- /dev/null +++ b/code/datums/elements/caseless.dm @@ -0,0 +1,30 @@ +/** + * An element that deletes the casing when fired and, if reusable is true, adds the projectile_drop element to the bullet. + * Just make sure to not add components or elements that also use COMSIG_FIRE_CASING after this one. + * Not compatible with pellets (how the eff would that work in a senible way tho?). + */ +/datum/element/caseless + element_flags = ELEMENT_BESPOKE + argument_hash_start_idx = 2 + var/reusable = FALSE + +/datum/element/caseless/Attach(datum/target, reusable) + . = ..() + if(!isammocasing(target)) + return ELEMENT_INCOMPATIBLE + src.reusable = reusable + RegisterSignal(target, COMSIG_FIRE_CASING, PROC_REF(on_fired_casing)) + +/datum/element/caseless/proc/on_fired_casing(obj/item/ammo_casing/shell, atom/target, mob/living/user, fired_from, randomspread, spread, zone_override, params, distro, obj/projectile/proj) + SIGNAL_HANDLER + if(!proj) + return + + if(reusable) + proj.AddElement(/datum/element/projectile_drop, shell.type) + + if(isgun(fired_from)) + var/obj/item/gun/shot_from = fired_from + if(shot_from.chambered == shell) + shot_from.chambered = null //Nuke it. Nuke it now. + qdel(shell) diff --git a/code/datums/elements/projectile_drop.dm b/code/datums/elements/projectile_drop.dm new file mode 100644 index 00000000000..633d43c201b --- /dev/null +++ b/code/datums/elements/projectile_drop.dm @@ -0,0 +1,20 @@ +///A simple element that spawns an atom when the bullet hits an object or reaches the end of its range +/datum/element/projectile_drop + element_flags = ELEMENT_BESPOKE + argument_hash_start_idx = 2 + var/drop_type + +/datum/element/projectile_drop/Attach(datum/target, drop_type) + . = ..() + if(!isprojectile(target)) + return ELEMENT_INCOMPATIBLE + src.drop_type = drop_type + RegisterSignals(target, list(COMSIG_PROJECTILE_RANGE_OUT, COMSIG_PROJECTILE_SELF_ON_HIT), PROC_REF(spawn_drop)) + +/datum/element/projectile_drop/proc/spawn_drop(obj/projectile/source) + SIGNAL_HANDLER + var/turf/turf = get_turf(source) + var/atom/new_drop = new drop_type(turf) + SEND_SIGNAL(source, COMSIG_PROJECTILE_ON_SPAWN_DROP, new_drop) + //Just to be safe, knowing it won't be spawned multiple times. + UnregisterSignal(source, list(COMSIG_PROJECTILE_RANGE_OUT, COMSIG_PROJECTILE_SELF_ON_HIT, COMSIG_QDELETING)) diff --git a/code/datums/storage/subtypes/pockets.dm b/code/datums/storage/subtypes/pockets.dm index 5c8d862cc1c..e72fa8ef89e 100644 --- a/code/datums/storage/subtypes/pockets.dm +++ b/code/datums/storage/subtypes/pockets.dm @@ -103,7 +103,7 @@ /obj/item/toy/crayon, /obj/item/reagent_containers/cup/glass/flask), list(/obj/item/screwdriver/power, - /obj/item/ammo_casing/caseless/rocket, + /obj/item/ammo_casing/rocket, /obj/item/clothing/mask/cigarette/pipe, /obj/item/toy/crayon/spraycan) ) @@ -138,7 +138,7 @@ /obj/item/bikehorn, /obj/item/reagent_containers/cup/glass/flask), list(/obj/item/screwdriver/power, - /obj/item/ammo_casing/caseless/rocket, + /obj/item/ammo_casing/rocket, /obj/item/clothing/mask/cigarette/pipe, /obj/item/toy/crayon/spraycan) ) diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index add94ab4341..65cfcfced21 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -79,7 +79,7 @@ push_over() /obj/item/cardboard_cutout/bullet_act(obj/projectile/P, def_zone, piercing_hit = FALSE) - if(istype(P, /obj/projectile/bullet/reusable)) + if(istype(P, /obj/projectile/bullet)) P.on_hit(src, 0, piercing_hit) visible_message(span_danger("[src] is hit by [P]!")) playsound(src, 'sound/weapons/slice.ogg', 50, TRUE) diff --git a/code/game/objects/items/robot/items/food.dm b/code/game/objects/items/robot/items/food.dm index 9532e8e93af..3b2a16f071c 100644 --- a/code/game/objects/items/robot/items/food.dm +++ b/code/game/objects/items/robot/items/food.dm @@ -86,12 +86,12 @@ return FALSE candy-- - var/obj/item/ammo_casing/caseless/lollipop/lollipop + var/obj/item/ammo_casing/lollipop/lollipop var/mob/living/silicon/robot/robot_user = user if(istype(robot_user) && robot_user.emagged) - lollipop = new /obj/item/ammo_casing/caseless/lollipop/harmful(src) + lollipop = new /obj/item/ammo_casing/lollipop/harmful(src) else - lollipop = new /obj/item/ammo_casing/caseless/lollipop(src) + lollipop = new /obj/item/ammo_casing/lollipop(src) playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE) lollipop.fire_casing(target, user, params, 0, 0, null, 0, src) @@ -104,12 +104,12 @@ to_chat(user, span_warning("Not enough gumballs left!")) return FALSE candy-- - var/obj/item/ammo_casing/caseless/gumball/gumball + var/obj/item/ammo_casing/gumball/gumball var/mob/living/silicon/robot/robot_user = user if(istype(robot_user) && robot_user.emagged) - gumball = new /obj/item/ammo_casing/caseless/gumball/harmful(src) + gumball = new /obj/item/ammo_casing/gumball/harmful(src) else - gumball = new /obj/item/ammo_casing/caseless/gumball(src) + gumball = new /obj/item/ammo_casing/gumball(src) gumball.loaded_projectile.color = rgb(rand(0, 255), rand(0, 255), rand(0, 255)) playsound(src.loc, 'sound/weapons/bulletflyby3.ogg', 50, TRUE) @@ -151,52 +151,60 @@ to_chat(user, span_notice("Module is now dispensing lollipops.")) ..() -/obj/item/ammo_casing/caseless/gumball +/obj/item/ammo_casing/gumball name = "Gumball" desc = "Why are you seeing this?!" - projectile_type = /obj/projectile/bullet/reusable/gumball + projectile_type = /obj/projectile/bullet/gumball click_cooldown_override = 2 -/obj/item/ammo_casing/caseless/gumball/harmful - projectile_type = /obj/projectile/bullet/reusable/gumball/harmful +/obj/item/ammo_casing/gumball/Initialize(mapload) + . = ..() + AddElement(/datum/element/caseless) -/obj/projectile/bullet/reusable/gumball +/obj/item/ammo_casing/gumball/harmful + projectile_type = /obj/projectile/bullet/gumball/harmful + +/obj/projectile/bullet/gumball name = "gumball" desc = "Oh noes! A fast-moving gumball!" icon_state = "gumball" - ammo_type = /obj/item/food/gumball damage = 0 speed = 0.5 -/obj/projectile/bullet/reusable/gumball/harmful +/obj/projectile/bullet/gumball/Initialize(mapload) + . = ..() + AddElement(/datum/element/projectile_drop, /obj/item/food/gumball) + RegisterSignal(src, COMSIG_PROJECTILE_ON_SPAWN_DROP, PROC_REF(handle_drop)) + +/obj/projectile/bullet/gumball/harmful damage = 10 -/obj/projectile/bullet/reusable/gumball/handle_drop() - if(!dropped) - var/turf/turf = get_turf(src) - var/obj/item/food/gumball/gumball = new ammo_type(turf) - gumball.color = color - dropped = TRUE +/obj/projectile/bullet/gumball/proc/handle_drop(datum/source, obj/item/food/gumball/gumball) + SIGNAL_HANDLER + gumball.color = color -/obj/item/ammo_casing/caseless/lollipop //NEEDS RANDOMIZED COLOR LOGIC. +/obj/item/ammo_casing/lollipop //NEEDS RANDOMIZED COLOR LOGIC. name = "Lollipop" desc = "Why are you seeing this?!" - projectile_type = /obj/projectile/bullet/reusable/lollipop + projectile_type = /obj/projectile/bullet/lollipop click_cooldown_override = 2 -/obj/item/ammo_casing/caseless/lollipop/harmful - projectile_type = /obj/projectile/bullet/reusable/lollipop/harmful +/obj/item/ammo_casing/lollipop/Initialize(mapload) + . = ..() + AddElement(/datum/element/caseless) -/obj/projectile/bullet/reusable/lollipop +/obj/item/ammo_casing/lollipop/harmful + projectile_type = /obj/projectile/bullet/lollipop/harmful + +/obj/projectile/bullet/lollipop name = "lollipop" desc = "Oh noes! A fast-moving lollipop!" icon_state = "lollipop_1" - ammo_type = /obj/item/food/lollipop/cyborg damage = 0 speed = 0.5 - var/color2 = rgb(0, 0, 0) + var/head_color -/obj/projectile/bullet/reusable/lollipop/harmful +/obj/projectile/bullet/lollipop/harmful embedding = list( embed_chance = 35, fall_chance = 2, @@ -209,20 +217,17 @@ damage = 10 embed_falloff_tile = 0 -/obj/projectile/bullet/reusable/lollipop/Initialize(mapload) - var/obj/item/food/lollipop/lollipop = new ammo_type(src) - color2 = lollipop.head_color +/obj/projectile/bullet/lollipop/Initialize(mapload) + . = ..() var/mutable_appearance/head = mutable_appearance('icons/obj/weapons/guns/projectiles.dmi', "lollipop_2") - head.color = color2 + head.color = head_color = rgb(rand(0, 255), rand(0, 255), rand(0, 255)) add_overlay(head) - return ..() + AddElement(/datum/element/projectile_drop, /obj/item/food/lollipop/cyborg) + RegisterSignal(src, COMSIG_PROJECTILE_ON_SPAWN_DROP, PROC_REF(handle_drop)) -/obj/projectile/bullet/reusable/lollipop/handle_drop() - if(!dropped) - var/turf/turf = get_turf(src) - var/obj/item/food/lollipop/lollipop = new ammo_type(turf) - lollipop.change_head_color(color2) - dropped = TRUE +/obj/projectile/bullet/lollipop/proc/handle_drop(datum/source, obj/item/food/lollipop/lollipop) + SIGNAL_HANDLER + lollipop.change_head_color(head_color) #undef DISPENSE_LOLLIPOP_MODE #undef THROW_LOLLIPOP_MODE diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index 39ffdd85b25..16ecfc0a555 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -43,7 +43,7 @@ playsound(src.loc, 'sound/items/bikehorn.ogg', 50, TRUE) /obj/item/target/bullet_act(obj/projectile/P) - if(istype(P, /obj/projectile/bullet/reusable)) // If it's a foam dart, don't bother with any of this other shit + if(istype(P, /obj/projectile/bullet)) // If it's a foam dart, don't bother with any of this other shit return P.on_hit(src, 0) var/p_x = P.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset P.p_x!" var/p_y = P.p_y + pick(0,0,0,0,0,-1,1) diff --git a/code/game/objects/items/storage/bags.dm b/code/game/objects/items/storage/bags.dm index 22c75ebdd93..4432754e561 100644 --- a/code/game/objects/items/storage/bags.dm +++ b/code/game/objects/items/storage/bags.dm @@ -556,11 +556,11 @@ atom_storage.max_slots = 40 atom_storage.max_total_storage = 100 atom_storage.set_holdable(list( - /obj/item/ammo_casing/caseless/harpoon + /obj/item/ammo_casing/harpoon )) /obj/item/storage/bag/harpoon_quiver/PopulateContents() for(var/i in 1 to 40) - new /obj/item/ammo_casing/caseless/harpoon(src) + new /obj/item/ammo_casing/harpoon(src) #undef ORE_BAG_BALOON_COOLDOWN diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index de52b99817a..b8af901cd31 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -129,19 +129,19 @@ var/random_color = TRUE /obj/item/toy/balloon/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/ammo_casing/caseless/foam_dart) && ismonkey(user)) + if(istype(I, /obj/item/ammo_casing/foam_dart) && ismonkey(user)) pop_balloon(monkey_pop = TRUE) else return ..() /obj/item/toy/balloon/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) - if(ismonkey(throwingdatum.thrower) && istype(AM, /obj/item/ammo_casing/caseless/foam_dart)) + if(ismonkey(throwingdatum.thrower) && istype(AM, /obj/item/ammo_casing/foam_dart)) pop_balloon(monkey_pop = TRUE) else return ..() /obj/item/toy/balloon/bullet_act(obj/projectile/P) - if((istype(P,/obj/projectile/bullet/p50) || istype(P,/obj/projectile/bullet/reusable/foam_dart)) && ismonkey(P.firer)) + if((istype(P,/obj/projectile/bullet/p50) || istype(P,/obj/projectile/bullet/foam_dart)) && ismonkey(P.firer)) pop_balloon(monkey_pop = TRUE) else return ..() diff --git a/code/modules/capture_the_flag/ctf_equipment.dm b/code/modules/capture_the_flag/ctf_equipment.dm index 3e843398893..ed152714d5d 100644 --- a/code/modules/capture_the_flag/ctf_equipment.dm +++ b/code/modules/capture_the_flag/ctf_equipment.dm @@ -20,17 +20,17 @@ return BULLET_ACT_HIT /obj/item/ammo_box/magazine/recharge/ctf - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf + ammo_type = /obj/item/ammo_casing/laser/ctf /obj/item/ammo_box/magazine/recharge/ctf/Initialize(mapload) . = ..() AddElement(/datum/element/delete_on_drop) -/obj/item/ammo_casing/caseless/laser/ctf +/obj/item/ammo_casing/laser/ctf projectile_type = /obj/projectile/beam/ctf/ -/obj/item/ammo_casing/caseless/laser/ctf/Initialize(mapload) +/obj/item/ammo_casing/laser/ctf/Initialize(mapload) . = ..() AddElement(/datum/element/delete_on_drop) @@ -49,10 +49,10 @@ /obj/item/ammo_box/magazine/recharge/ctf/rifle - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/rifle + ammo_type = /obj/item/ammo_casing/laser/ctf/rifle -/obj/item/ammo_casing/caseless/laser/ctf/rifle +/obj/item/ammo_casing/laser/ctf/rifle projectile_type = /obj/projectile/beam/ctf/rifle @@ -82,11 +82,11 @@ AddElement(/datum/element/delete_on_drop) /obj/item/ammo_box/magazine/recharge/ctf/shotgun - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/shotgun + ammo_type = /obj/item/ammo_casing/laser/ctf/shotgun max_ammo = 6 -/obj/item/ammo_casing/caseless/laser/ctf/shotgun +/obj/item/ammo_casing/laser/ctf/shotgun projectile_type = /obj/projectile/beam/ctf/shotgun pellets = 6 variance = 25 @@ -107,10 +107,10 @@ fire_delay = 1 SECONDS /obj/item/ammo_box/magazine/recharge/ctf/marksman - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/marksman + ammo_type = /obj/item/ammo_casing/laser/ctf/marksman max_ammo = 10 -/obj/item/ammo_casing/caseless/laser/ctf/marksman +/obj/item/ammo_casing/laser/ctf/marksman projectile_type = /obj/projectile/beam/ctf/marksman /obj/projectile/beam/ctf/marksman @@ -133,11 +133,11 @@ /obj/item/ammo_box/magazine/recharge/ctf/deagle - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/deagle + ammo_type = /obj/item/ammo_casing/laser/ctf/deagle max_ammo = 7 -/obj/item/ammo_casing/caseless/laser/ctf/deagle +/obj/item/ammo_casing/laser/ctf/deagle projectile_type = /obj/projectile/beam/ctf/deagle @@ -239,9 +239,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/rifle/red /obj/item/ammo_box/magazine/recharge/ctf/rifle/red - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/rifle/red + ammo_type = /obj/item/ammo_casing/laser/ctf/rifle/red -/obj/item/ammo_casing/caseless/laser/ctf/rifle/red +/obj/item/ammo_casing/laser/ctf/rifle/red projectile_type = /obj/projectile/beam/ctf/rifle/red /obj/projectile/beam/ctf/rifle/red @@ -255,9 +255,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/shotgun/red /obj/item/ammo_box/magazine/recharge/ctf/shotgun/red - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/shotgun/red + ammo_type = /obj/item/ammo_casing/laser/ctf/shotgun/red -/obj/item/ammo_casing/caseless/laser/ctf/shotgun/red +/obj/item/ammo_casing/laser/ctf/shotgun/red projectile_type = /obj/projectile/beam/ctf/shotgun/red /obj/projectile/beam/ctf/shotgun/red @@ -271,9 +271,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/marksman/red /obj/item/ammo_box/magazine/recharge/ctf/marksman/red - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/marksman/red + ammo_type = /obj/item/ammo_casing/laser/ctf/marksman/red -/obj/item/ammo_casing/caseless/laser/ctf/marksman/red +/obj/item/ammo_casing/laser/ctf/marksman/red projectile_type = /obj/projectile/beam/ctf/marksman/red /obj/projectile/beam/ctf/marksman/red @@ -305,9 +305,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/rifle/blue /obj/item/ammo_box/magazine/recharge/ctf/rifle/blue - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/rifle/blue + ammo_type = /obj/item/ammo_casing/laser/ctf/rifle/blue -/obj/item/ammo_casing/caseless/laser/ctf/rifle/blue +/obj/item/ammo_casing/laser/ctf/rifle/blue projectile_type = /obj/projectile/beam/ctf/rifle/blue /obj/projectile/beam/ctf/rifle/blue @@ -319,9 +319,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/shotgun/blue /obj/item/ammo_box/magazine/recharge/ctf/shotgun/blue - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/shotgun/blue + ammo_type = /obj/item/ammo_casing/laser/ctf/shotgun/blue -/obj/item/ammo_casing/caseless/laser/ctf/shotgun/blue +/obj/item/ammo_casing/laser/ctf/shotgun/blue projectile_type = /obj/projectile/beam/ctf/shotgun/blue /obj/projectile/beam/ctf/shotgun/blue @@ -334,9 +334,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/marksman/blue /obj/item/ammo_box/magazine/recharge/ctf/marksman/blue - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/marksman/blue + ammo_type = /obj/item/ammo_casing/laser/ctf/marksman/blue -/obj/item/ammo_casing/caseless/laser/ctf/marksman/blue +/obj/item/ammo_casing/laser/ctf/marksman/blue projectile_type = /obj/projectile/beam/ctf/marksman/blue /obj/projectile/beam/ctf/marksman/blue @@ -364,9 +364,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/rifle/green /obj/item/ammo_box/magazine/recharge/ctf/rifle/green - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/rifle/green + ammo_type = /obj/item/ammo_casing/laser/ctf/rifle/green -/obj/item/ammo_casing/caseless/laser/ctf/rifle/green +/obj/item/ammo_casing/laser/ctf/rifle/green projectile_type = /obj/projectile/beam/ctf/rifle/green /obj/projectile/beam/ctf/rifle/green @@ -380,9 +380,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/shotgun/green /obj/item/ammo_box/magazine/recharge/ctf/shotgun/green - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/shotgun/green + ammo_type = /obj/item/ammo_casing/laser/ctf/shotgun/green -/obj/item/ammo_casing/caseless/laser/ctf/shotgun/green +/obj/item/ammo_casing/laser/ctf/shotgun/green projectile_type = /obj/projectile/beam/ctf/shotgun/green /obj/projectile/beam/ctf/shotgun/green @@ -396,9 +396,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/marksman/green /obj/item/ammo_box/magazine/recharge/ctf/marksman/green - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/marksman/green + ammo_type = /obj/item/ammo_casing/laser/ctf/marksman/green -/obj/item/ammo_casing/caseless/laser/ctf/marksman/green +/obj/item/ammo_casing/laser/ctf/marksman/green projectile_type = /obj/projectile/beam/ctf/marksman/green /obj/projectile/beam/ctf/marksman/green @@ -430,9 +430,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/rifle/yellow /obj/item/ammo_box/magazine/recharge/ctf/rifle/yellow - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/rifle/yellow + ammo_type = /obj/item/ammo_casing/laser/ctf/rifle/yellow -/obj/item/ammo_casing/caseless/laser/ctf/rifle/yellow +/obj/item/ammo_casing/laser/ctf/rifle/yellow projectile_type = /obj/projectile/beam/ctf/rifle/yellow /obj/projectile/beam/ctf/rifle/yellow @@ -446,9 +446,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/shotgun/yellow /obj/item/ammo_box/magazine/recharge/ctf/shotgun/yellow - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/shotgun/yellow + ammo_type = /obj/item/ammo_casing/laser/ctf/shotgun/yellow -/obj/item/ammo_casing/caseless/laser/ctf/shotgun/yellow +/obj/item/ammo_casing/laser/ctf/shotgun/yellow projectile_type = /obj/projectile/beam/ctf/shotgun/yellow /obj/projectile/beam/ctf/shotgun/yellow @@ -462,9 +462,9 @@ mag_type = /obj/item/ammo_box/magazine/recharge/ctf/marksman/yellow /obj/item/ammo_box/magazine/recharge/ctf/marksman/yellow - ammo_type = /obj/item/ammo_casing/caseless/laser/ctf/marksman/yellow + ammo_type = /obj/item/ammo_casing/laser/ctf/marksman/yellow -/obj/item/ammo_casing/caseless/laser/ctf/marksman/yellow +/obj/item/ammo_casing/laser/ctf/marksman/yellow projectile_type = /obj/projectile/beam/ctf/marksman/yellow /obj/projectile/beam/ctf/marksman/yellow diff --git a/code/modules/mod/modules/modules_maint.dm b/code/modules/mod/modules/modules_maint.dm index 157e4aea7d3..34b8f4dc252 100644 --- a/code/modules/mod/modules/modules_maint.dm +++ b/code/modules/mod/modules/modules_maint.dm @@ -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 diff --git a/code/modules/mod/modules/modules_supply.dm b/code/modules/mod/modules/modules_supply.dm index 2d27b292760..719eacc87e9 100644 --- a/code/modules/mod/modules/modules_supply.dm +++ b/code/modules/mod/modules/modules_supply.dm @@ -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) diff --git a/code/modules/projectiles/ammunition/_firing.dm b/code/modules/projectiles/ammunition/_firing.dm index 356f4b474d3..76c67a9f036 100644 --- a/code/modules/projectiles/ammunition/_firing.dm +++ b/code/modules/projectiles/ammunition/_firing.dm @@ -2,26 +2,27 @@ distro += variance var/targloc = get_turf(target) ready_proj(target, user, quiet, zone_override, fired_from) + var/obj/projectile/thrown_proj if(pellets == 1) if(distro) //We have to spread a pixel-precision bullet. throw_proj was called before so angles should exist by now... if(randomspread) spread = round((rand() - 0.5) * distro) else //Smart spread spread = round(1 - 0.5) * distro - if(!throw_proj(target, targloc, user, params, spread, fired_from)) + thrown_proj = throw_proj(target, targloc, user, params, spread, fired_from) + if(isnull(thrown_proj)) return FALSE else if(isnull(loaded_projectile)) return FALSE AddComponent(/datum/component/pellet_cloud, projectile_type, pellets) - SEND_SIGNAL(src, COMSIG_PELLET_CLOUD_INIT, target, user, fired_from, randomspread, spread, zone_override, params, distro) //var/next_delay = click_cooldown_override || CLICK_CD_RANGE // ORIGINAL var/next_delay = click_cooldown_override || ((user.staminaloss <= STAMINA_THRESHOLD_TIRED_CLICK_CD) ? CLICK_CD_RANGE : CLICK_CD_RANGE_TIRED) // SKYRAT EDIT CHANGE if(HAS_TRAIT(user, TRAIT_DOUBLE_TAP)) next_delay = round(next_delay * 0.5) - user.changeNext_move(next_delay) + if(!tk_firing(user, fired_from)) user.newtonian_move(get_dir(target, user)) else if(ismovable(fired_from)) @@ -30,6 +31,9 @@ var/throwtarget = get_step(fired_from, get_dir(target, fired_from)) firer.safe_throw_at(throwtarget, 1, 2) update_appearance() + + SEND_SIGNAL(src, COMSIG_FIRE_CASING, target, user, fired_from, randomspread, spread, zone_override, params, distro, thrown_proj) + return TRUE /obj/item/ammo_casing/proc/tk_firing(mob/living/user, atom/fired_from) @@ -63,7 +67,7 @@ /obj/item/ammo_casing/proc/throw_proj(atom/target, turf/targloc, mob/living/user, params, spread, atom/fired_from) var/turf/curloc = get_turf(fired_from) if (!istype(targloc) || !istype(curloc) || !loaded_projectile) - return FALSE + return null var/firing_dir if(loaded_projectile.firer) @@ -80,7 +84,7 @@ var/obj/projectile/loaded_projectile_cache = loaded_projectile loaded_projectile = null loaded_projectile_cache.fire(null, direct_target) - return TRUE + return loaded_projectile_cache /obj/item/ammo_casing/proc/spread(turf/target, turf/current, distro) var/dx = abs(target.x - current.x) diff --git a/code/modules/projectiles/ammunition/caseless/foam.dm b/code/modules/projectiles/ammunition/ballistic/foam.dm similarity index 72% rename from code/modules/projectiles/ammunition/caseless/foam.dm rename to code/modules/projectiles/ammunition/ballistic/foam.dm index 871f0cc766d..21ceeb6918b 100644 --- a/code/modules/projectiles/ammunition/caseless/foam.dm +++ b/code/modules/projectiles/ammunition/ballistic/foam.dm @@ -1,7 +1,7 @@ -/obj/item/ammo_casing/caseless/foam_dart +/obj/item/ammo_casing/foam_dart name = "foam dart" desc = "It's Donk or Don't! Ages 8 and up." - projectile_type = /obj/projectile/bullet/reusable/foam_dart + projectile_type = /obj/projectile/bullet/foam_dart caliber = CALIBER_FOAM icon = 'icons/obj/weapons/guns/toy.dmi' icon_state = "foamdart" @@ -10,7 +10,11 @@ harmful = FALSE var/modified = FALSE -/obj/item/ammo_casing/caseless/foam_dart/update_icon_state() +/obj/item/ammo_casing/foam_dart/Initialize(mapload) + . = ..() + AddElement(/datum/element/caseless, TRUE) + +/obj/item/ammo_casing/foam_dart/update_icon_state() . = ..() if(modified) icon_state = "[base_icon_state]_empty" @@ -19,12 +23,12 @@ icon_state = "[base_icon_state]" loaded_projectile?.icon_state = "[loaded_projectile.base_icon_state]" -/obj/item/ammo_casing/caseless/foam_dart/update_desc() +/obj/item/ammo_casing/foam_dart/update_desc() . = ..() desc = "It's Donk or Don't! [modified ? "... Although, this one doesn't look too safe." : "Ages 8 and up."]" -/obj/item/ammo_casing/caseless/foam_dart/attackby(obj/item/A, mob/user, params) - var/obj/projectile/bullet/reusable/foam_dart/FD = loaded_projectile +/obj/item/ammo_casing/foam_dart/attackby(obj/item/A, mob/user, params) + var/obj/projectile/bullet/foam_dart/FD = loaded_projectile if (A.tool_behaviour == TOOL_SCREWDRIVER && !modified) modified = TRUE FD.modified = TRUE @@ -47,18 +51,18 @@ else return ..() -/obj/item/ammo_casing/caseless/foam_dart/attack_self(mob/living/user) - var/obj/projectile/bullet/reusable/foam_dart/FD = loaded_projectile +/obj/item/ammo_casing/foam_dart/attack_self(mob/living/user) + var/obj/projectile/bullet/foam_dart/FD = loaded_projectile if(FD.pen) FD.damage = initial(FD.damage) user.put_in_hands(FD.pen) to_chat(user, span_notice("You remove [FD.pen] from [src].")) FD.pen = null -/obj/item/ammo_casing/caseless/foam_dart/riot +/obj/item/ammo_casing/foam_dart/riot name = "riot foam dart" desc = "Whose smart idea was it to use toys as crowd control? Ages 18 and up." - projectile_type = /obj/projectile/bullet/reusable/foam_dart/riot + projectile_type = /obj/projectile/bullet/foam_dart/riot icon_state = "foamdart_riot" base_icon_state = "foamdart_riot" custom_materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT* 1.125) diff --git a/code/modules/projectiles/ammunition/ballistic/harpoon.dm b/code/modules/projectiles/ammunition/ballistic/harpoon.dm new file mode 100644 index 00000000000..61aa16fe56e --- /dev/null +++ b/code/modules/projectiles/ammunition/ballistic/harpoon.dm @@ -0,0 +1,14 @@ +/obj/item/ammo_casing/harpoon + name = "harpoon" + caliber = CALIBER_HARPOON + icon_state = "magspear" + base_icon_state = "magspear" + projectile_type = /obj/projectile/bullet/harpoon + +/obj/item/ammo_casing/harpoon/Initialize(mapload) + . = ..() + AddElement(/datum/element/caseless) + +/obj/item/ammo_casing/harpoon/update_icon_state() + . = ..() + icon_state = "[base_icon_state]" diff --git a/code/modules/projectiles/ammunition/caseless/rocket.dm b/code/modules/projectiles/ammunition/ballistic/rocket.dm similarity index 54% rename from code/modules/projectiles/ammunition/caseless/rocket.dm rename to code/modules/projectiles/ammunition/ballistic/rocket.dm index 5b378fca65f..bb5c1072c14 100644 --- a/code/modules/projectiles/ammunition/caseless/rocket.dm +++ b/code/modules/projectiles/ammunition/ballistic/rocket.dm @@ -1,23 +1,42 @@ -/obj/item/ammo_casing/caseless/rocket +/obj/item/ammo_casing/rocket name = "\improper PM-9HE" desc = "An 84mm High Explosive rocket. Fire at people and pray." caliber = CALIBER_84MM icon_state = "srm-8" + base_icon_state = "srm-8" projectile_type = /obj/projectile/bullet/rocket -/obj/item/ammo_casing/caseless/rocket/heap +/obj/item/ammo_casing/rocket/Initialize(mapload) + . = ..() + AddElement(/datum/element/caseless) + +/obj/item/ammo_casing/rocket/update_icon_state() + . = ..() + icon_state = "[base_icon_state]" + +/obj/item/ammo_casing/rocket/heap name = "\improper PM-9HEAP" desc = "An 84mm High Explosive All Purpose rocket. For when you just need something to not exist anymore." icon_state = "84mm-heap" + base_icon_state = "84mm-heap" projectile_type = /obj/projectile/bullet/rocket/heap -/obj/item/ammo_casing/caseless/rocket/weak +/obj/item/ammo_casing/rocket/weak name = "\improper PM-9HE Low-Yield" desc = "An 84mm High Explosive rocket. This one isn't quite as devastating." projectile_type = /obj/projectile/bullet/rocket/weak -/obj/item/ammo_casing/caseless/a75 +/obj/item/ammo_casing/a75 desc = "A .75 bullet casing." caliber = CALIBER_75 icon_state = "s-casing-live" + base_icon_state = "s-casing-live" projectile_type = /obj/projectile/bullet/gyro + +/obj/item/ammo_casing/a75/Initialize(mapload) + . = ..() + AddElement(/datum/element/caseless) + +/obj/item/ammo_casing/a75/update_icon_state() + . = ..() + icon_state = "[base_icon_state]" diff --git a/code/modules/projectiles/ammunition/caseless/_caseless.dm b/code/modules/projectiles/ammunition/caseless/_caseless.dm deleted file mode 100644 index 8d20b639c73..00000000000 --- a/code/modules/projectiles/ammunition/caseless/_caseless.dm +++ /dev/null @@ -1,18 +0,0 @@ -/obj/item/ammo_casing/caseless - desc = "A caseless bullet casing." - firing_effect_type = null - is_cased_ammo = FALSE - -/obj/item/ammo_casing/caseless/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread, atom/fired_from) - if (!..()) //failed firing - return FALSE - if(isgun(fired_from)) - var/obj/item/gun/shot_from = fired_from - if(shot_from.chambered == src) - shot_from.chambered = null //Nuke it. Nuke it now. - qdel(src) - return TRUE - -/obj/item/ammo_casing/caseless/update_icon_state() - . = ..() - icon_state = "[initial(icon_state)]" diff --git a/code/modules/projectiles/ammunition/caseless/energy.dm b/code/modules/projectiles/ammunition/caseless/energy.dm deleted file mode 100644 index 9461bc4b153..00000000000 --- a/code/modules/projectiles/ammunition/caseless/energy.dm +++ /dev/null @@ -1,9 +0,0 @@ -/obj/item/ammo_casing/caseless/laser - name = "laser casing" - desc = "You shouldn't be seeing this." - caliber = CALIBER_LASER - icon_state = "s-casing-live" - slot_flags = null - projectile_type = /obj/projectile/beam - fire_sound = 'sound/weapons/laser.ogg' - firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/energy diff --git a/code/modules/projectiles/ammunition/caseless/harpoon.dm b/code/modules/projectiles/ammunition/caseless/harpoon.dm deleted file mode 100644 index 5f1b402cf7f..00000000000 --- a/code/modules/projectiles/ammunition/caseless/harpoon.dm +++ /dev/null @@ -1,5 +0,0 @@ -/obj/item/ammo_casing/caseless/harpoon - name = "harpoon" - caliber = CALIBER_HARPOON - icon_state = "magspear" - projectile_type = /obj/projectile/bullet/harpoon diff --git a/code/modules/projectiles/ammunition/energy/laser.dm b/code/modules/projectiles/ammunition/energy/laser.dm index a97ba61779f..188412a40bb 100644 --- a/code/modules/projectiles/ammunition/energy/laser.dm +++ b/code/modules/projectiles/ammunition/energy/laser.dm @@ -119,3 +119,23 @@ /obj/item/ammo_casing/energy/nanite/cryo projectile_type = /obj/projectile/energy/cryo select_name = "cryo" + +///not exactly an energy ammo casing, but it's used by the laser gatling. +/obj/item/ammo_casing/laser + name = "laser casing" + desc = "You shouldn't be seeing this." + caliber = CALIBER_LASER + icon_state = "s-casing-live" + base_icon_state = "s-casing-live" + slot_flags = null + projectile_type = /obj/projectile/beam + fire_sound = 'sound/weapons/laser.ogg' + firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/energy + +/obj/item/ammo_casing/laser/Initialize(mapload) + . = ..() + AddElement(/datum/element/caseless) + +/obj/item/ammo_casing/laser/update_icon_state() + . = ..() + icon_state = "[base_icon_state]" diff --git a/code/modules/projectiles/boxes_magazines/ammo_boxes.dm b/code/modules/projectiles/boxes_magazines/ammo_boxes.dm index c264a4b8a72..bc3a82d432f 100644 --- a/code/modules/projectiles/boxes_magazines/ammo_boxes.dm +++ b/code/modules/projectiles/boxes_magazines/ammo_boxes.dm @@ -106,7 +106,7 @@ name = "ammo box (Foam Darts)" icon = 'icons/obj/weapons/guns/toy.dmi' icon_state = "foambox" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart + ammo_type = /obj/item/ammo_casing/foam_dart max_ammo = 40 custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT*5) @@ -117,7 +117,7 @@ /obj/item/ammo_box/foambox/riot icon_state = "foambox_riot" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot + ammo_type = /obj/item/ammo_casing/foam_dart/riot custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT*25) /obj/item/ammo_box/foambox/riot/mini diff --git a/code/modules/projectiles/boxes_magazines/external/grenade.dm b/code/modules/projectiles/boxes_magazines/external/grenade.dm index b615cfcbdfe..4ba7d43efae 100644 --- a/code/modules/projectiles/boxes_magazines/external/grenade.dm +++ b/code/modules/projectiles/boxes_magazines/external/grenade.dm @@ -1,7 +1,7 @@ /obj/item/ammo_box/magazine/m75 name = "specialized magazine (.75)" icon_state = "75" - ammo_type = /obj/item/ammo_casing/caseless/a75 + ammo_type = /obj/item/ammo_casing/a75 caliber = CALIBER_75 multiple_sprites = AMMO_BOX_FULL_EMPTY max_ammo = 8 diff --git a/code/modules/projectiles/boxes_magazines/external/rechargable.dm b/code/modules/projectiles/boxes_magazines/external/rechargable.dm index 9e1e2597a66..e0c8d53d4bd 100644 --- a/code/modules/projectiles/boxes_magazines/external/rechargable.dm +++ b/code/modules/projectiles/boxes_magazines/external/rechargable.dm @@ -3,7 +3,7 @@ desc = "A rechargeable, detachable battery that serves as a magazine for laser rifles." icon_state = "oldrifle-20" base_icon_state = "oldrifle" - ammo_type = /obj/item/ammo_casing/caseless/laser + ammo_type = /obj/item/ammo_casing/laser caliber = CALIBER_LASER max_ammo = 20 diff --git a/code/modules/projectiles/boxes_magazines/external/toy.dm b/code/modules/projectiles/boxes_magazines/external/toy.dm index 7503cd032f6..1c2a6470796 100644 --- a/code/modules/projectiles/boxes_magazines/external/toy.dm +++ b/code/modules/projectiles/boxes_magazines/external/toy.dm @@ -1,13 +1,13 @@ /obj/item/ammo_box/magazine/toy name = "foam force META magazine" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart + ammo_type = /obj/item/ammo_casing/foam_dart caliber = CALIBER_FOAM /obj/item/ammo_box/magazine/toy/smg name = "foam force SMG magazine" icon_state = "smg9mm" base_icon_state = "smg9mm" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart + ammo_type = /obj/item/ammo_casing/foam_dart max_ammo = 20 /obj/item/ammo_box/magazine/toy/smg/update_icon_state() @@ -15,7 +15,7 @@ icon_state = "[base_icon_state]-[LAZYLEN(stored_ammo) ? "full" : "empty"]" /obj/item/ammo_box/magazine/toy/smg/riot - ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot + ammo_type = /obj/item/ammo_casing/foam_dart/riot /obj/item/ammo_box/magazine/toy/pistol name = "foam force pistol magazine" @@ -24,14 +24,14 @@ multiple_sprites = AMMO_BOX_FULL_EMPTY /obj/item/ammo_box/magazine/toy/pistol/riot - ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot + ammo_type = /obj/item/ammo_casing/foam_dart/riot /obj/item/ammo_box/magazine/toy/smgm45 name = "donksoft SMG magazine" icon_state = "c20r45-toy" base_icon_state = "c20r45" caliber = CALIBER_FOAM - ammo_type = /obj/item/ammo_casing/caseless/foam_dart + ammo_type = /obj/item/ammo_casing/foam_dart max_ammo = 20 /obj/item/ammo_box/magazine/toy/smgm45/update_icon_state() @@ -40,13 +40,13 @@ /obj/item/ammo_box/magazine/toy/smgm45/riot icon_state = "c20r45-riot" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot + ammo_type = /obj/item/ammo_casing/foam_dart/riot /obj/item/ammo_box/magazine/toy/m762 name = "donksoft box magazine" icon_state = "a762-toy" base_icon_state = "a762" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart + ammo_type = /obj/item/ammo_casing/foam_dart max_ammo = 50 /obj/item/ammo_box/magazine/toy/m762/update_icon_state() @@ -55,4 +55,4 @@ /obj/item/ammo_box/magazine/toy/m762/riot icon_state = "a762-riot" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot + ammo_type = /obj/item/ammo_casing/foam_dart/riot diff --git a/code/modules/projectiles/boxes_magazines/internal/grenade.dm b/code/modules/projectiles/boxes_magazines/internal/grenade.dm index 88a93b13af5..aacd64383b0 100644 --- a/code/modules/projectiles/boxes_magazines/internal/grenade.dm +++ b/code/modules/projectiles/boxes_magazines/internal/grenade.dm @@ -12,6 +12,6 @@ /obj/item/ammo_box/magazine/internal/rocketlauncher name = "rocket launcher internal magazine" - ammo_type = /obj/item/ammo_casing/caseless/rocket + ammo_type = /obj/item/ammo_casing/rocket caliber = CALIBER_84MM max_ammo = 1 diff --git a/code/modules/projectiles/boxes_magazines/internal/rifle.dm b/code/modules/projectiles/boxes_magazines/internal/rifle.dm index 67afbed5b41..42ce414fba3 100644 --- a/code/modules/projectiles/boxes_magazines/internal/rifle.dm +++ b/code/modules/projectiles/boxes_magazines/internal/rifle.dm @@ -31,4 +31,4 @@ /obj/item/ammo_box/magazine/internal/boltaction/harpoon max_ammo = 1 caliber = CALIBER_HARPOON - ammo_type = /obj/item/ammo_casing/caseless/harpoon + ammo_type = /obj/item/ammo_casing/harpoon diff --git a/code/modules/projectiles/boxes_magazines/internal/toy.dm b/code/modules/projectiles/boxes_magazines/internal/toy.dm index d369d33d2e6..639323f81d8 100644 --- a/code/modules/projectiles/boxes_magazines/internal/toy.dm +++ b/code/modules/projectiles/boxes_magazines/internal/toy.dm @@ -1,5 +1,5 @@ /obj/item/ammo_box/magazine/internal/shot/toy - ammo_type = /obj/item/ammo_casing/caseless/foam_dart + ammo_type = /obj/item/ammo_casing/foam_dart caliber = CALIBER_FOAM max_ammo = 4 diff --git a/code/modules/projectiles/guns/ballistic/bows/_bow.dm b/code/modules/projectiles/guns/ballistic/bows/_bow.dm index de798d0ae9f..9add02889ad 100644 --- a/code/modules/projectiles/guns/ballistic/bows/_bow.dm +++ b/code/modules/projectiles/guns/ballistic/bows/_bow.dm @@ -36,7 +36,7 @@ chambered.forceMove(drop_location()) magazine.get_round(keep = FALSE) - var/obj/item/ammo_casing/caseless/arrow/our_arrow = chambered + var/obj/item/ammo_casing/arrow/our_arrow = chambered user.put_in_hands(our_arrow) drawn = FALSE @@ -104,7 +104,7 @@ /obj/item/ammo_box/magazine/internal/bow name = "bowstring" - ammo_type = /obj/item/ammo_casing/caseless/arrow + ammo_type = /obj/item/ammo_casing/arrow max_ammo = 1 start_empty = TRUE caliber = CALIBER_ARROW diff --git a/code/modules/projectiles/guns/ballistic/bows/bow_arrows.dm b/code/modules/projectiles/guns/ballistic/bows/bow_arrows.dm index 1782b21abf8..731c8034ea8 100644 --- a/code/modules/projectiles/guns/ballistic/bows/bow_arrows.dm +++ b/code/modules/projectiles/guns/ballistic/bows/bow_arrows.dm @@ -1,28 +1,29 @@ ///base arrow -/obj/item/ammo_casing/caseless/arrow +/obj/item/ammo_casing/arrow name = "arrow" desc = "Stabby Stabman!" icon = 'icons/obj/weapons/guns/bows/arrows.dmi' icon_state = "arrow" inhand_icon_state = "arrow" - projectile_type = /obj/projectile/bullet/reusable/arrow + projectile_type = /obj/projectile/bullet/arrow flags_1 = NONE throwforce = 1 firing_effect_type = null caliber = CALIBER_ARROW is_cased_ammo = FALSE + var/reusable = TRUE -/obj/item/ammo_casing/caseless/arrow/Initialize(mapload) +/obj/item/ammo_casing/arrow/Initialize(mapload) . = ..() - AddComponent(/datum/element/envenomable_casing) + AddElement(/datum/element/envenomable_casing) + AddElement(/datum/element/caseless, reusable) ///base arrow projectile -/obj/projectile/bullet/reusable/arrow +/obj/projectile/bullet/arrow name = "arrow" desc = "Ow! Get it out of me!" icon = 'icons/obj/weapons/guns/bows/arrows.dmi' icon_state = "arrow_projectile" - ammo_type = /obj/item/ammo_casing/caseless/arrow damage = 50 speed = 1 range = 25 @@ -38,41 +39,41 @@ range = 25 /// despawning arrow type -/obj/item/ammo_casing/caseless/arrow/despawning/dropped() +/obj/item/ammo_casing/arrow/despawning/dropped() . = ..() addtimer(CALLBACK(src, PROC_REF(floor_vanish)), 5 SECONDS) -/obj/item/ammo_casing/caseless/arrow/despawning/proc/floor_vanish() +/obj/item/ammo_casing/arrow/despawning/proc/floor_vanish() if(isturf(loc)) qdel(src) /// holy arrows -/obj/item/ammo_casing/caseless/arrow/holy +/obj/item/ammo_casing/arrow/holy name = "holy arrow" desc = "A holy diver seeking its target." icon_state = "holy_arrow" inhand_icon_state = "holy_arrow" - projectile_type = /obj/projectile/bullet/reusable/arrow/holy + projectile_type = /obj/projectile/bullet/arrow/holy /// holy arrow projectile -/obj/projectile/bullet/reusable/arrow/holy +/obj/projectile/bullet/arrow/holy name = "holy arrow" desc = "Here it comes, cultist scum!" icon_state = "holy_arrow_projectile" - ammo_type = /obj/item/ammo_casing/caseless/arrow/holy damage = 20 //still a lot but this is roundstart gear so far less -/obj/projectile/bullet/reusable/arrow/holy/Initialize(mapload) +/obj/projectile/bullet/arrow/holy/Initialize(mapload) . = ..() //50 damage to revenants AddElement(/datum/element/bane, target_type = /mob/living/simple_animal/revenant, damage_multiplier = 0, added_damage = 30) /// special pyre sect arrow /// in the future, this needs a special sprite, but bows don't support non-hardcoded arrow sprites -/obj/item/ammo_casing/caseless/arrow/holy/blazing +/obj/item/ammo_casing/arrow/holy/blazing name = "blazing star arrow" desc = "A holy diver seeking its target, blessed with fire. Will ignite on hit, destroying the arrow. But if you hit an already ignited target...?" projectile_type = /obj/projectile/bullet/arrow/blazing + reusable = FALSE /obj/projectile/bullet/arrow/blazing name = "blazing arrow" diff --git a/code/modules/projectiles/guns/ballistic/bows/bow_quivers.dm b/code/modules/projectiles/guns/ballistic/bows/bow_quivers.dm index 19a00a95c96..7fe37c1ed65 100644 --- a/code/modules/projectiles/guns/ballistic/bows/bow_quivers.dm +++ b/code/modules/projectiles/guns/ballistic/bows/bow_quivers.dm @@ -7,7 +7,7 @@ inhand_icon_state = null worn_icon_state = "harpoon_quiver" /// type of arrow the quivel should hold - var/arrow_path = /obj/item/ammo_casing/caseless/arrow + var/arrow_path = /obj/item/ammo_casing/arrow /obj/item/storage/bag/quiver/Initialize(mapload) . = ..() @@ -15,7 +15,7 @@ atom_storage.max_slots = 40 atom_storage.max_total_storage = 100 atom_storage.set_holdable(list( - /obj/item/ammo_casing/caseless/arrow, + /obj/item/ammo_casing/arrow, )) /obj/item/storage/bag/quiver/PopulateContents() @@ -24,7 +24,7 @@ new arrow_path(src) /obj/item/storage/bag/quiver/despawning - arrow_path = /obj/item/ammo_casing/caseless/arrow/despawning + arrow_path = /obj/item/ammo_casing/arrow/despawning /obj/item/storage/bag/quiver/holy name = "divine quiver" @@ -32,4 +32,4 @@ icon_state = "holyquiver" inhand_icon_state = "holyquiver" worn_icon_state = "holyquiver" - arrow_path = /obj/item/ammo_casing/caseless/arrow/holy + arrow_path = /obj/item/ammo_casing/arrow/holy diff --git a/code/modules/projectiles/guns/ballistic/bows/bow_types.dm b/code/modules/projectiles/guns/ballistic/bows/bow_types.dm index 8cb11bc7785..e60d53a69a7 100644 --- a/code/modules/projectiles/guns/ballistic/bows/bow_types.dm +++ b/code/modules/projectiles/guns/ballistic/bows/bow_types.dm @@ -18,7 +18,7 @@ /obj/item/ammo_box/magazine/internal/bow/holy name = "divine bowstring" - ammo_type = /obj/item/ammo_casing/caseless/arrow/holy + ammo_type = /obj/item/ammo_casing/arrow/holy /obj/item/gun/ballistic/bow/divine/Initialize(mapload) . = ..() diff --git a/code/modules/projectiles/projectile/reusable/foam_dart.dm b/code/modules/projectiles/projectile/bullets/foam_dart.dm similarity index 54% rename from code/modules/projectiles/projectile/reusable/foam_dart.dm rename to code/modules/projectiles/projectile/bullets/foam_dart.dm index 8c82993a896..60f36c8af5f 100644 --- a/code/modules/projectiles/projectile/reusable/foam_dart.dm +++ b/code/modules/projectiles/projectile/bullets/foam_dart.dm @@ -1,4 +1,4 @@ -/obj/projectile/bullet/reusable/foam_dart +/obj/projectile/bullet/foam_dart name = "foam dart" desc = "I hope you're wearing eye protection." damage = 0 // It's a damn toy. @@ -6,19 +6,18 @@ icon = 'icons/obj/weapons/guns/toy.dmi' icon_state = "foamdart_proj" base_icon_state = "foamdart_proj" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart range = 10 var/modified = FALSE var/obj/item/pen/pen = null -/obj/projectile/bullet/reusable/foam_dart/handle_drop() - if(dropped) - return - var/turf/T = get_turf(src) - dropped = 1 - var/obj/item/ammo_casing/caseless/foam_dart/newcasing = new ammo_type(T) +/obj/projectile/bullet/foam_dart/Initialize(mapload) + . = ..() + RegisterSignal(src, COMSIG_PROJECTILE_ON_SPAWN_DROP, PROC_REF(handle_drop)) + +/obj/projectile/bullet/foam_dart/proc/handle_drop(datum/source, obj/item/ammo_casing/foam_dart/newcasing) + SIGNAL_HANDLER newcasing.modified = modified - var/obj/projectile/bullet/reusable/foam_dart/newdart = newcasing.loaded_projectile + var/obj/projectile/bullet/foam_dart/newdart = newcasing.loaded_projectile newdart.modified = modified newdart.damage_type = damage_type if(pen) @@ -28,14 +27,12 @@ newdart.damage = 5 newdart.update_appearance() - -/obj/projectile/bullet/reusable/foam_dart/Destroy() +/obj/projectile/bullet/foam_dart/Destroy() pen = null return ..() -/obj/projectile/bullet/reusable/foam_dart/riot +/obj/projectile/bullet/foam_dart/riot name = "riot foam dart" icon_state = "foamdart_riot_proj" base_icon_state = "foamdart_riot_proj" - ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot stamina = 25 diff --git a/code/modules/projectiles/projectile/reusable/_reusable.dm b/code/modules/projectiles/projectile/reusable/_reusable.dm deleted file mode 100644 index ab7d89573ee..00000000000 --- a/code/modules/projectiles/projectile/reusable/_reusable.dm +++ /dev/null @@ -1,22 +0,0 @@ -/obj/projectile/bullet/reusable - name = "reusable bullet" - desc = "How do you even reuse a bullet?" - impact_effect_type = null - embedding = null - shrapnel_type = null - var/ammo_type = /obj/item/ammo_casing/caseless - var/dropped = FALSE - -/obj/projectile/bullet/reusable/on_hit(atom/target, blocked = FALSE) - . = ..() - handle_drop() - -/obj/projectile/bullet/reusable/on_range() - handle_drop() - ..() - -/obj/projectile/bullet/reusable/proc/handle_drop() - if(!dropped) - var/turf/T = get_turf(src) - new ammo_type(T) - dropped = TRUE diff --git a/code/modules/reagents/reagent_containers/cups/glassbottle.dm b/code/modules/reagents/reagent_containers/cups/glassbottle.dm index 4cbc22fa434..1f82d24b160 100644 --- a/code/modules/reagents/reagent_containers/cups/glassbottle.dm +++ b/code/modules/reagents/reagent_containers/cups/glassbottle.dm @@ -645,14 +645,14 @@ update_appearance() make_froth(offset_x = 0, offset_y = sabraged ? 13 : 15, intensity = froth_severity) //the y offset for sabraged is lower because the bottle's lip is smashed ///Type of cork to fire away - var/obj/projectile/bullet/reusable/cork_to_fire = sabraged ? /obj/projectile/bullet/reusable/champagne_cork/sabrage : /obj/projectile/bullet/reusable/champagne_cork + var/obj/projectile/bullet/cork_to_fire = sabraged ? /obj/projectile/bullet/champagne_cork/sabrage : /obj/projectile/bullet/champagne_cork ///Our resulting cork projectile - var/obj/projectile/bullet/reusable/champagne_cork/popped_cork = new cork_to_fire (drop_location()) + var/obj/projectile/bullet/champagne_cork/popped_cork = new cork_to_fire (drop_location()) popped_cork.firer = user popped_cork.fired_from = src popped_cork.fire(dir2angle(user.dir) + rand(-30, 30)) -/obj/projectile/bullet/reusable/champagne_cork +/obj/projectile/bullet/champagne_cork name = "champagne cork" icon = 'icons/obj/drinks/drink_effects.dmi' icon_state = "champagne_cork" @@ -666,14 +666,18 @@ ricochet_incidence_leeway = 0 range = 7 knockdown = 2 SECONDS - ammo_type = /obj/item/trash/champagne_cork + var/drop_type = /obj/item/trash/champagne_cork -/obj/projectile/bullet/reusable/champagne_cork/sabrage +/obj/projectile/bullet/champagne_cork/Initialize(mapload) + . = ..() + AddElement(/datum/element/projectile_drop, drop_type) + +/obj/projectile/bullet/champagne_cork/sabrage icon_state = "champagne_cork_sabrage" damage = 12 ricochets_max = 2 //bit heavier range = 6 - ammo_type = /obj/item/trash/champagne_cork/sabrage + drop_type = /obj/item/trash/champagne_cork/sabrage /obj/item/trash/champagne_cork name = "champagne cork" diff --git a/code/modules/religion/pyre_rites.dm b/code/modules/religion/pyre_rites.dm index 28ef53968f9..2c541c4ea57 100644 --- a/code/modules/religion/pyre_rites.dm +++ b/code/modules/religion/pyre_rites.dm @@ -125,11 +125,11 @@ invoke_msg = "... a blazing star is born!" favor_cost = 2000 ///arrow to enchant - var/obj/item/ammo_casing/caseless/arrow/holy/enchant_target + var/obj/item/ammo_casing/arrow/holy/enchant_target /datum/religion_rites/blazing_star/perform_rite(mob/living/user, atom/religious_tool) - for(var/obj/item/ammo_casing/caseless/arrow/holy/can_enchant in get_turf(religious_tool)) - if(istype(can_enchant, /obj/item/ammo_casing/caseless/arrow/holy/blazing)) + for(var/obj/item/ammo_casing/arrow/holy/can_enchant in get_turf(religious_tool)) + if(istype(can_enchant, /obj/item/ammo_casing/arrow/holy/blazing)) continue enchant_target = can_enchant return ..() @@ -138,7 +138,7 @@ /datum/religion_rites/blazing_star/invoke_effect(mob/living/user, atom/movable/religious_tool) ..() - var/obj/item/ammo_casing/caseless/arrow/holy/enchanting = enchant_target + var/obj/item/ammo_casing/arrow/holy/enchanting = enchant_target var/turf/tool_turf = get_turf(religious_tool) enchant_target = null if(QDELETED(enchanting) || !(tool_turf == enchanting.loc)) //check if the arrow is still there @@ -146,6 +146,6 @@ return FALSE enchanting.visible_message(span_notice("[enchant_target] is blessed by holy fire!")) playsound(tool_turf, 'sound/effects/pray.ogg', 50, TRUE) - new /obj/item/ammo_casing/caseless/arrow/holy/blazing(tool_turf) + new /obj/item/ammo_casing/arrow/holy/blazing(tool_turf) qdel(enchanting) return TRUE diff --git a/code/modules/research/designs/autolathe/security_designs.dm b/code/modules/research/designs/autolathe/security_designs.dm index 34e0d9445b1..1a41e1aa89e 100644 --- a/code/modules/research/designs/autolathe/security_designs.dm +++ b/code/modules/research/designs/autolathe/security_designs.dm @@ -155,7 +155,7 @@ id = "riot_dart" build_type = AUTOLATHE materials = list(/datum/material/iron =HALF_SHEET_MATERIAL_AMOUNT) //Discount for making individually - no box = less iron! - build_path = /obj/item/ammo_casing/caseless/foam_dart/riot + build_path = /obj/item/ammo_casing/foam_dart/riot category = list( RND_CATEGORY_HACKED, RND_CATEGORY_WEAPONS + RND_SUBCATEGORY_WEAPONS_AMMO, diff --git a/code/modules/uplink/uplink_items/nukeops.dm b/code/modules/uplink/uplink_items/nukeops.dm index 4714935974c..7dfad84d49e 100644 --- a/code/modules/uplink/uplink_items/nukeops.dm +++ b/code/modules/uplink/uplink_items/nukeops.dm @@ -412,14 +412,14 @@ /datum/uplink_item/ammo/rocket/basic name = "84mm HE Rocket" desc = "A low-yield anti-personnel HE rocket. Gonna take you out in style!" - item = /obj/item/ammo_casing/caseless/rocket + item = /obj/item/ammo_casing/rocket cost = 4 /datum/uplink_item/ammo/rocket/heap name = "84mm HEAP Rocket" desc = "A high-yield HEAP rocket; extremely effective against literally everything and anything near that thing that doesn't exist anymore. \ Strike fear into the hearts of your enemies." - item = /obj/item/ammo_casing/caseless/rocket/heap + item = /obj/item/ammo_casing/rocket/heap cost = 6 /datum/uplink_item/ammo/surplus_smg diff --git a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm index 44a0205291d..ae55d68ada1 100644 --- a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm +++ b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm @@ -185,7 +185,7 @@ var/obj/projectile/fired_projectile var/fire_sound if(harmless) - fired_projectile = new /obj/projectile/bullet/reusable/foam_dart(loc) + fired_projectile = new /obj/item/ammo_casing/foam_dart(loc) fired_projectile.icon = 'icons/obj/weapons/guns/toy.dmi' fired_projectile.icon_state = "foamdart_proj" fire_sound = 'sound/items/syringeproj.ogg' diff --git a/modular_skyrat/modules/reagent_forging/code/forge_weapons.dm b/modular_skyrat/modules/reagent_forging/code/forge_weapons.dm index 18263a07e2b..1b056d2e160 100644 --- a/modular_skyrat/modules/reagent_forging/code/forge_weapons.dm +++ b/modular_skyrat/modules/reagent_forging/code/forge_weapons.dm @@ -239,22 +239,22 @@ . = ..() AddComponent(/datum/component/reagent_weapon) -/obj/item/ammo_casing/caseless/arrow/forged +/obj/item/ammo_casing/arrow/forged desc = "An arrow made of wood, typically fired from a bow. It can be reinforced with sinew." - projectile_type = /obj/projectile/bullet/reusable/arrow/forged + projectile_type = /obj/projectile/bullet/arrow/forged -/obj/item/ammo_casing/caseless/arrow/forged/attackby(obj/item/attacking_item, mob/user, params) +/obj/item/ammo_casing/arrow/forged/attackby(obj/item/attacking_item, mob/user, params) if(istype(attacking_item, /obj/item/stack/sheet/sinew)) var/obj/item/stack/stack_item = attacking_item if(!stack_item.use(1)) return - new /obj/item/ammo_casing/caseless/arrow/ash(get_turf(src)) + new /obj/item/ammo_casing/arrow/ash(get_turf(src)) qdel(src) return return ..() -/obj/projectile/bullet/reusable/arrow/forged - ammo_type = /obj/item/ammo_casing/caseless/arrow/forged +/obj/projectile/bullet/arrow/forged + projectile_type = /obj/item/ammo_casing/arrow/forged #define INCREASE_BLOCK_CHANGE 2 diff --git a/modular_skyrat/modules/tribal_extended/code/ammo/caseless/arrow.dm b/modular_skyrat/modules/tribal_extended/code/ammo/caseless/arrow.dm index 09248368d31..d6821ae8a58 100644 --- a/modular_skyrat/modules/tribal_extended/code/ammo/caseless/arrow.dm +++ b/modular_skyrat/modules/tribal_extended/code/ammo/caseless/arrow.dm @@ -1,20 +1,20 @@ -/obj/item/ammo_casing/caseless/arrow/ash +/obj/item/ammo_casing/arrow/ash name = "ashen arrow" desc = "An arrow made from ash and iron. They're cheap, but they fell the beasts of lavaland like none other." icon = 'modular_skyrat/modules/tribal_extended/icons/ammo.dmi' icon_state = "ashenarrow" - projectile_type = /obj/projectile/bullet/reusable/arrow/ash + projectile_type = /obj/projectile/bullet/arrow/ash -/obj/item/ammo_casing/caseless/arrow/bone +/obj/item/ammo_casing/arrow/bone name = "bone arrow" desc = "An arrow made of bone and sinew. The tip is sharp and jagged, suitable for digging into flesh." icon = 'modular_skyrat/modules/tribal_extended/icons/ammo.dmi' icon_state = "bonearrow" - projectile_type = /obj/projectile/bullet/reusable/arrow/bone + projectile_type = /obj/projectile/bullet/arrow/bone -/obj/item/ammo_casing/caseless/arrow/bronze +/obj/item/ammo_casing/arrow/bronze name = "bronze arrow" desc = "An arrow tipped with bronze. Fit for killing gods." icon = 'modular_skyrat/modules/tribal_extended/icons/ammo.dmi' icon_state = "bronzearrow" - projectile_type = /obj/projectile/bullet/reusable/arrow/bronze + projectile_type = /obj/projectile/bullet/arrow/bronze diff --git a/modular_skyrat/modules/tribal_extended/code/ammo/reusable/arrow.dm b/modular_skyrat/modules/tribal_extended/code/ammo/reusable/arrow.dm index 19817984e2e..a4debd87dde 100644 --- a/modular_skyrat/modules/tribal_extended/code/ammo/reusable/arrow.dm +++ b/modular_skyrat/modules/tribal_extended/code/ammo/reusable/arrow.dm @@ -1,21 +1,21 @@ -/obj/projectile/bullet/reusable/arrow +/obj/projectile/bullet/arrow var/faction_bonus_force = 0 //Bonus force dealt against certain factions var/list/nemesis_path //Any mob with a faction that exists in this list will take bonus damage/effects -/obj/projectile/bullet/reusable/arrow/prehit_pierce(mob/living/target, mob/living/carbon/human/user) +/obj/projectile/bullet/arrow/prehit_pierce(mob/living/target, mob/living/carbon/human/user) if(istype(target, nemesis_path)) damage += faction_bonus_force .=..() -/obj/projectile/bullet/reusable/arrow/ash +/obj/projectile/bullet/arrow/ash name = "ashen arrow" desc = "An arrow made of hardened ash." faction_bonus_force = 60 damage = 15//lower me to 20 or 15 nemesis_path = /mob/living/simple_animal/hostile/asteroid - ammo_type = /obj/item/ammo_casing/caseless/arrow/ash + projectile_type = /obj/item/ammo_casing/arrow/ash -/obj/projectile/bullet/reusable/arrow/bone +/obj/projectile/bullet/arrow/bone name = "bone arrow" desc = "An arrow made from bone and sinew." faction_bonus_force = 35 @@ -23,14 +23,14 @@ armour_penetration = 20 wound_bonus = -30 nemesis_path = /mob/living/simple_animal/hostile/asteroid - ammo_type = /obj/item/ammo_casing/caseless/arrow/bone + projectile_type = /obj/item/ammo_casing/arrow/bone embedding = list(embed_chance=33, fall_chance=3, jostle_chance=4, ignore_throwspeed_threshold=TRUE, pain_stam_pct=0.4, pain_mult=5, jostle_pain_mult=6, rip_time=5) -/obj/projectile/bullet/reusable/arrow/bronze +/obj/projectile/bullet/arrow/bronze name = "bronze arrow" desc = "A bronze-tipped arrow." faction_bonus_force = 90 damage = 30 armour_penetration = 30 nemesis_path = /mob/living/simple_animal/hostile/megafauna - ammo_type = /obj/item/ammo_casing/caseless/arrow/bronze + projectile_type = /obj/item/ammo_casing/arrow/bronze diff --git a/modular_skyrat/modules/tribal_extended/code/recipes.dm b/modular_skyrat/modules/tribal_extended/code/recipes.dm index 331fd2bd464..fedb68faff5 100644 --- a/modular_skyrat/modules/tribal_extended/code/recipes.dm +++ b/modular_skyrat/modules/tribal_extended/code/recipes.dm @@ -28,7 +28,7 @@ /datum/crafting_recipe/arrow name = "Arrow" - result = /obj/item/ammo_casing/caseless/arrow + result = /obj/item/ammo_casing/arrow reqs = list( /obj/item/stack/sheet/mineral/wood = 1, /obj/item/stack/sheet/cloth= 1, @@ -39,17 +39,17 @@ /datum/crafting_recipe/bone_arrow name = "Bone Arrow" - result = /obj/item/ammo_casing/caseless/arrow/bone + result = /obj/item/ammo_casing/arrow/bone reqs = list( /obj/item/stack/sheet/bone = 1, - /obj/item/ammo_casing/caseless/arrow/ash = 1, + /obj/item/ammo_casing/arrow/ash = 1, ) time = 1.5 SECONDS category = CAT_WEAPON_AMMO /datum/crafting_recipe/ashen_arrow name = "Ashen Arrow" - result = /obj/item/ammo_casing/caseless/arrow/ash + result = /obj/item/ammo_casing/arrow/ash reqs = list( /obj/item/stack/rods = 2, /obj/item/stack/sheet/sinew = 1, @@ -60,9 +60,9 @@ /datum/crafting_recipe/bronze_arrow name = "Bronze arrow" - result = /obj/item/ammo_casing/caseless/arrow/bronze + result = /obj/item/ammo_casing/arrow/bronze reqs = list( - /obj/item/ammo_casing/caseless/arrow/ash = 1, + /obj/item/ammo_casing/arrow/ash = 1, /obj/item/stack/tile/bronze = 1, ) time = 1.5 SECONDS diff --git a/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_reward.dm b/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_reward.dm index 1391b4363ac..037d1949327 100644 --- a/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_reward.dm +++ b/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_reward.dm @@ -42,7 +42,7 @@ GLOBAL_LIST_INIT(tech_reward, list( GLOBAL_LIST_INIT(weapon_reward, list( /obj/item/spear/bonespear = 6, /obj/item/gun/ballistic/bow/tribalbow/ashen = 2, - /obj/item/ammo_casing/caseless/arrow/ash = 1, + /obj/item/ammo_casing/arrow/ash = 1, /obj/item/claymore/cutlass = 1, /obj/item/gun/ballistic/automatic/pistol = 1, /obj/item/shield/riot = 1, diff --git a/tgstation.dme b/tgstation.dme index 92f48eca0ff..2e452a28dd7 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1256,6 +1256,7 @@ #include "code\datums\elements\bsa_blocker.dm" #include "code\datums\elements\bump_click.dm" #include "code\datums\elements\can_barricade.dm" +#include "code\datums\elements\caseless.dm" #include "code\datums\elements\chemical_transfer.dm" #include "code\datums\elements\chewable.dm" #include "code\datums\elements\cleaning.dm" @@ -1319,6 +1320,7 @@ #include "code\datums\elements\plant_backfire.dm" #include "code\datums\elements\point_of_interest.dm" #include "code\datums\elements\prevent_attacking_of_types.dm" +#include "code\datums\elements\projectile_drop.dm" #include "code\datums\elements\projectile_shield.dm" #include "code\datums\elements\radiation_protected_clothing.dm" #include "code\datums\elements\radioactive.dm" @@ -4650,18 +4652,16 @@ #include "code\modules\projectiles\projectile.dm" #include "code\modules\projectiles\ammunition\_ammunition.dm" #include "code\modules\projectiles\ammunition\_firing.dm" +#include "code\modules\projectiles\ammunition\ballistic\foam.dm" +#include "code\modules\projectiles\ammunition\ballistic\harpoon.dm" #include "code\modules\projectiles\ammunition\ballistic\lmg.dm" #include "code\modules\projectiles\ammunition\ballistic\pistol.dm" #include "code\modules\projectiles\ammunition\ballistic\revolver.dm" #include "code\modules\projectiles\ammunition\ballistic\rifle.dm" +#include "code\modules\projectiles\ammunition\ballistic\rocket.dm" #include "code\modules\projectiles\ammunition\ballistic\shotgun.dm" #include "code\modules\projectiles\ammunition\ballistic\smg.dm" #include "code\modules\projectiles\ammunition\ballistic\sniper.dm" -#include "code\modules\projectiles\ammunition\caseless\_caseless.dm" -#include "code\modules\projectiles\ammunition\caseless\energy.dm" -#include "code\modules\projectiles\ammunition\caseless\foam.dm" -#include "code\modules\projectiles\ammunition\caseless\harpoon.dm" -#include "code\modules\projectiles\ammunition\caseless\rocket.dm" #include "code\modules\projectiles\ammunition\energy\_energy.dm" #include "code\modules\projectiles\ammunition\energy\ebow.dm" #include "code\modules\projectiles\ammunition\energy\gravity.dm" @@ -4732,6 +4732,7 @@ #include "code\modules\projectiles\projectile\bullets\cannonball.dm" #include "code\modules\projectiles\projectile\bullets\dart_syringe.dm" #include "code\modules\projectiles\projectile\bullets\dnainjector.dm" +#include "code\modules\projectiles\projectile\bullets\foam_dart.dm" #include "code\modules\projectiles\projectile\bullets\grenade.dm" #include "code\modules\projectiles\projectile\bullets\lmg.dm" #include "code\modules\projectiles\projectile\bullets\pistol.dm" @@ -4751,8 +4752,6 @@ #include "code\modules\projectiles\projectile\energy\stun.dm" #include "code\modules\projectiles\projectile\energy\tesla.dm" #include "code\modules\projectiles\projectile\energy\thermal.dm" -#include "code\modules\projectiles\projectile\reusable\_reusable.dm" -#include "code\modules\projectiles\projectile\reusable\foam_dart.dm" #include "code\modules\projectiles\projectile\special\curse.dm" #include "code\modules\projectiles\projectile\special\floral.dm" #include "code\modules\projectiles\projectile\special\gravity.dm" diff --git a/tools/UpdatePaths/Scripts/76335_remove_caseless.txt b/tools/UpdatePaths/Scripts/76335_remove_caseless.txt new file mode 100644 index 00000000000..ed860236676 --- /dev/null +++ b/tools/UpdatePaths/Scripts/76335_remove_caseless.txt @@ -0,0 +1,3 @@ +#replaced by elements + +/obj/item/ammo_casing/caseless/@SUBTYPES : /obj/item/ammo_casing/@SUBTYPES{@OLD} \ No newline at end of file