Repathed /obj/item/projectile to /obj/projectile (#19693)

Repathed /obj/item/projectile to /obj/projectile, same as TG and Bay,
that's pretty much it.
This commit is contained in:
Fluffy
2024-07-27 10:09:46 +00:00
committed by GitHub
parent 2a8d6acd86
commit 3e1b9d4170
214 changed files with 1014 additions and 971 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ They should also be used for when you want to effect the ENTIRE mob, like having
/obj/aura/attackby(obj/item/attacking_item, mob/user)
return FALSE
/obj/aura/bullet_act(obj/item/projectile/P, def_zone)
/obj/aura/bullet_act(obj/projectile/P, def_zone)
return FALSE
/obj/aura/hitby(atom/movable/M, speed)
+1 -1
View File
@@ -8,7 +8,7 @@
playsound(user, 'sound/weapons/flash.ogg', 35, 1)
to_chat(user, SPAN_NOTICE("You feel your body prickle as \the [src] comes online."))
/obj/aura/personal_shield/bullet_act(obj/item/projectile/P, var/def_zone)
/obj/aura/personal_shield/bullet_act(obj/projectile/P, var/def_zone)
user.visible_message(SPAN_WARNING("\The [user]'s [src.name] flashes before \the [P] can hit them!"))
flick("shield_impact", src)
+1 -1
View File
@@ -14,7 +14,7 @@
to_chat(user, SPAN_WARNING("Your protective aura dissipates, leaving you feeling cold and unsafe."))
return ..()
/obj/aura/radiant_aura/bullet_act(obj/item/projectile/P, var/def_zone)
/obj/aura/radiant_aura/bullet_act(obj/projectile/P, var/def_zone)
if(P.check_armor == LASER)
user.visible_message(SPAN_WARNING("\The [P] refracts, bending into \the [user]'s aura."))
return AURA_FALSE
+2 -2
View File
@@ -178,8 +178,8 @@ steam.start() -- spawns the effect
/obj/effect/effect/smoke/bad/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover, /obj/item/projectile/beam))
var/obj/item/projectile/beam/B = mover
if(istype(mover, /obj/projectile/beam))
var/obj/projectile/beam/B = mover
B.damage = (B.damage/2)
return 1
/////////////////////////////////////////////
+2 -2
View File
@@ -37,7 +37,7 @@
health -= damage
healthcheck()
/obj/effect/spider/bullet_act(var/obj/item/projectile/Proj)
/obj/effect/spider/bullet_act(var/obj/projectile/Proj)
..()
health -= Proj.get_structure_damage()
healthcheck()
@@ -75,7 +75,7 @@
if(prob(50))
to_chat(mover, SPAN_WARNING("You get stuck in \the [src] for a moment."))
return FALSE
else if(istype(mover, /obj/item/projectile))
else if(istype(mover, /obj/projectile))
return prob(30)
return TRUE
+1 -1
View File
@@ -291,7 +291,7 @@
t_air.merge(inside_air)
// When we shoot bubble, make it rip.
/obj/structure/closet/airbubble/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/closet/airbubble/bullet_act(var/obj/projectile/Proj)
..()
ripped = TRUE
update_icon()
@@ -107,7 +107,7 @@
else
..()
/obj/item/device/magnetic_lock/bullet_act(var/obj/item/projectile/Proj)
/obj/item/device/magnetic_lock/bullet_act(var/obj/projectile/Proj)
takedamage(Proj.damage)
..()
+2 -2
View File
@@ -48,7 +48,7 @@
desc = "A shooting target with a threatening silhouette."
hp = 2350 // alium onest too kinda
/obj/item/target/bullet_act(var/obj/item/projectile/Proj)
/obj/item/target/bullet_act(var/obj/projectile/Proj)
var/p_x = Proj.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset Proj.p_x!"
var/p_y = Proj.p_y + pick(0,0,0,0,0,-1,1)
var/decaltype = (Proj.damage_flags & DAMAGE_FLAG_BULLET) ? DECAL_BULLET : DECAL_SCORCH
@@ -75,7 +75,7 @@
bmark.pixel_x--
bmark.pixel_y--
if(Proj.damage >= 20 || istype(Proj, /obj/item/projectile/beam/practice))
if(Proj.damage >= 20 || istype(Proj, /obj/projectile/beam/practice))
bmark.icon_state = "scorch"
bmark.set_dir(pick(NORTH,SOUTH,EAST,WEST)) // random scorch design
else
@@ -7,7 +7,7 @@
for(var/turf/T in target_turfs)
sleep(0)
var/obj/item/projectile/bullet/pellet/fragment/P = new (O)
var/obj/projectile/bullet/pellet/fragment/P = new (O)
P.damage = p_dam
P.pellets = fragments_per_projectile
@@ -28,7 +28,7 @@
P.attack_mob(M, 0, 100) //otherwise, allow a decent amount of fragments to pass
//Fragmentation grenade projectile
/obj/item/projectile/bullet/pellet/fragment
/obj/projectile/bullet/pellet/fragment
damage = 20
armor_penetration = 35
range_step = 2
@@ -37,7 +37,6 @@
spread_step = 20
suppressed = TRUE //embedding messages are still produced so it's kind of weird when enabled.
no_attack_log = 1
muzzle_type = null
/obj/item/grenade/frag
@@ -1,5 +1,5 @@
///Stinger grenade projectile
/obj/item/projectile/bullet/rubberball/stinger_ball
/obj/projectile/bullet/rubberball/stinger_ball
damage = 2
agony = 50
armor_penetration = 10
@@ -10,7 +10,6 @@
spread_step = 20
suppressed = TRUE //embedding messages are still produced so it's kind of weird when enabled.
no_attack_log = 1
muzzle_type = null
/obj/item/grenade/stinger
@@ -34,7 +33,7 @@
var/fragments_per_projectile = round(fragger/target_turfs.len)
for(var/turf/T in target_turfs)
var/obj/item/projectile/bullet/rubberball/stinger_ball/P = new (O)
var/obj/projectile/bullet/rubberball/stinger_ball/P = new (O)
P.damage = p_dam
P.balls = fragments_per_projectile
+1 -1
View File
@@ -471,7 +471,7 @@
for(var/i = 0; i < SHOTS_TO_LAUNCH; i++)
var/turf/to_hit = pick(candidate_turfs)
var/obj/item/projectile/bullet/pellet/shotgun/pellet = new(get_turf(src))
var/obj/projectile/bullet/pellet/shotgun/pellet = new(get_turf(src))
pellet.fire(Get_Angle(get_turf(src), to_hit))
qdel(src)
@@ -89,8 +89,8 @@
shield_power = 0
return FALSE
if(istype(damage_source, /obj/item/projectile/energy) || istype(damage_source, /obj/item/projectile/beam))
var/obj/item/projectile/P = damage_source
if(istype(damage_source, /obj/projectile/energy) || istype(damage_source, /obj/projectile/beam))
var/obj/projectile/P = damage_source
var/reflectchance = base_reflectchance - round(damage/3)
if(!(def_zone in list(BP_CHEST, BP_GROIN,BP_HEAD)))
@@ -111,7 +111,7 @@
user.visible_message(SPAN_DANGER("\The [user] blocks [attack_text] with \the [src]!"))
return PROJECTILE_STOPPED
else if(istype(damage_source, /obj/item/projectile/bullet) && can_block_bullets)
else if(istype(damage_source, /obj/projectile/bullet) && can_block_bullets)
var/reflectchance = (base_reflectchance) - round(damage/3)
if(!(def_zone in list(BP_CHEST, BP_GROIN,BP_HEAD)))
reflectchance /= 2
+10 -10
View File
@@ -5,8 +5,8 @@
/proc/check_shield_arc(mob/user, bad_arc, atom/damage_source = null, mob/attacker = null)
//check attack direction
var/attack_dir = 0 //direction from the user to the source of the attack
if(istype(damage_source, /obj/item/projectile))
var/obj/item/projectile/P = damage_source
if(istype(damage_source, /obj/projectile))
var/obj/projectile/P = damage_source
attack_dir = get_dir(get_turf(user), P.starting)
else if(attacker)
attack_dir = get_dir(get_turf(user), get_turf(attacker))
@@ -19,7 +19,7 @@
/proc/default_parry_check(mob/user, mob/attacker, atom/damage_source)
//parry only melee attacks
if(istype(damage_source, /obj/item/projectile) || (attacker && get_dist(user, attacker) > 1) || user.incapacitated())
if(istype(damage_source, /obj/projectile) || (attacker && get_dist(user, attacker) > 1) || user.incapacitated())
return 0
//block as long as they are not directly behind us
@@ -77,10 +77,10 @@
if(.) playsound(user.loc, 'sound/weapons/Genhit.ogg', 50, 1)
/obj/item/shield/riot/get_block_chance(mob/user, var/damage, atom/damage_source = null, mob/attacker = null)
if(istype(damage_source, /obj/item/projectile))
var/obj/item/projectile/P = damage_source
if(istype(damage_source, /obj/projectile))
var/obj/projectile/P = damage_source
//plastic shields do not stop bullets or lasers, even in space. Will block beanbags, rubber bullets, and stunshots just fine though.
if((is_sharp(P) && damage > 10) || istype(P, /obj/item/projectile/beam))
if((is_sharp(P) && damage > 10) || istype(P, /obj/projectile/beam))
return 0
return base_block_chance
@@ -116,9 +116,9 @@
if(.) playsound(user.loc, 'sound/weapons/Genhit.ogg', 50, 1)
/obj/item/shield/buckler/get_block_chance(mob/user, var/damage, atom/damage_source = null, mob/attacker = null)
if(istype(damage_source, /obj/item/projectile))
var/obj/item/projectile/P = damage_source
if((is_sharp(P) && damage > 10) || istype(P, /obj/item/projectile/beam))
if(istype(damage_source, /obj/projectile))
var/obj/projectile/P = damage_source
if((is_sharp(P) && damage > 10) || istype(P, /obj/projectile/beam))
return 0
return base_block_chance
@@ -192,7 +192,7 @@
HandleShutOff()
if(isenergy(damage_source) || isbeam(damage_source))
var/obj/item/projectile/P = damage_source
var/obj/projectile/P = damage_source
var/reflectchance = 80 - (damage/3)
if(P.starting && prob(reflectchance))
+1 -1
View File
@@ -574,7 +574,7 @@
new /obj/item/stack/material/steel(get_turf(src))
qdel(src)
/obj/item/trap/animal/bullet_act(var/obj/item/projectile/Proj)
/obj/item/trap/animal/bullet_act(var/obj/projectile/Proj)
var/mob/living/captured_mob = captured ? captured.resolve() : null
if(captured_mob)
captured_mob.bullet_act(Proj)
+1 -1
View File
@@ -74,7 +74,7 @@
qdel(src)
return
/obj/effect/energy_net/bullet_act(var/obj/item/projectile/Proj)
/obj/effect/energy_net/bullet_act(var/obj/projectile/Proj)
health -= Proj.get_structure_damage()
health_check()
return FALSE
+1 -1
View File
@@ -78,7 +78,7 @@
dismantle_material.place_sheet(loc)
qdel(src)
/obj/structure/bullet_act(obj/item/projectile/P, def_zone)
/obj/structure/bullet_act(obj/projectile/P, def_zone)
. = ..()
bullet_ping(P)
@@ -85,14 +85,14 @@
/obj/structure/barricade/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0))
return TRUE
if(istype(mover, /obj/item/projectile))
if(istype(mover, /obj/projectile))
return (check_cover(mover,target))
if (get_dir(loc, target) == dir)
return !density
else
return TRUE
/obj/structure/barricade/proc/check_cover(obj/item/projectile/P, turf/from)
/obj/structure/barricade/proc/check_cover(obj/projectile/P, turf/from)
var/turf/cover = get_turf(src)
if(!cover)
return TRUE
@@ -197,7 +197,7 @@
playsound(src, barricade_hitsound, 25, 1)
hit_barricade(attacking_item, user)
/obj/structure/barricade/bullet_act(obj/item/projectile/P)
/obj/structure/barricade/bullet_act(obj/projectile/P)
bullet_ping(P)
var/damage_to_take = P.damage * P.anti_materiel_potential
take_damage(damage_to_take)
@@ -316,12 +316,12 @@
new /obj/item/stack/material/steel(get_turf(src))
qdel(src)
/obj/structure/closet/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/closet/bullet_act(var/obj/projectile/Proj)
var/proj_damage = Proj.get_structure_damage()
if(!proj_damage)
return
if(Proj.penetrating || istype(Proj, /obj/item/projectile/bullet))
if(Proj.penetrating || istype(Proj, /obj/projectile/bullet))
var/distance = get_dist(Proj.starting, get_turf(loc))
for(var/mob/living/L in contents)
Proj.attack_mob(L, distance)
@@ -124,7 +124,7 @@
for(var/mob/M in src)
shatter(M)
/obj/structure/closet/statue/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/closet/statue/bullet_act(var/obj/projectile/Proj)
health -= Proj.get_structure_damage()
check_health()
@@ -103,7 +103,7 @@
return TRUE
else
return FALSE
if (istype(mover,/obj/item/projectile))
if (istype(mover,/obj/projectile))
// Crates on a table always block shots, otherwise they only occasionally do so.
return tablestatus == ABOVE_TABLE ? FALSE : (prob(15) ? FALSE : TRUE)
else if((istype(mover) && (mover.pass_flags & PASSTABLE)) && tablestatus == ABOVE_TABLE)
+1 -1
View File
@@ -20,7 +20,7 @@
layer = ABOVE_HUMAN_LAYER
opacity = 0
/obj/structure/curtain/bullet_act(obj/item/projectile/P, def_zone)
/obj/structure/curtain/bullet_act(obj/projectile/P, def_zone)
if(!P.nodamage)
visible_message(SPAN_WARNING("[P] tears [src] down!"))
qdel(src)
+1 -1
View File
@@ -34,7 +34,7 @@
health_check()
/obj/structure/displaycase/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/displaycase/bullet_act(var/obj/projectile/Proj)
health -= Proj.get_structure_damage()
..()
health_check()
+3 -3
View File
@@ -41,7 +41,7 @@
health = 50
cover = 25
/obj/structure/girder/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/girder/bullet_act(var/obj/projectile/Proj)
//Girders only provide partial cover. There's a chance that the projectiles will just pass through. (unless you are trying to shoot the girder)
if(Proj.original != src && !prob(cover))
return PROJECTILE_CONTINUE //pass through
@@ -50,7 +50,7 @@
if(!damage)
return
if(!istype(Proj, /obj/item/projectile/beam))
if(!istype(Proj, /obj/projectile/beam))
damage *= 0.4 //non beams do reduced damage
take_damage(damage)
@@ -376,7 +376,7 @@
/obj/structure/girder/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (!mover)
return 1
if(istype(mover,/obj/item/projectile) && density)
if(istype(mover,/obj/projectile) && density)
if (prob(50))
return 1
else
+1 -1
View File
@@ -31,7 +31,7 @@
visible_message(SPAN_WARNING(final_message))
qdel(src)
/obj/structure/gore/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/gore/bullet_act(var/obj/projectile/Proj)
health -= Proj.damage
healthcheck()
return ..()
+2 -2
View File
@@ -107,12 +107,12 @@
if(istype(mover) && mover.pass_flags & PASSGRILLE)
return 1
else
if(istype(mover, /obj/item/projectile))
if(istype(mover, /obj/projectile))
return prob(30)
else
return !density
/obj/structure/grille/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/grille/bullet_act(var/obj/projectile/Proj)
if(!Proj) return
//Flimsy grilles aren't so great at stopping projectiles. However they can absorb some of the impact
+1 -1
View File
@@ -63,7 +63,7 @@
if(health <= 0)
topple()
/obj/structure/hadii_statue/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/hadii_statue/bullet_act(var/obj/projectile/Proj)
if(toppled)
return
if(!Proj)
+1 -1
View File
@@ -66,7 +66,7 @@
return TRUE
return FALSE
/obj/structure/inflatable/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/inflatable/bullet_act(var/obj/projectile/Proj)
var/proj_damage = Proj.get_structure_damage()
if(!proj_damage)
return
+1 -1
View File
@@ -429,7 +429,7 @@
if(istype(mover, /mob/living) && mover == pulling)
return 1
else
if(istype(mover, /obj/item/projectile))
if(istype(mover, /obj/projectile))
return prob(30)
else
return !density
@@ -67,7 +67,7 @@
if (!mover)
return 1
if(istype(mover,/obj/item/projectile) && density)
if(istype(mover,/obj/projectile) && density)
if (!occupied && prob(80))
//Wiry frame, usually wont be cover
return 1
+1 -1
View File
@@ -57,7 +57,7 @@
reflection.update_mirror_filters()
/obj/structure/mirror/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/mirror/bullet_act(var/obj/projectile/Proj)
if(prob(Proj.get_structure_damage() * 2))
if(!shattered)
shatter()
+1 -1
View File
@@ -88,7 +88,7 @@
. += FONT_SMALL(SPAN_NOTICE("\The [src] is <b>[anchored ? "" : "not"] screwed</b> to the floor."))
/obj/structure/railing/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover,/obj/item/projectile))
if(istype(mover,/obj/projectile))
return TRUE
if(!istype(mover) || mover.pass_flags & PASSRAILING)
return TRUE
+1 -1
View File
@@ -193,7 +193,7 @@
attack_hand(user)
return
/obj/structure/simple_door/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/simple_door/bullet_act(var/obj/projectile/Proj)
health -= Proj.damage
bullet_ping(Proj)
CheckHealth()
+5 -5
View File
@@ -263,7 +263,7 @@
anchored = TRUE
/obj/structure/rod_railing/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover,/obj/item/projectile))
if(istype(mover,/obj/projectile))
return TRUE
if(!istype(mover) || mover.pass_flags & PASSRAILING)
return TRUE
@@ -315,7 +315,7 @@
icon_state = "guard_top_end"
/obj/structure/road_barrier/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover,/obj/item/projectile))
if(istype(mover,/obj/projectile))
return TRUE
if(!istype(mover) || mover.pass_flags & PASSRAILING)
return TRUE
@@ -347,8 +347,8 @@
/obj/structure/chainlink_fence/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff.
if(air_group || (height==0))
return TRUE
if(istype(mover, /obj/item/projectile))
var/obj/item/projectile/P = mover
if(istype(mover, /obj/projectile))
var/obj/projectile/P = mover
if(P.original == src)
return FALSE
if(P.firer && Adjacent(P.firer))
@@ -380,7 +380,7 @@
can_be_unanchored = FALSE
/obj/structure/rope_railing/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover,/obj/item/projectile))
if(istype(mover,/obj/projectile))
return TRUE
if(!istype(mover) || mover.pass_flags & PASSRAILING)
return TRUE
+1 -1
View File
@@ -138,7 +138,7 @@
qdel(src)
return
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/window/bullet_act(var/obj/projectile/Proj)
var/proj_damage = Proj.get_structure_damage()
if(!proj_damage)
return