mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 06:22:26 +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:
@@ -158,7 +158,10 @@
|
||||
|
||||
var/obj/projectile/beam/emitter/A = get_emitter_beam()
|
||||
A.damage = round(power_per_shot / EMITTER_DAMAGE_POWER_TRANSFER)
|
||||
A.launch_projectile(get_step(src, dir))
|
||||
|
||||
A.preparePixelProjectile(get_step(src, dir), get_turf(src))
|
||||
A.fired_from = src
|
||||
A.fire()
|
||||
shot_counter++
|
||||
|
||||
/obj/machinery/power/emitter/attackby(obj/item/attacking_item, mob/user)
|
||||
|
||||
@@ -160,11 +160,14 @@ field_generator power level display
|
||||
|
||||
return 0
|
||||
|
||||
/obj/machinery/field_generator/bullet_act(var/obj/projectile/Proj)
|
||||
if(istype(Proj, /obj/projectile/beam))
|
||||
power += Proj.damage * 1.25 * EMITTER_DAMAGE_POWER_TRANSFER
|
||||
/obj/machinery/field_generator/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
if(istype(hitting_projectile, /obj/projectile/beam))
|
||||
power += hitting_projectile.damage * 1.25 * EMITTER_DAMAGE_POWER_TRANSFER
|
||||
update_icon()
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/field_generator/Destroy()
|
||||
|
||||
@@ -71,8 +71,12 @@
|
||||
energy += round((rand(20,60)/2),1)
|
||||
return
|
||||
|
||||
/obj/singularity/bullet_act(obj/projectile/P)
|
||||
return 0 //Will there be an impact? Who knows. Will we see it? No.
|
||||
/obj/singularity/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
return BULLET_ACT_BLOCK //Will there be an impact? Who knows. Will we see it? No.
|
||||
|
||||
/obj/singularity/Collide(atom/A)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user