mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 16:38:22 +01:00
Projectile refactoring madness (#19878)
Refactored the projectile code, mostly in line with TG's now. Refactored various procs that are used or depends on it. Projectiles can now ricochet if enabled to. Damage falloffs with distance. Homing projectiles can now have accuracy falloff with distance. Projectiles have a maximum range. Muzzle flash is configurable per projectile. Impact effect of the projectile is configurable per projectile. Accuracy decreases with distance. Projectiles work with signals and emits them, for easy hooking up from other parts of the code. Meatshielding is now less effective . Impact sound is now configurable per projectile. High risk.
This commit is contained in:
@@ -83,11 +83,10 @@
|
||||
to_chat(user, "You unbuckle [load] from \the [src]")
|
||||
to_chat(load, "You were unbuckled from \the [src] by [user]")
|
||||
|
||||
/obj/vehicle/animal/bullet_act(var/obj/projectile/Proj)
|
||||
/obj/vehicle/animal/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
var/datum/component/armor/armor_component = GetComponent(/datum/component/armor)
|
||||
if(buckled && prob((1 - armor_component.get_blocked(Proj.damage_type, Proj.damage_flags, Proj.armor_penetration))*100))
|
||||
buckled.bullet_act(Proj)
|
||||
return
|
||||
if(buckled && prob((1 - armor_component.get_blocked(hitting_projectile.damage_type, hitting_projectile.damage_flags, hitting_projectile.armor_penetration))*100))
|
||||
return buckled.bullet_act(arglist(args))
|
||||
..()
|
||||
|
||||
/obj/vehicle/animal/relaymove(mob/living/user, direction)
|
||||
|
||||
@@ -251,10 +251,10 @@
|
||||
|
||||
..()
|
||||
|
||||
/obj/vehicle/bike/bullet_act(var/obj/projectile/Proj)
|
||||
/obj/vehicle/bike/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
if(buckled && prob(protection_percent))
|
||||
buckled.bullet_act(Proj)
|
||||
return
|
||||
return buckled.bullet_act(arglist(args))
|
||||
|
||||
..()
|
||||
|
||||
/obj/vehicle/bike/update_icon()
|
||||
|
||||
@@ -149,11 +149,11 @@
|
||||
|
||||
// Cargo trains are open topped, so you can shoot at the driver.
|
||||
// Or you can shoot at the tug itself, if you're good.
|
||||
/obj/vehicle/train/cargo/bullet_act(var/obj/projectile/Proj)
|
||||
if (buckled && Proj.original == buckled)
|
||||
buckled.bullet_act(Proj)
|
||||
/obj/vehicle/train/cargo/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
if (buckled && hitting_projectile.original == buckled)
|
||||
buckled.bullet_act(arglist(args))
|
||||
else
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
/obj/vehicle/train/cargo/update_icon()
|
||||
if(open)
|
||||
|
||||
@@ -124,9 +124,12 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/vehicle/bullet_act(var/obj/projectile/Proj)
|
||||
health -= Proj.get_structure_damage()
|
||||
..()
|
||||
/obj/vehicle/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
health -= hitting_projectile.get_structure_damage()
|
||||
|
||||
if (prob(20) && !organic)
|
||||
spark(src, 5, GLOB.alldirs)
|
||||
|
||||
@@ -88,11 +88,14 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/vehicle/bike/wasp_torpedo/bullet_act(var/obj/projectile/Proj)
|
||||
if(Proj.get_structure_damage())
|
||||
/obj/vehicle/bike/wasp_torpedo/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
if(hitting_projectile.get_structure_damage())
|
||||
if(prob(10))
|
||||
torpedo_explosion()
|
||||
..()
|
||||
|
||||
/obj/vehicle/bike/wasp_torpedo/ex_act(severity)
|
||||
switch(severity)
|
||||
|
||||
Reference in New Issue
Block a user