mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Removes improper code, that would cause spell projectiles to be deleted pre-maturely as well as cast the spell effect all too often. Also removes completely unused code.
This commit is contained in:
@@ -166,12 +166,12 @@
|
|||||||
//roll to-hit
|
//roll to-hit
|
||||||
miss_modifier = max(15*(distance-2) - round(15*accuracy) + miss_modifier, 0)
|
miss_modifier = max(15*(distance-2) - round(15*accuracy) + miss_modifier, 0)
|
||||||
var/hit_zone = get_zone_with_miss_chance(def_zone, target_mob, miss_modifier, ranged_attack=(distance > 1 || original != target_mob)) //if the projectile hits a target we weren't originally aiming at then retain the chance to miss
|
var/hit_zone = get_zone_with_miss_chance(def_zone, target_mob, miss_modifier, ranged_attack=(distance > 1 || original != target_mob)) //if the projectile hits a target we weren't originally aiming at then retain the chance to miss
|
||||||
|
|
||||||
var/result = PROJECTILE_FORCE_MISS
|
var/result = PROJECTILE_FORCE_MISS
|
||||||
if(hit_zone)
|
if(hit_zone)
|
||||||
def_zone = hit_zone //set def_zone, so if the projectile ends up hitting someone else later (to be implemented), it is more likely to hit the same part
|
def_zone = hit_zone //set def_zone, so if the projectile ends up hitting someone else later (to be implemented), it is more likely to hit the same part
|
||||||
result = target_mob.bullet_act(src, def_zone)
|
result = target_mob.bullet_act(src, def_zone)
|
||||||
|
|
||||||
if(result == PROJECTILE_FORCE_MISS)
|
if(result == PROJECTILE_FORCE_MISS)
|
||||||
visible_message("<span class='notice'>\The [src] misses [target_mob] narrowly!</span>")
|
visible_message("<span class='notice'>\The [src] misses [target_mob] narrowly!</span>")
|
||||||
return 0
|
return 0
|
||||||
@@ -303,6 +303,7 @@
|
|||||||
if(loc == get_turf(original))
|
if(loc == get_turf(original))
|
||||||
if(!(original in permutated))
|
if(!(original in permutated))
|
||||||
if(Bump(original))
|
if(Bump(original))
|
||||||
|
qdel(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(first_step)
|
if(first_step)
|
||||||
@@ -314,9 +315,6 @@
|
|||||||
if(!hitscan)
|
if(!hitscan)
|
||||||
sleep(step_delay) //add delay between movement iterations if it's not a hitscan weapon
|
sleep(step_delay) //add delay between movement iterations if it's not a hitscan weapon
|
||||||
|
|
||||||
/obj/item/projectile/proc/process_step(first_step = 0)
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/projectile/proc/before_move()
|
/obj/item/projectile/proc/before_move()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
var/spell/targeted/projectile/carried
|
var/spell/targeted/projectile/carried
|
||||||
|
|
||||||
|
penetrating = 0
|
||||||
kill_count = 10 //set by the duration of the spell
|
kill_count = 10 //set by the duration of the spell
|
||||||
|
|
||||||
var/proj_trail = 0 //if it leaves a trail
|
var/proj_trail = 0 //if it leaves a trail
|
||||||
@@ -15,18 +16,15 @@
|
|||||||
var/list/trails = new()
|
var/list/trails = new()
|
||||||
|
|
||||||
/obj/item/projectile/spell_projectile/Destroy()
|
/obj/item/projectile/spell_projectile/Destroy()
|
||||||
..()
|
|
||||||
for(var/trail in trails)
|
for(var/trail in trails)
|
||||||
qdel(trail)
|
qdel(trail)
|
||||||
|
carried = null
|
||||||
|
return ..()
|
||||||
|
|
||||||
/obj/item/projectile/spell_projectile/ex_act()
|
/obj/item/projectile/spell_projectile/ex_act()
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/projectile/spell_projectile/before_move()
|
/obj/item/projectile/spell_projectile/before_move()
|
||||||
if(carried)
|
|
||||||
var/list/targets = carried.choose_prox_targets(user = carried.holder, spell_holder = src)
|
|
||||||
if(targets.len)
|
|
||||||
src.prox_cast(targets)
|
|
||||||
if(proj_trail && src && src.loc) //pretty trails
|
if(proj_trail && src && src.loc) //pretty trails
|
||||||
var/obj/effect/overlay/trail = PoolOrNew(/obj/effect/overlay, src.loc)
|
var/obj/effect/overlay/trail = PoolOrNew(/obj/effect/overlay, src.loc)
|
||||||
trails += trail
|
trails += trail
|
||||||
@@ -44,19 +42,14 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/projectile/spell_projectile/Bump(var/atom/A)
|
/obj/item/projectile/spell_projectile/Bump(var/atom/A)
|
||||||
if(loc)
|
if(loc && carried)
|
||||||
prox_cast(carried.choose_prox_targets(user = carried.holder, spell_holder = src))
|
prox_cast(carried.choose_prox_targets(user = carried.holder, spell_holder = src))
|
||||||
return
|
return 1
|
||||||
|
|
||||||
/obj/item/projectile/spell_projectile/on_impact()
|
/obj/item/projectile/spell_projectile/on_impact()
|
||||||
if(loc)
|
if(loc && carried)
|
||||||
prox_cast(carried.choose_prox_targets(user = carried.holder, spell_holder = src))
|
prox_cast(carried.choose_prox_targets(user = carried.holder, spell_holder = src))
|
||||||
return
|
return 1
|
||||||
|
|
||||||
/obj/item/projectile/spell_projectile/seeking
|
/obj/item/projectile/spell_projectile/seeking
|
||||||
name = "seeking spell"
|
name = "seeking spell"
|
||||||
|
|
||||||
/obj/item/projectile/spell_projectile/seeking/process_step()
|
|
||||||
..()
|
|
||||||
if(original && !isnull(src.loc))
|
|
||||||
current = original //update the target
|
|
||||||
|
|||||||
Reference in New Issue
Block a user