mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +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:
@@ -208,13 +208,16 @@
|
||||
else
|
||||
desc = initial(desc)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/cans/bullet_act(obj/projectile/P)
|
||||
if(P.firer && REAGENT_VOLUME(reagents, /singleton/reagent/fuel) >= LETHAL_FUEL_CAPACITY)
|
||||
visible_message(SPAN_DANGER("\The [name] is hit by the [P]!"))
|
||||
log_and_message_admins("shot an improvised [name] explosive", P.firer)
|
||||
log_game("[key_name(P.firer)] shot improvised grenade at [loc.loc.name] ([loc.x],[loc.y],[loc.z]).")
|
||||
detonate(TRUE)
|
||||
/obj/item/reagent_containers/food/drinks/cans/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
if(hitting_projectile.firer && REAGENT_VOLUME(reagents, /singleton/reagent/fuel) >= LETHAL_FUEL_CAPACITY)
|
||||
visible_message(SPAN_DANGER("\The [name] is hit by the [hitting_projectile]!"))
|
||||
log_and_message_admins("shot an improvised [name] explosive", hitting_projectile.firer)
|
||||
log_game("[key_name(hitting_projectile.firer)] shot improvised grenade at [loc.loc.name] ([loc.x],[loc.y],[loc.z]).")
|
||||
detonate(TRUE)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/cans/ex_act(severity)
|
||||
detonate(TRUE)
|
||||
|
||||
@@ -187,7 +187,11 @@
|
||||
|
||||
return blocked
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/bottle/bullet_act()
|
||||
/obj/item/reagent_containers/food/drinks/bottle/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
smash(loc)
|
||||
|
||||
/*
|
||||
@@ -450,8 +454,8 @@
|
||||
agony = 10 // ow!
|
||||
var/drop_type = /obj/item/trash/champagne_cork
|
||||
|
||||
/obj/projectile/bullet/champagne_cork/on_impact(var/atom/A)
|
||||
..()
|
||||
/obj/projectile/bullet/champagne_cork/on_hit(atom/target, blocked, def_zone)
|
||||
. = ..()
|
||||
new drop_type(src.loc) //always use src.loc so that ash doesn't end up inside windows
|
||||
|
||||
/obj/item/trash/champagne_cork
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
|
||||
var/hit_area = affecting.name
|
||||
|
||||
if((user != target) && H.check_shields(7, src, user, "\the [src]"))
|
||||
if((user != target) && (H.check_shields(7, src, user, "\the [src]") != BULLET_ACT_HIT))
|
||||
return
|
||||
|
||||
var/armor = H.get_blocked_ratio(target_zone, DAMAGE_BRUTE, damage_flags = DAMAGE_FLAG_SHARP, damage = 5)*100
|
||||
|
||||
@@ -194,13 +194,17 @@
|
||||
src.defuse = 0
|
||||
message_admins("[key_name_admin(user)] <font color=#FF0000>reset</font> fuse on fueltank at ([loc.x],[loc.y],[loc.z]).")
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/bullet_act(var/obj/projectile/Proj)
|
||||
if(Proj.get_structure_damage())
|
||||
if(istype(Proj.firer))
|
||||
log_and_message_admins("shot a welding tank", Proj.firer)
|
||||
log_game("[key_name(Proj.firer)] shot fueltank at [loc.loc.name] ([loc.x],[loc.y],[loc.z]).")
|
||||
/obj/structure/reagent_dispensers/fueltank/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
if(!istype(Proj ,/obj/projectile/beam/laser_tag) && !istype(Proj ,/obj/projectile/beam/practice) && !istype(Proj ,/obj/projectile/kinetic))
|
||||
if(hitting_projectile.get_structure_damage())
|
||||
if(istype(hitting_projectile.firer))
|
||||
log_and_message_admins("shot a welding tank", hitting_projectile.firer)
|
||||
log_game("[key_name(hitting_projectile.firer)] shot fueltank at [loc.loc.name] ([loc.x],[loc.y],[loc.z]).")
|
||||
|
||||
if(!istype(hitting_projectile ,/obj/projectile/beam/laser_tag) && !istype(hitting_projectile ,/obj/projectile/beam/practice) && !istype(hitting_projectile ,/obj/projectile/kinetic))
|
||||
ex_act(2.0)
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/ex_act(var/severity = 3.0)
|
||||
@@ -396,8 +400,12 @@
|
||||
capacity = 5000
|
||||
reagents_to_add = list(/singleton/reagent/nutriment/triglyceride/oil/corn = 5000)
|
||||
|
||||
/obj/structure/reagent_dispensers/cookingoil/bullet_act(var/obj/projectile/Proj)
|
||||
if(Proj.get_structure_damage())
|
||||
/obj/structure/reagent_dispensers/cookingoil/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
if(hitting_projectile.get_structure_damage())
|
||||
ex_act(2.0)
|
||||
|
||||
//Coolant tank
|
||||
@@ -409,9 +417,13 @@
|
||||
amount_per_transfer_from_this = 10
|
||||
reagents_to_add = list(/singleton/reagent/coolant = 1000)
|
||||
|
||||
/obj/structure/reagent_dispensers/coolanttank/bullet_act(var/obj/projectile/Proj)
|
||||
if(Proj.get_structure_damage())
|
||||
if (Proj.damage_type != DAMAGE_PAIN)
|
||||
/obj/structure/reagent_dispensers/coolanttank/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
if(hitting_projectile.get_structure_damage())
|
||||
if (hitting_projectile.damage_type != DAMAGE_PAIN)
|
||||
explode()
|
||||
|
||||
/obj/structure/reagent_dispensers/coolanttank/ex_act(var/severity = 2.0)
|
||||
|
||||
Reference in New Issue
Block a user