mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 15:14:27 +01:00
Thrown items can be targeted, has miss chance...
...based on distance, similar to projectiles. Conflicts: code/defines/obj.dm code/game/machinery/kitchen/smartfridge.dm code/game/machinery/vending.dm code/game/mecha/equipment/weapons/weapons.dm code/modules/games/cards.dm code/modules/mob/living/carbon/carbon.dm code/modules/mob/living/living_defense.dm
This commit is contained in:
@@ -416,7 +416,7 @@
|
||||
*/
|
||||
|
||||
|
||||
item.throw_at(target, item.throw_range, item.throw_speed)
|
||||
item.throw_at(target, item.throw_range, item.throw_speed, src)
|
||||
|
||||
/mob/living/carbon/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
..()
|
||||
|
||||
@@ -1548,7 +1548,7 @@
|
||||
status_flags |= LEAPING
|
||||
|
||||
src.visible_message("<span class='warning'><b>\The [src]</b> leaps at [T]!</span>")
|
||||
src.throw_at(get_step(get_turf(T),get_turf(src)), 5, 1)
|
||||
src.throw_at(get_step(get_turf(T),get_turf(src)), 5, 1, src)
|
||||
playsound(src.loc, 'sound/voice/shriek1.ogg', 50, 1)
|
||||
|
||||
sleep(5)
|
||||
|
||||
@@ -72,7 +72,6 @@
|
||||
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = 5)//Standardization and logging -Sieve
|
||||
if(istype(AM,/obj/))
|
||||
var/obj/O = AM
|
||||
var/zone = ran_zone("chest",75)//Hits a random part of the body, geared towards the chest
|
||||
var/dtype = BRUTE
|
||||
if(istype(O,/obj/item/weapon))
|
||||
var/obj/item/weapon/W = O
|
||||
@@ -84,14 +83,25 @@
|
||||
|
||||
var/throw_damage = O.throwforce*(speed/5)
|
||||
|
||||
var/zone
|
||||
if (istype(O.thrower, /mob/living))
|
||||
var/mob/living/L = O.thrower
|
||||
zone = check_zone(L.zone_sel.selecting)
|
||||
else
|
||||
zone = ran_zone("chest",75) //Hits a random part of the body, geared towards the chest
|
||||
|
||||
//def_zone = get_zone_with_miss_chance(zone, src, 15*AM.throwing_dist_travelled)
|
||||
zone = get_zone_with_miss_chance(zone, src) //TODO: store the location of the thrower and adjust miss chance with distance
|
||||
if (O.throw_source)
|
||||
var/distance = get_dist(O.throw_source, loc)
|
||||
zone = get_zone_with_miss_chance(zone, src, min(15*(distance-2), 0))
|
||||
else
|
||||
zone = get_zone_with_miss_chance(zone, src, 15)
|
||||
|
||||
if(!zone)
|
||||
visible_message("\blue \The [AM] misses [src] narrowly!")
|
||||
visible_message("\blue \The [O] misses [src] narrowly!")
|
||||
return
|
||||
|
||||
AM.throwing = 0 //it hit, so stop moving
|
||||
O.throwing = 0 //it hit, so stop moving
|
||||
|
||||
if (istype(src, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
@@ -148,7 +158,7 @@
|
||||
|
||||
//This is called when the mob is thrown into a dense turf
|
||||
/mob/living/proc/turf_collision(var/turf/T, var/speed)
|
||||
src.take_organ_damage(speed*4)
|
||||
src.take_organ_damage(speed*5)
|
||||
|
||||
/mob/living/proc/near_wall(var/direction,var/distance=1)
|
||||
var/turf/T = get_step(get_turf(src),direction)
|
||||
|
||||
Reference in New Issue
Block a user