mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-29 18:50:40 +00:00
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.
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
/*Auras are simple: They are simple overriders for attackbys, bullet_act, damage procs, etc. They also tick after their respective mob.
|
|
They should be used for undeterminate mob effects, like for instance a toggle-able forcefield, or indestructability as long as you don't move.
|
|
They should also be used for when you want to effect the ENTIRE mob, like having an armor buff or showering candy everytime you walk.
|
|
*/
|
|
|
|
/obj/aura
|
|
var/mob/living/user
|
|
|
|
/obj/aura/Initialize(mapload, ...)
|
|
. = ..()
|
|
RegisterSignal(src, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(handle_bullet_act))
|
|
|
|
/obj/aura/proc/handle_bullet_act(datum/source, obj/projectile/projectile)
|
|
SIGNAL_HANDLER
|
|
|
|
return COMPONENT_BULLET_BLOCKED
|
|
|
|
/obj/aura/Destroy()
|
|
if(user)
|
|
user.remove_aura(src)
|
|
return ..()
|
|
|
|
/obj/aura/proc/added_to(var/mob/living/target)
|
|
user = target
|
|
user.add_aura(src)
|
|
|
|
/obj/aura/proc/removed()
|
|
user = null
|
|
|
|
/obj/aura/proc/life_tick()
|
|
return FALSE
|
|
|
|
/obj/aura/attackby(obj/item/attacking_item, mob/user)
|
|
return FALSE
|
|
|
|
/obj/aura/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
|
|
return FALSE
|