Fixes Universal Damage Issues. Implements Proper Ricochets (#12532)

This commit is contained in:
Fox McCloud
2019-10-08 20:41:40 -04:00
committed by variableundefined
parent 57298cb79f
commit f4451fcb3d
16 changed files with 53 additions and 52 deletions
-1
View File
@@ -49,7 +49,6 @@
var/lying = 0
var/lying_prev = 0
var/lastpuke = 0
var/unacidable = 0
var/can_strip = 1
var/list/languages = list() // For speaking/listening.
var/list/abilities = list() // For species-derived or admin-given powers.
+9 -9
View File
@@ -57,7 +57,7 @@
var/impact_effect_type //what type of impact effect to show when hitting something
var/ricochets = 0
var/ricochets_max = 2
var/ricochet_chance = 0
var/ricochet_chance = 30
var/log_override = FALSE //whether print to admin attack logs or just keep it in the diary
@@ -185,13 +185,13 @@
if(check_ricochet(A) && check_ricochet_flag(A) && ricochets < ricochets_max)
ricochets++
if(A.handle_ricochet(src))
on_ricochet(A)
ignore_source_check = TRUE
range = initial(range)
return TRUE
if(firer)
if(A == firer || (A == firer.loc && istype(A, /obj/mecha))) //cannot shoot yourself or your mech
if(A.handle_ricochet(src))
on_ricochet(A)
ignore_source_check = TRUE
range = initial(range)
return TRUE
if(firer && !ignore_source_check)
if(A == firer || (A == firer.loc && ismecha(A))) //cannot shoot yourself or your mech
loc = A.loc
return 0
@@ -325,7 +325,7 @@ obj/item/projectile/Crossed(atom/movable/AM, oldloc) //A mob moving on a tile wi
return FALSE
/obj/item/projectile/proc/check_ricochet_flag(atom/A)
if(A.flags_2 & CHECK_RICOCHET_1)
if(A.flags_2 & CHECK_RICOCHET_2)
return TRUE
return FALSE
+2 -2
View File
@@ -12,6 +12,8 @@
is_reflectable = TRUE
light_range = 2
light_color = LIGHT_COLOR_RED
ricochets_max = 50 //Honk!
ricochet_chance = 80
/obj/item/projectile/beam/laser
@@ -72,8 +74,6 @@
name = "emitter beam"
icon_state = "emitter"
damage = 30
legacy = 1
animate_movement = SLIDE_STEPS
impact_effect_type = /obj/effect/temp_visual/impact_effect/green_laser
light_color = LIGHT_COLOR_GREEN
+2 -2
View File
@@ -470,8 +470,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(!istype(new_item, /obj/item/stack/sheet)) // To avoid materials dupe glitches
new_item.materials = efficient_mats.Copy()
if(O)
var/obj/item/storage/lockbox/L = new/obj/item/storage/lockbox(linked_lathe.loc)
new_item.loc = L
var/obj/item/storage/lockbox/research/L = new/obj/item/storage/lockbox/research(linked_lathe.loc)
new_item.forceMove(L)
L.name += " ([new_item.name])"
L.origin_tech = new_item.origin_tech
L.req_access = being_built.access_requirement