[DNM][DNM][WIP] Projectile backend code port and update

Ports#54924,  #65061, #59804 from /tg.
adds auxiliary code from /tg to make code work.
This commit is contained in:
Solaris-Shade
2022-03-06 15:20:23 -05:00
parent 8b77ee159f
commit 2fdb70b2b9
84 changed files with 597 additions and 503 deletions
@@ -166,9 +166,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
QDEL_NULL(spawners_menu)
return ..()
/mob/dead/CanPass(atom/movable/mover, turf/target)
return 1
/*
* This proc will update the icon of the ghost itself, with hair overlays, as well as the ghost image.
* Please call update_icon(icon_state) from now on when you want to update the icon_state of the ghost,
@@ -53,7 +53,7 @@
dna.species.on_hit(P, src)
/mob/living/carbon/human/bullet_act(obj/item/projectile/P, def_zone)
/mob/living/carbon/human/bullet_act(obj/item/projectile/P, def_zone, piercing_hit = FALSE)
if(dna && dna.species)
var/spec_return = dna.species.bullet_act(P, src)
if(spec_return)
@@ -61,7 +61,7 @@
if(mind) //martial art stuff
if(mind.martial_art && mind.martial_art.can_use(src)) //Some martial arts users can deflect projectiles!
var/martial_art_result = mind.martial_art.on_projectile_hit(src, P, def_zone)
var/martial_art_result = mind.martial_art.on_projectile_hit(src, P, def_zone, piercing_hit)
if(!(martial_art_result == BULLET_ACT_HIT))
return martial_art_result
return ..()
+2 -2
View File
@@ -68,7 +68,7 @@
else
CRASH("Invalid rediretion mode [redirection_mode]")
/mob/living/bullet_act(obj/item/projectile/P, def_zone)
/mob/living/bullet_act(obj/item/projectile/P, def_zone, piercing_hit = FALSE)
var/totaldamage = P.damage
var/final_percent = 0
if(P.original != src || P.firer != src) //try to block or reflect the bullet, can't do so when shooting oneself
@@ -81,7 +81,7 @@
if(returned & BLOCK_REDIRECTED)
return BULLET_ACT_FORCE_PIERCE
if(returned & BLOCK_SUCCESS)
P.on_hit(src, final_percent, def_zone)
P.on_hit(src, final_percent, def_zone, piercing_hit)
return BULLET_ACT_BLOCK
totaldamage = block_calculate_resultant_damage(totaldamage, returnlist)
var/armor = run_armor_check(def_zone, P.flag, null, null, P.armour_penetration, null)
+5 -7
View File
@@ -20,12 +20,10 @@
/mob/living/proc/update_density()
density = !lying && !HAS_TRAIT(src, TRAIT_LIVING_NO_DENSITY)
/mob/living/CanPass(atom/movable/mover, turf/target)
if((mover.pass_flags & PASSMOB))
return TRUE
if(istype(mover, /obj/item/projectile))
var/obj/item/projectile/P = mover
return !P.can_hit_target(src, P.permutated, src == P.original, TRUE)
/mob/living/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(.)
return
if(mover.throwing)
return (!density || lying)
if(buckled == mover)
@@ -41,7 +39,7 @@
var/mob/living/L = mover //typecast first, check isliving and only check this if living using short circuit
if(isliving(L) && lying && L.lying) //if we're both lying down and aren't already being thrown/shipped around, don't pass
return FALSE
return (!density || (isliving(mover)? L.can_move_under_living(src) : !mover.density))
return (isliving(mover)? L.can_move_under_living(src) : !mover.density)
/mob/living/toggle_move_intent()
. = ..()
@@ -120,7 +120,7 @@
"<span class='boldwarning'>You are thrown off of [src]!</span>")
flash_act(affect_silicon = 1)
/mob/living/silicon/bullet_act(obj/item/projectile/P, def_zone)
/mob/living/silicon/bullet_act(obj/item/projectile/P, def_zone, piercing_hit = FALSE)
var/totaldamage = P.damage
if(P.original != src || P.firer != src) //try to block or reflect the bullet, can't do so when shooting oneself
var/list/returnlist = list()
@@ -141,7 +141,7 @@
"<span class='boldwarning'>You are knocked off of [src] by the [P]!</span>")
unbuckle_mob(M)
M.DefaultCombatKnockdown(40)
P.on_hit(src, 0, def_zone)
P.on_hit(src, 0, def_zone, 0, piercing_hit)
return BULLET_ACT_HIT
/mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/tiled/flash/static)
@@ -124,10 +124,10 @@
apply_damage(damage, damagetype, null, getarmor(null, armorcheck))
return TRUE
/mob/living/simple_animal/bullet_act(obj/item/projectile/Proj)
/mob/living/simple_animal/bullet_act(obj/item/projectile/Proj, def_zone, piercing_hit = FALSE)
if(!Proj)
return
apply_damage(Proj.damage, Proj.damage_type)
apply_damage(Proj.damage, Proj.damage_type, 0, piercing_hit)
Proj.on_hit(src)
return BULLET_ACT_HIT
@@ -33,12 +33,12 @@
footstep_type = FOOTSTEP_MOB_BAREFOOT
/mob/living/simple_animal/hostile/jungle/mook/CanPass(atom/movable/O)
/mob/living/simple_animal/hostile/jungle/mook/CanAllowThrough(atom/movable/O)
. = ..()
if(istype(O, /mob/living/simple_animal/hostile/jungle/mook))
var/mob/living/simple_animal/hostile/jungle/mook/M = O
if(M.attack_state == MOOK_ATTACK_ACTIVE && M.throwing)
return TRUE
return ..()
/mob/living/simple_animal/hostile/jungle/mook/death()
desc = "A deceased primitive. Upon closer inspection, it was suffering from severe cellular degeneration and its garments are machine made..."//Can you guess the twist
@@ -160,10 +160,10 @@ Difficulty: Hard
severity = EXPLODE_LIGHT // puny mortals
return ..()
/mob/living/simple_animal/hostile/megafauna/bubblegum/CanPass(atom/movable/mover, turf/target)
/mob/living/simple_animal/hostile/megafauna/bubblegum/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(istype(mover, /mob/living/simple_animal/hostile/megafauna/bubblegum/hallucination))
return 1
return ..()
return TRUE
/mob/living/simple_animal/hostile/megafauna/bubblegum/Goto(target, delay, minimum_distance)
if(!charging)
@@ -466,10 +466,10 @@ Difficulty: Hard
new /obj/effect/decal/cleanable/blood(get_turf(src))
. = ..()
/mob/living/simple_animal/hostile/megafauna/bubblegum/hallucination/CanPass(atom/movable/mover, turf/target)
/mob/living/simple_animal/hostile/megafauna/bubblegum/hallucination/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(istype(mover, /mob/living/simple_animal/hostile/megafauna/bubblegum)) // hallucinations should not be stopping bubblegum or eachother
return 1
return ..()
return TRUE
/mob/living/simple_animal/hostile/megafauna/bubblegum/hallucination/Life()
return
@@ -490,7 +490,8 @@ Difficulty: Normal
queue_smooth_neighbors(src)
return ..()
/obj/effect/temp_visual/hierophant/wall/CanPass(atom/movable/mover, turf/target)
/obj/effect/temp_visual/hierophant/wall/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(QDELETED(caster))
return FALSE
if(mover == caster.pulledby)
@@ -501,7 +502,6 @@ Difficulty: Normal
return TRUE
if(mover == caster)
return TRUE
return FALSE
/obj/effect/temp_visual/hierophant/chaser //a hierophant's chaser. follows target around, moving and producing a blast every speed deciseconds.
duration = 98
@@ -394,7 +394,7 @@ SHITCODE AHEAD. BE ADVISED. Also comment extravaganza
muzzle_type = /obj/effect/projectile/tracer/legion
impact_type = /obj/effect/projectile/tracer/legion
hitscan = TRUE
movement_type = UNSTOPPABLE
projectile_piercing = ALL
///Used for the legion turret tracer.
/obj/effect/projectile/tracer/legion/tracer
@@ -72,14 +72,14 @@
return
//if it's not our target, we ignore it
/mob/living/simple_animal/hostile/asteroid/curseblob/CanPass(atom/movable/mover, turf/target)
/mob/living/simple_animal/hostile/asteroid/curseblob/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(mover == set_target)
return FALSE
if(istype(mover, /obj/item/projectile))
var/obj/item/projectile/P = mover
if(P.firer == set_target)
return FALSE
return TRUE
#define IGNORE_PROC_IF_NOT_TARGET(X) /mob/living/simple_animal/hostile/asteroid/curseblob/##X(AM) { if (AM == set_target) return ..(); }
@@ -383,8 +383,7 @@ While using this makes the system rely on OnFire, it still gives options for tim
ourelite = null
return ..()
/obj/effect/temp_visual/elite_tumor_wall/CanPass(atom/movable/mover, turf/target)
/obj/effect/temp_visual/elite_tumor_wall/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(mover == ourelite || mover == activator)
return FALSE
else
return TRUE
@@ -231,11 +231,11 @@
amount = -abs(amount)
return ..() //Heals them
/mob/living/simple_animal/slime/bullet_act(obj/item/projectile/Proj)
/mob/living/simple_animal/slime/bullet_act(obj/item/projectile/Proj, def_zone, piercing_hit = FALSE)
attacked += 10
if((Proj.damage_type == BURN))
adjustBruteLoss(-abs(Proj.damage)) //fire projectiles heals slimes.
Proj.on_hit(src)
Proj.on_hit(src, 0, piercing_hit)
return BULLET_ACT_BLOCK
return ..()
+1 -1
View File
@@ -9,7 +9,7 @@
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
throwforce = 10
blocks_emissive = EMISSIVE_BLOCK_GENERIC
pass_flags_self = PASSMOB
vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of mob in openspace.
attack_hand_is_action = TRUE