mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-29 16:19:36 +01:00
[MIRROR] Fixes improper use of throw_source (#12941)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Cameron Lennox
parent
45a61be462
commit
e86adf7a22
@@ -10,7 +10,6 @@
|
||||
var/move_speed = 10
|
||||
var/l_move_time = 1
|
||||
var/datum/thrownthing/throwing
|
||||
var/turf/throw_source = null
|
||||
var/throw_speed = 2
|
||||
var/throw_range = 7
|
||||
var/moved_recently = 0
|
||||
@@ -99,7 +98,6 @@
|
||||
|
||||
if(orbiting)
|
||||
stop_orbit()
|
||||
throw_source = null
|
||||
QDEL_NULL(riding_datum)
|
||||
set_listening(NON_LISTENING_ATOM)
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/item/throw_impact(atom/hit_atom)
|
||||
/obj/item/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
..()
|
||||
if(isliving(hit_atom) && !hit_atom.is_incorporeal()) //Living mobs handle hit sounds differently.
|
||||
var/volume = get_volume_by_throwforce_and_or_w_class()
|
||||
|
||||
@@ -39,13 +39,12 @@
|
||||
. = ..()
|
||||
if(istype(thrower) && thrower.a_intent == I_HURT)
|
||||
violent_throw = TRUE
|
||||
throw_source = get_turf(thrower)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/bottle/throw_impact(atom/hit_atom)
|
||||
/obj/item/reagent_containers/food/drinks/bottle/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
..()
|
||||
|
||||
if(isGlass && violent_throw)
|
||||
var/throw_dist = get_dist(throw_source, loc)
|
||||
var/throw_dist = get_dist(throwingdatum.starting_turf, loc)
|
||||
if(smash_check(throw_dist)) //not as reliable as smashing directly
|
||||
if(reagents)
|
||||
hit_atom.visible_message(span_notice("The contents of \the [src] splash all over [hit_atom]!"))
|
||||
@@ -53,7 +52,6 @@
|
||||
src.smash(loc, hit_atom)
|
||||
|
||||
violent_throw = FALSE
|
||||
throw_source = null
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/bottle/proc/smash_check(distance)
|
||||
if(!isGlass || !smash_duration)
|
||||
|
||||
@@ -383,8 +383,8 @@ emp_act
|
||||
|
||||
//check if we hit
|
||||
var/miss_chance = 15
|
||||
if (thrown_object.throw_source)
|
||||
var/distance = get_dist(thrown_object.throw_source, loc)
|
||||
if(throwingdatum?.starting_turf)
|
||||
var/distance = get_dist(throwingdatum.starting_turf, loc)
|
||||
miss_chance = max(15*(distance-2), 0)
|
||||
zone = get_zone_with_miss_chance(zone, src, miss_chance, ranged_attack=1, attacker = thrower)
|
||||
|
||||
@@ -433,8 +433,8 @@ emp_act
|
||||
var/mass = thrown_object.w_class/THROWNOBJ_KNOCKBACK_DIVISOR
|
||||
var/momentum = speed*mass
|
||||
|
||||
if(thrown_object.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED && !buckled)
|
||||
var/dir = get_dir(thrown_object.throw_source, src)
|
||||
if(throwingdatum?.starting_turf && momentum >= THROWNOBJ_KNOCKBACK_SPEED && !buckled)
|
||||
var/dir = get_dir(throwingdatum.starting_turf, src)
|
||||
|
||||
visible_message(span_filter_warning("[span_red("[src] staggers under the impact!")]"),span_filter_warning("[span_red("You stagger under the impact!")]"))
|
||||
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
|
||||
|
||||
@@ -263,15 +263,6 @@
|
||||
var/dtype = O.damtype
|
||||
var/throw_damage = O.throwforce*(speed/THROWFORCE_SPEED_DIVISOR)
|
||||
|
||||
/*var/miss_chance = 15
|
||||
if (O.throw_source)
|
||||
var/distance = get_dist(O.throw_source, loc)
|
||||
miss_chance = max(15*(distance-2), 0)
|
||||
|
||||
if (prob(miss_chance))
|
||||
visible_message(span_notice("\The [O] misses [src] narrowly!"))
|
||||
return*/
|
||||
//CHOMPEDIT - removing baymiss
|
||||
src.visible_message(span_filter_warning("[span_red("[src] has been hit by [O].")]"))
|
||||
var/armor = run_armor_check(null, "melee")
|
||||
|
||||
@@ -289,8 +280,8 @@
|
||||
var/mass = O.w_class/THROWNOBJ_KNOCKBACK_DIVISOR
|
||||
var/momentum = speed*mass
|
||||
|
||||
if(O.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED)
|
||||
var/dir = get_dir(O.throw_source, src)
|
||||
if(throwingdatum.starting_turf && momentum >= THROWNOBJ_KNOCKBACK_SPEED)
|
||||
var/dir = get_dir(throwingdatum.starting_turf, src)
|
||||
|
||||
visible_message(span_filter_warning("[span_red("[src] staggers under the impact!")]"),span_filter_warning("[span_red("You stagger under the impact!")]"))
|
||||
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
|
||||
|
||||
Reference in New Issue
Block a user