Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repaths /obj/item/projectile -> /obj/projectile #4377

Merged
merged 3 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define COMSIG_HUMAN_REVIVED "human_revived"
/// From /mob/living/carbon/human/bullet_act
#define COMSIG_HUMAN_PRE_BULLET_ACT "human_pre_bullet_act"
/// From /mob/living/carbon/human/bullet_act(): (damage_result, ammo_flags, obj/item/projectile/P)
/// From /mob/living/carbon/human/bullet_act(): (damage_result, ammo_flags, obj/projectile/P)
#define COMSIG_HUMAN_BULLET_ACT "human_bullet_act"
#define COMPONENT_CANCEL_BULLET_ACT (1<<0)

Expand Down
12 changes: 6 additions & 6 deletions code/__DEFINES/dcs/signals/atom/signals_projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
#define COMSIG_AMMO_POINT_BLANK "ammo_point_blank"
#define COMPONENT_CANCEL_AMMO_POINT_BLANK (1<<0)

/// From /obj/item/projectile/handle_mob(): (mob/living/target)
/// From /obj/projectile/handle_mob(): (mob/living/target)
#define COMSIG_BULLET_PRE_HANDLE_MOB "bullet_pre_handle_mob"
/// From /obj/item/projectile/handle_mob(): (mob/living/target)
/// From /obj/projectile/handle_mob(): (mob/living/target)
#define COMSIG_BULLET_POST_HANDLE_MOB "bullet_post_handle_mob"
/// From /obj/item/projectile/handle_obj(): (obj/target, did_hit)
/// From /obj/projectile/handle_obj(): (obj/target, did_hit)
#define COMSIG_BULLET_POST_HANDLE_OBJ "bullet_post_handle_obj"
/// From /obj/item/projectile/handle_obj(): (obj/target)
/// From /obj/projectile/handle_obj(): (obj/target)
#define COMSIG_BULLET_PRE_HANDLE_OBJ "bullet_pre_handle_obj"
/// From /obj/item/projectile/scan_a_turf(): (turf/target)
/// From /obj/projectile/scan_a_turf(): (turf/target)
#define COMSIG_BULLET_POST_HANDLE_TURF "bullet_post_handle_turf"
/// From /obj/item/projectile/scan_a_turf(): (turf/target)
/// From /obj/projectile/scan_a_turf(): (turf/target)
#define COMSIG_BULLET_PRE_HANDLE_TURF "bullet_pre_handle_turf"
#define COMPONENT_BULLET_PASS_THROUGH (1<<0)
#define COMSIG_BULLET_TERMINAL "bullet_terminal"
Expand Down
16 changes: 8 additions & 8 deletions code/controllers/subsystem/projectiles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ SUBSYSTEM_DEF(projectiles)
priority = SS_PRIORITY_PROJECTILES

/// List of projectiles handled by the subsystem
VAR_PRIVATE/list/obj/item/projectile/projectiles
VAR_PRIVATE/list/obj/projectile/projectiles
/// List of projectiles on hold due to sleeping
VAR_PRIVATE/list/obj/item/projectile/sleepers
VAR_PRIVATE/list/obj/projectile/sleepers
/// List of projectiles handled this controller firing
VAR_PRIVATE/list/obj/item/projectile/flying
VAR_PRIVATE/list/obj/projectile/flying

/*
* Scheduling notes:
Expand Down Expand Up @@ -42,14 +42,14 @@ SUBSYSTEM_DEF(projectiles)
flying = projectiles.Copy()
flying -= sleepers
while(flying.len)
var/obj/item/projectile/projectile = flying[flying.len]
var/obj/projectile/projectile = flying[flying.len]
flying.len--
var/delta_time = wait * world.tick_lag * (1 SECONDS)
handle_projectile_flight(projectile, delta_time)
if(MC_TICK_CHECK)
return

/datum/controller/subsystem/projectiles/proc/handle_projectile_flight(obj/item/projectile/projectile, delta_time)
/datum/controller/subsystem/projectiles/proc/handle_projectile_flight(obj/projectile/projectile, delta_time)
PRIVATE_PROC(TRUE)
set waitfor = FALSE
// We're in double-check land here because there ARE rulebreakers.
Expand All @@ -66,15 +66,15 @@ SUBSYSTEM_DEF(projectiles)
stop_projectile(projectile) // Ideally this was already done thru process()
qdel(projectile)

/datum/controller/subsystem/projectiles/proc/process_wrapper(obj/item/projectile/projectile, delta_time)
/datum/controller/subsystem/projectiles/proc/process_wrapper(obj/projectile/projectile, delta_time)
// set waitfor=TRUE
. = PROC_RETURN_SLEEP
. = projectile.process(delta_time)
sleepers -= projectile // Recover from sleep

/datum/controller/subsystem/projectiles/proc/queue_projectile(obj/item/projectile/projectile)
/datum/controller/subsystem/projectiles/proc/queue_projectile(obj/projectile/projectile)
projectiles |= projectile
/datum/controller/subsystem/projectiles/proc/stop_projectile(obj/item/projectile/projectile)
/datum/controller/subsystem/projectiles/proc/stop_projectile(obj/projectile/projectile)
projectiles -= projectile
flying -= projectile // avoids problems with deleted projs
projectile.speed = 0
2 changes: 1 addition & 1 deletion code/datums/components/cluster_stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
SIGNAL_HANDLER
L += "Cluster Stack: [cluster_stacks]/[MAX_CLUSTER_STACKS]"

/datum/component/cluster_stack/proc/apply_cluster_stacks(mob/living/L, damage_result, ammo_flags, obj/item/projectile/P)
/datum/component/cluster_stack/proc/apply_cluster_stacks(mob/living/L, damage_result, ammo_flags, obj/projectile/P)
SIGNAL_HANDLER
if(cluster_stacks >= MAX_CLUSTER_STACKS)
var/old_dmg_cont = damage_counter
Expand Down
4 changes: 2 additions & 2 deletions code/datums/elements/bullet_trait/bullet_trait.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# A PROTOTYPE FOR MAKING ANY BULLET TRAITS

Element representing traits that can be applied to bullets upon being fired
* Must be attached to a projectile (`/obj/item/projectile` in `projectile.dm`)
* Must be attached to a projectile (`/obj/projectile` in `projectile.dm`)
* Allows for the customization of bullet behavior based on ammo types or guns (or other things)

By convention, bullet_traits should be named bullet_trait_[insert rest of name here]
Expand All @@ -16,7 +16,7 @@ By convention, bullet_traits should be named bullet_trait_[insert rest of name h
/datum/element/bullet_trait/databaseAttach(datum/target)
. = ..()
// All bullet traits can only be applied to projectiles
if(!istype(target, /obj/item/projectile))
if(!istype(target, /obj/projectile))
return ELEMENT_INCOMPATIBLE

[handling here]
Expand Down
4 changes: 2 additions & 2 deletions code/datums/elements/bullet_trait/damage_boost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ GLOBAL_LIST_INIT(damage_boost_vehicles, typecacheof(/obj/vehicle/multitile))
*/
/datum/element/bullet_trait_damage_boost/Attach(datum/target, damage_mult, list/damage_boosted_atoms)
. = ..()
if(!istype(target, /obj/item/projectile))
if(!istype(target, /obj/projectile))
return ELEMENT_INCOMPATIBLE

src.damage_mult = damage_mult
Expand All @@ -66,7 +66,7 @@ GLOBAL_LIST_INIT(damage_boost_vehicles, typecacheof(/obj/vehicle/multitile))
//add more cases for other interactions (switch doesn't seem to work with istype)
else return 0

/datum/element/bullet_trait_damage_boost/proc/handle_bullet(obj/item/projectile/P, atom/A)
/datum/element/bullet_trait_damage_boost/proc/handle_bullet(obj/projectile/P, atom/A)
SIGNAL_HANDLER

atom_type = check_type(A)
Expand Down
6 changes: 3 additions & 3 deletions code/datums/elements/bullet_trait/iff.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// This is the iff_group
/obj/item/projectile/var/runtime_iff_group
/obj/projectile/var/runtime_iff_group

/datum/element/bullet_trait_iff
// General bullet trait vars
Expand All @@ -13,7 +13,7 @@

/datum/element/bullet_trait_iff/Attach(datum/target, iff_group)
. = ..()
if(!istype(target, /obj/item/projectile))
if(!istype(target, /obj/projectile))
return ELEMENT_INCOMPATIBLE

if(!iff_group)
Expand All @@ -39,7 +39,7 @@
/datum/element/bullet_trait_iff/proc/set_iff(datum/target, mob/living/carbon/human/firer)
SIGNAL_HANDLER

var/obj/item/projectile/P = target
var/obj/projectile/P = target
P.runtime_iff_group = get_user_iff_group(firer)

// We have a "cache" to avoid getting ID card iff every shot,
Expand Down
4 changes: 2 additions & 2 deletions code/datums/elements/bullet_trait/ignored_range.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/datum/element/bullet_trait_ignored_range/Attach(datum/target, range_to_ignore)
. = ..()
ignored_range = range_to_ignore
if(!istype(target, /obj/item/projectile))
if(!istype(target, /obj/projectile))
return ELEMENT_INCOMPATIBLE

RegisterSignal(target, COMSIG_BULLET_CHECK_MOB_SKIPPING, PROC_REF(check_distance))
Expand All @@ -22,7 +22,7 @@

return ..()

/datum/element/bullet_trait_ignored_range/proc/check_distance(obj/item/projectile/P, mob/living/carbon/human/projectile_target)
/datum/element/bullet_trait_ignored_range/proc/check_distance(obj/projectile/P, mob/living/carbon/human/projectile_target)
SIGNAL_HANDLER

if(P.distance_travelled <= ignored_range)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/bullet_trait/incendiary.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/datum/element/bullet_trait_incendiary/Attach(datum/target, reagent = /datum/reagent/napalm/ut, stacks = 20)
. = ..()
if(!istype(target, /obj/item/projectile))
if(!istype(target, /obj/projectile))
return ELEMENT_INCOMPATIBLE

if(ispath(reagent))
Expand Down
4 changes: 2 additions & 2 deletions code/datums/elements/bullet_trait/penetrating/heavy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

src.damage_lost_per_pen = damage_lost_per_pen

/datum/element/bullet_trait_penetrating/heavy/handle_passthrough_movables(obj/item/projectile/bullet, atom/movable/hit_movable, did_hit)
/datum/element/bullet_trait_penetrating/heavy/handle_passthrough_movables(obj/projectile/bullet, atom/movable/hit_movable, did_hit)
if(did_hit)
var/slow_mult = 1
if(ismob(hit_movable))
Expand All @@ -35,7 +35,7 @@

return COMPONENT_BULLET_PASS_THROUGH

/datum/element/bullet_trait_penetrating/heavy/handle_passthrough_turf(obj/item/projectile/bullet, turf/closed/wall/hit_wall)
/datum/element/bullet_trait_penetrating/heavy/handle_passthrough_turf(obj/projectile/bullet, turf/closed/wall/hit_wall)
bullet.distance_travelled += distance_loss_per_hit
bullet.damage -= damage_lost_per_pen

Expand Down
6 changes: 3 additions & 3 deletions code/datums/elements/bullet_trait/penetrating/penetrating.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/datum/element/bullet_trait_penetrating/Attach(datum/target, distance_loss_per_hit = 3)
. = ..()
if(!istype(target, /obj/item/projectile))
if(!istype(target, /obj/projectile))
return ELEMENT_INCOMPATIBLE

src.distance_loss_per_hit = distance_loss_per_hit
Expand All @@ -27,13 +27,13 @@
))
return ..()

/datum/element/bullet_trait_penetrating/proc/handle_passthrough_movables(obj/item/projectile/P, atom/movable/A, did_hit)
/datum/element/bullet_trait_penetrating/proc/handle_passthrough_movables(obj/projectile/P, atom/movable/A, did_hit)
SIGNAL_HANDLER
if(did_hit)
P.distance_travelled += distance_loss_per_hit
return COMPONENT_BULLET_PASS_THROUGH

/datum/element/bullet_trait_penetrating/proc/handle_passthrough_turf(obj/item/projectile/P, turf/closed/wall/T)
/datum/element/bullet_trait_penetrating/proc/handle_passthrough_turf(obj/projectile/P, turf/closed/wall/T)
SIGNAL_HANDLER
P.distance_travelled += distance_loss_per_hit

Expand Down
2 changes: 1 addition & 1 deletion code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
/atom/movable/clone/get_examine_text(mob/user)
return src.mstr.get_examine_text(user)

/atom/movable/clone/bullet_act(obj/item/projectile/P)
/atom/movable/clone/bullet_act(obj/projectile/P)
return src.mstr.bullet_act(P)
/////////////////////

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/atmoalter/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ update_flag
density = FALSE
update_icon()

/obj/structure/machinery/portable_atmospherics/canister/bullet_act(obj/item/projectile/Proj)
/obj/structure/machinery/portable_atmospherics/canister/bullet_act(obj/projectile/Proj)
if(Proj.ammo.damage)
update_health(round(Proj.ammo.damage / 2))
..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/bots/bots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
else
..()

/obj/structure/machinery/bot/bullet_act(obj/item/projectile/Proj)
/obj/structure/machinery/bot/bullet_act(obj/projectile/Proj)
health -= Proj.ammo.damage
..()
healthcheck()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/HolodeckControl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
/obj/structure/holohoop/BlockedPassDirs(atom/movable/mover, target_dir)
if(istype(mover,/obj/item) && mover.throwing)
var/obj/item/I = mover
if(istype(I, /obj/item/projectile))
if(istype(I, /obj/projectile))
return BLOCKED_MOVEMENT
if(prob(50))
I.forceMove(src.loc)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
else
return

/obj/structure/machinery/computer/bullet_act(obj/item/projectile/Proj)
/obj/structure/machinery/computer/bullet_act(obj/projectile/Proj)
if(exproof)
visible_message("[Proj] ricochets off [src]!")
return 0
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list(
else
return FALSE

/obj/structure/machinery/door/airlock/bullet_act(obj/item/projectile/P)
/obj/structure/machinery/door/airlock/bullet_act(obj/projectile/P)
bullet_ping(P)
if(P.damage)
if(P.ammo.flags_ammo_behavior & AMMO_ROCKET)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
qdel(src)
return

/obj/structure/machinery/door/window/bullet_act(obj/item/projectile/Proj)
/obj/structure/machinery/door/window/bullet_act(obj/projectile/Proj)
bullet_ping(Proj)
if(Proj.ammo.damage)
take_damage(round(Proj.ammo.damage / 2))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/telecomms/presets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
if(!on)
msg_admin_niche("Portable communication relay shut down for Z-Level [src.z] [ADMIN_JMP(src)]")

/obj/structure/machinery/telecomms/relay/preset/tower/bullet_act(obj/item/projectile/P)
/obj/structure/machinery/telecomms/relay/preset/tower/bullet_act(obj/projectile/P)
..()
if(istype(P.ammo, /datum/ammo/xeno/boiler_gas))
update_health(50)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/decals/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
deconstruct(FALSE)
return

/obj/effect/decal/mecha_wreckage/bullet_act(obj/item/projectile/Proj)
/obj/effect/decal/mecha_wreckage/bullet_act(obj/projectile/Proj)
return 1

/obj/effect/decal/mecha_wreckage/attack_alien(mob/living/carbon/xenomorph/M)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/effect_system/foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
/obj/structure/foamed_metal/ex_act(severity)
take_damage(severity * FOAMED_METAL_EXPLOSION_DMG)

/obj/structure/foamed_metal/bullet_act(obj/item/projectile/P)
/obj/structure/foamed_metal/bullet_act(obj/projectile/P)
if(P.ammo.damage_type == HALLOSS || P.ammo.damage_type == TOX || P.ammo.damage_type == CLONE || P.damage == 0)
return

Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/effect_system/smoke.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@

/obj/effect/particle_effect/smoke/Crossed(atom/movable/M)
..()
if(istype(M, /obj/item/projectile/beam))
var/obj/item/projectile/beam/B = M
if(istype(M, /obj/projectile/beam))
var/obj/projectile/beam/B = M
B.damage = (B.damage/2)
if(iscarbon(M))
affect(M)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/spiders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
health -= damage
healthcheck()

/obj/effect/spider/bullet_act(obj/item/projectile/Proj)
/obj/effect/spider/bullet_act(obj/projectile/Proj)
..()
health -= Proj.ammo.damage
healthcheck()
Expand Down Expand Up @@ -67,7 +67,7 @@
if(prob(50))
to_chat(mover, SPAN_WARNING("You get stuck in [src] for a moment."))
return BLOCKED_MOVEMENT
else if(istype(mover, /obj/item/projectile))
else if(istype(mover, /obj/projectile))
if(prob(30))
return BLOCKED_MOVEMENT
return NO_BLOCKED_MOVEMENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var/isGlass = TRUE
black_market_value = 25

/obj/item/reagent_container/food/drinks/bottle/bullet_act(obj/item/projectile/P)
/obj/item/reagent_container/food/drinks/bottle/bullet_act(obj/projectile/P)
. = ..()
if(isGlass)
smash()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@

return

/obj/item/reagent_container/food/drinks/drinkingglass/bullet_act(obj/item/projectile/P)
/obj/item/reagent_container/food/drinks/drinkingglass/bullet_act(obj/projectile/P)
. = ..()
smash()

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/shards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@


// Shrapnel.
// on_embed is called from projectile.dm, bullet_act(obj/item/projectile/P).
// on_embed is called from projectile.dm, bullet_act(obj/projectile/P).
// on_embedded_movement is called from human.dm, handle_embedded_objects().

/obj/item/large_shrapnel/proc/on_embedded_movement(mob/living/embedded_mob)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/tools/maintenance_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ Welding backpack
else
. += "No punctures are seen on \the [src] upon closer inspection."

/obj/item/tool/weldpack/bullet_act(obj/item/projectile/P)
/obj/item/tool/weldpack/bullet_act(obj/projectile/P)
var/damage = P.damage
health -= damage
..()
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
edge = 0
var/icon/broken_outline = icon('icons/obj/items/drinks.dmi', "broken")

/obj/item/weapon/broken_bottle/bullet_act(obj/item/projectile/P)
/obj/item/weapon/broken_bottle/bullet_act(obj/projectile/P)
. = ..()
new/obj/item/shard(src.loc)
new/obj/item/shard(src.loc)
Expand All @@ -50,7 +50,7 @@
edge = 0
var/icon/broken_outline = icon('icons/obj/items/drinks.dmi', "broken")

/obj/item/weapon/broken_glass/bullet_act(obj/item/projectile/P)
/obj/item/weapon/broken_glass/bullet_act(obj/projectile/P)
. = ..()
new/obj/item/shard(src.loc)
new/obj/item/shard(src.loc)
Expand Down
Loading