Merge pull request #10125 from Ghommie/Ghommie-cit449
Ports a few projectile code updates by ke:b:inz.
This commit is contained in:
@@ -197,3 +197,9 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
|
||||
#define TOTAL_MASS_HAND_REPLACEMENT 5 //standard punching stamina cost. most hand replacements are huge items anyway.
|
||||
#define TOTAL_MASS_MEDIEVAL_WEAPON 3.6 //very, very generic average sword/warpick/etc. weight in pounds.
|
||||
#define TOTAL_MASS_TOY_SWORD 1.5
|
||||
|
||||
//bullet_act() return values
|
||||
#define BULLET_ACT_HIT "HIT" //It's a successful hit, whatever that means in the context of the thing it's hitting.
|
||||
#define BULLET_ACT_BLOCK "BLOCK" //It's a blocked hit, whatever that means in the context of the thing it's hitting.
|
||||
#define BULLET_ACT_FORCE_PIERCE "PIERCE" //It pierces through the object regardless of the bullet being piercing by default.
|
||||
#define BULLET_ACT_TURF "TURF" //It hit us but it should hit something on the same turf too. Usually used for turfs.
|
||||
@@ -60,6 +60,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
#define FLYING (1<<1)
|
||||
#define VENTCRAWLING (1<<2)
|
||||
#define FLOATING (1<<3)
|
||||
#define UNSTOPPABLE (1<<4) //When moving, will Bump()/Cross()/Uncross() everything, but won't be stopped.
|
||||
|
||||
//Fire and Acid stuff, for resistance_flags
|
||||
#define LAVA_PROOF (1<<0)
|
||||
|
||||
@@ -101,7 +101,10 @@ GLOBAL_LIST_INIT(bitfields, list(
|
||||
),
|
||||
"movement_type" = list(
|
||||
"GROUND" = GROUND,
|
||||
"FLYING" = FLYING
|
||||
"FLYING" = FLYING,
|
||||
"VENTCRAWLING" = VENTCRAWLING,
|
||||
"FLOATING" = FLOATING,
|
||||
"UNSTOPPABLE" = UNSTOPPABLE
|
||||
),
|
||||
"resistance_flags" = list(
|
||||
"LAVA_PROOF" = LAVA_PROOF,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/turnstile/bullet_act(obj/item/projectile/P, def_zone)
|
||||
return -1 //Pass through!
|
||||
return BULLET_ACT_FORCE_PIERCE //Pass through!
|
||||
|
||||
/obj/machinery/turnstile/proc/allowed_access(var/mob/B)
|
||||
if(B.pulledby && ismob(B.pulledby))
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
playsound(src, 'sound/weapons/slice.ogg', 50, 1)
|
||||
if(prob(P.damage))
|
||||
push_over()
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/cardboard_cutout/proc/change_appearance(obj/item/toy/crayon/crayon, mob/living/user)
|
||||
if(!crayon || !user)
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
if(Pgun && istype(Pgun))
|
||||
Pgun.field_connect(src)
|
||||
else
|
||||
return 0
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/effect/chrono_field/assume_air()
|
||||
return 0
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
master.disrupt()
|
||||
|
||||
/obj/effect/dummy/chameleon/bullet_act()
|
||||
..()
|
||||
. = ..()
|
||||
master.disrupt()
|
||||
|
||||
/obj/effect/dummy/chameleon/relaymove(mob/user, direction)
|
||||
|
||||
@@ -40,8 +40,10 @@
|
||||
if (prob(50))
|
||||
qdel(src)
|
||||
|
||||
/obj/item/latexballon/bullet_act()
|
||||
burst()
|
||||
/obj/item/latexballon/bullet_act(obj/item/projectile/P)
|
||||
if(!P.nodamage)
|
||||
burst()
|
||||
return ..()
|
||||
|
||||
/obj/item/latexballon/temperature_expose(datum/gas_mixture/air, temperature, volume)
|
||||
if(temperature > T0C+100)
|
||||
|
||||
@@ -358,7 +358,8 @@
|
||||
/obj/item/melee/supermatter_sword/bullet_act(obj/item/projectile/P)
|
||||
visible_message("<span class='danger'>[P] smacks into [src] and rapidly flashes to ash.</span>",\
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
consume_everything()
|
||||
consume_everything(P)
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/melee/supermatter_sword/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] touches [src]'s blade. It looks like [user.p_theyre()] tired of waiting for the radiation to kill [user.p_them()]!</span>")
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#define DECALTYPE_BULLET 2
|
||||
|
||||
/obj/item/target/clown/bullet_act(obj/item/projectile/P)
|
||||
..()
|
||||
. = ..()
|
||||
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
|
||||
|
||||
/obj/item/target/bullet_act(obj/item/projectile/P)
|
||||
@@ -89,8 +89,8 @@
|
||||
else
|
||||
bullet_hole.icon_state = "dent"
|
||||
add_overlay(bullet_hole)
|
||||
return
|
||||
return -1
|
||||
return BULLET_ACT_HIT
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
|
||||
#undef DECALTYPE_SCORCH
|
||||
#undef DECALTYPE_BULLET
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
take_damage(10, BRUTE, "melee", 1) //Tasers aren't harmful.
|
||||
if(istype(P, /obj/item/projectile/beam/disabler))
|
||||
take_damage(5, BRUTE, "melee", 1) //Disablers aren't harmful.
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/structure/holosign/barrier/medical
|
||||
name = "\improper PENLITE holobarrier"
|
||||
@@ -152,6 +153,7 @@
|
||||
|
||||
/obj/structure/holosign/barrier/cyborg/hacked/bullet_act(obj/item/projectile/P)
|
||||
take_damage(P.damage, BRUTE, "melee", 1) //Yeah no this doesn't get projectile resistance.
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/structure/holosign/barrier/cyborg/hacked/proc/cooldown()
|
||||
shockcd = FALSE
|
||||
|
||||
@@ -64,15 +64,15 @@
|
||||
var/ploc = get_turf(P)
|
||||
if(!finished || !allowed_projectile_typecache[P.type] || !(P.dir in GLOB.cardinals))
|
||||
return ..()
|
||||
if(auto_reflect(P, pdir, ploc, pangle) != -1)
|
||||
if(auto_reflect(P, pdir, ploc, pangle) != BULLET_ACT_FORCE_PIERCE)
|
||||
return ..()
|
||||
return -1
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
|
||||
/obj/structure/reflector/proc/auto_reflect(obj/item/projectile/P, pdir, turf/ploc, pangle)
|
||||
P.ignore_source_check = TRUE
|
||||
P.range = P.decayedRange
|
||||
P.decayedRange = max(P.decayedRange--, 0)
|
||||
return -1
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
|
||||
/obj/structure/reflector/attackby(obj/item/W, mob/user, params)
|
||||
if(admin)
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
message_admins("Plasma statue ignited by [Proj]. No known firer, in [ADMIN_VERBOSEJMP(T)]")
|
||||
log_game("Plasma statue ignited by [Proj] in [AREACOORD(T)]. No known firer.")
|
||||
PlasmaBurn(2500)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/structure/statue/plasma/attackby(obj/item/W, mob/user, params)
|
||||
if(W.get_temperature() > 300 && !QDELETED(src))//If the temperature of the object is over 300, then ignite
|
||||
|
||||
@@ -71,6 +71,5 @@
|
||||
|
||||
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
|
||||
if(pinned_target)
|
||||
pinned_target.bullet_act(P)
|
||||
else
|
||||
..()
|
||||
return pinned_target.bullet_act(P)
|
||||
return ..()
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
PlasmaBurn(2500)
|
||||
else if(istype(Proj, /obj/item/projectile/ion))
|
||||
PlasmaBurn(500)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
|
||||
/turf/closed/wall/mineral/wood
|
||||
|
||||
@@ -224,14 +224,20 @@
|
||||
for(var/i in contents)
|
||||
if(i == mover || i == mover.loc) // Multi tile objects and moving out of other objects
|
||||
continue
|
||||
if(QDELETED(mover))
|
||||
break
|
||||
var/atom/movable/thing = i
|
||||
if(thing.Cross(mover))
|
||||
continue
|
||||
if(!firstbump || ((thing.layer > firstbump.layer || thing.flags_1 & ON_BORDER_1) && !(firstbump.flags_1 & ON_BORDER_1)))
|
||||
firstbump = thing
|
||||
if(!thing.Cross(mover))
|
||||
if(CHECK_BITFIELD(mover.movement_type, UNSTOPPABLE))
|
||||
mover.Bump(thing)
|
||||
continue
|
||||
else
|
||||
if(!firstbump || ((thing.layer > firstbump.layer || thing.flags_1 & ON_BORDER_1) && !(firstbump.flags_1 & ON_BORDER_1)))
|
||||
firstbump = thing
|
||||
if(firstbump)
|
||||
mover.Bump(firstbump)
|
||||
return FALSE
|
||||
if(!QDELETED(mover))
|
||||
mover.Bump(firstbump)
|
||||
return CHECK_BITFIELD(mover.movement_type, UNSTOPPABLE)
|
||||
return TRUE
|
||||
|
||||
/turf/Exit(atom/movable/mover, atom/newloc)
|
||||
@@ -239,13 +245,16 @@
|
||||
if(!.)
|
||||
return FALSE
|
||||
for(var/i in contents)
|
||||
if(QDELETED(mover))
|
||||
break
|
||||
if(i == mover)
|
||||
continue
|
||||
var/atom/movable/thing = i
|
||||
if(!thing.Uncross(mover, newloc))
|
||||
if(thing.flags_1 & ON_BORDER_1)
|
||||
mover.Bump(thing)
|
||||
return FALSE
|
||||
if(!CHECK_BITFIELD(mover.movement_type, UNSTOPPABLE))
|
||||
return FALSE
|
||||
|
||||
/turf/Entered(atom/movable/AM)
|
||||
..()
|
||||
@@ -563,3 +572,8 @@
|
||||
//Should return new turf
|
||||
/turf/proc/Melt()
|
||||
return ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
|
||||
|
||||
/turf/bullet_act(obj/item/projectile/P)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_FORCE_PIERCE)
|
||||
. = BULLET_ACT_TURF
|
||||
|
||||
@@ -345,13 +345,13 @@
|
||||
/obj/item/projectile/tentacle/on_hit(atom/target, blocked = FALSE)
|
||||
var/mob/living/carbon/human/H = firer
|
||||
if(blocked >= 100)
|
||||
return 0
|
||||
return BULLET_ACT_BLOCK
|
||||
if(isitem(target))
|
||||
var/obj/item/I = target
|
||||
if(!I.anchored)
|
||||
to_chat(firer, "<span class='notice'>You pull [I] right into your grasp.</span>")
|
||||
H.put_in_hands(I) //Because throwing it is goofy as fuck and unreliable. If you land the tentacle despite the penalties to accuracy, you should have your reward.
|
||||
. = 1
|
||||
. = BULLET_ACT_HIT
|
||||
|
||||
else if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
@@ -366,7 +366,7 @@
|
||||
if(INTENT_HELP)
|
||||
C.visible_message("<span class='danger'>[L] is pulled by [H]'s tentacle!</span>","<span class='userdanger'>A tentacle grabs you and pulls you towards [H]!</span>")
|
||||
C.throw_at(get_step_towards(H,C), 8, 2)
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
if(INTENT_DISARM)
|
||||
var/obj/item/I = C.get_active_held_item()
|
||||
@@ -374,27 +374,27 @@
|
||||
if(C.dropItemToGround(I))
|
||||
C.visible_message("<span class='danger'>[I] is yanked off [C]'s hand by [src]!</span>","<span class='userdanger'>A tentacle pulls [I] away from you!</span>")
|
||||
on_hit(I) //grab the item as if you had hit it directly with the tentacle
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
else
|
||||
to_chat(firer, "<span class='danger'>You can't seem to pry [I] off [C]'s hands!</span>")
|
||||
return 0
|
||||
return BULLET_ACT_BLOCK
|
||||
else
|
||||
to_chat(firer, "<span class='danger'>[C] has nothing in hand to disarm!</span>")
|
||||
return 0
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
if(INTENT_GRAB)
|
||||
C.visible_message("<span class='danger'>[L] is grabbed by [H]'s tentacle!</span>","<span class='userdanger'>A tentacle grabs you and pulls you towards [H]!</span>")
|
||||
C.throw_at(get_step_towards(H,C), 8, 2, H, TRUE, TRUE, callback=CALLBACK(src, .proc/tentacle_grab, H, C))
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
if(INTENT_HARM)
|
||||
C.visible_message("<span class='danger'>[L] is thrown towards [H] by a tentacle!</span>","<span class='userdanger'>A tentacle grabs you and throws you towards [H]!</span>")
|
||||
C.throw_at(get_step_towards(H,C), 8, 2, H, TRUE, TRUE, callback=CALLBACK(src, .proc/tentacle_stab, H, C))
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
else
|
||||
L.visible_message("<span class='danger'>[L] is pulled by [H]'s tentacle!</span>","<span class='userdanger'>A tentacle grabs you and pulls you towards [H]!</span>")
|
||||
L.throw_at(get_step_towards(H,L), 8, 2)
|
||||
. = 1
|
||||
. = BULLET_ACT_HIT
|
||||
|
||||
/obj/item/projectile/tentacle/Destroy()
|
||||
qdel(chain)
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
if(is_servant_of_ratvar(L) || L.stat || L.has_status_effect(STATUS_EFFECT_KINDLE))
|
||||
return
|
||||
return BULLET_ACT_HIT
|
||||
var/atom/O = L.anti_magic_check()
|
||||
playsound(L, 'sound/magic/fireball.ogg', 50, TRUE, frequency = 1.25)
|
||||
if(O)
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/clockwork/marauder/bullet_act(obj/item/projectile/P)
|
||||
if(deflect_projectile(P))
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/clockwork/marauder/proc/deflect_projectile(obj/item/projectile/P)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
if(auto_reflect(P, P.dir, get_turf(P), P.Angle) != -1)
|
||||
return ..()
|
||||
|
||||
return -1
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
|
||||
/obj/structure/destructible/clockwork/reflector/proc/auto_reflect(obj/item/projectile/P, pdir, turf/ploc, pangle)
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
return ..()
|
||||
if(istype(Proj , /obj/item/projectile/energy/floramut))
|
||||
mutate()
|
||||
return BULLET_ACT_HIT
|
||||
else if(istype(Proj , /obj/item/projectile/energy/florayield))
|
||||
return myseed.bullet_act(Proj)
|
||||
else
|
||||
|
||||
@@ -145,6 +145,7 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
|
||||
adjust_yield(1 * rating)
|
||||
else if(prob(1/(yield * yield) * 100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
|
||||
adjust_yield(1 * rating)
|
||||
return BULLET_ACT_HIT
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/bullet_act(obj/item/projectile/P)
|
||||
GibtoniteReaction(P.firer)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/ex_act()
|
||||
GibtoniteReaction(null, 1)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/obj/effect/dummy/phased_mob/slaughter/ex_act()
|
||||
return
|
||||
/obj/effect/dummy/phased_mob/slaughter/bullet_act()
|
||||
return
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
|
||||
/obj/effect/dummy/phased_mob/slaughter/singularity_act()
|
||||
return
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
if(prob(mind.martial_art.dodge_chance))
|
||||
var/dodgemessage = pick("dodges under the projectile!","dodges to the right of the projectile!","jumps over the projectile!")
|
||||
visible_message("<span class='danger'>[src] [dodgemessage]</span>", "<span class='userdanger'>You dodge the projectile!</span>")
|
||||
return -1
|
||||
return BULLET_ACT_BLOCK
|
||||
if(mind.martial_art && !incapacitated(FALSE, TRUE) && mind.martial_art.can_use(src) && mind.martial_art.deflection_chance) //Some martial arts users can deflect projectiles!
|
||||
if(prob(mind.martial_art.deflection_chance))
|
||||
if(!lying && dna && !dna.check_mutation(HULK)) //But only if they're not lying down, and hulks can't do it
|
||||
@@ -60,12 +60,10 @@
|
||||
else
|
||||
visible_message("<span class='danger'>[src] deflects the projectile!</span>", "<span class='userdanger'>You deflect the projectile!</span>")
|
||||
playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, 1)
|
||||
if(!mind.martial_art.reroute_deflection)
|
||||
return FALSE
|
||||
else
|
||||
if(mind.martial_art.reroute_deflection)
|
||||
P.firer = src
|
||||
P.setAngle(rand(0, 360))//SHING
|
||||
return FALSE
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -1998,7 +1998,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
|
||||
/datum/species/proc/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H)
|
||||
// called before a projectile hit
|
||||
return 0
|
||||
return
|
||||
|
||||
/////////////
|
||||
//BREATHING//
|
||||
|
||||
@@ -360,8 +360,8 @@
|
||||
playsound(H, 'sound/effects/shovel_dig.ogg', 70, 1)
|
||||
H.visible_message("<span class='danger'>The [P.name] sinks harmlessly in [H]'s sandy body!</span>", \
|
||||
"<span class='userdanger'>The [P.name] sinks harmlessly in [H]'s sandy body!</span>")
|
||||
return 2
|
||||
return 0
|
||||
return BULLET_ACT_BLOCK
|
||||
return ..()
|
||||
|
||||
//Reflects lasers and resistant to burn damage, but very vulnerable to brute damage. Shatters on death.
|
||||
/datum/species/golem/glass
|
||||
@@ -397,8 +397,8 @@
|
||||
var/turf/target = get_turf(P.starting)
|
||||
// redirect the projectile
|
||||
P.preparePixelProjectile(locate(CLAMP(target.x + new_x, 1, world.maxx), CLAMP(target.y + new_y, 1, world.maxy), H.z), H)
|
||||
return -1
|
||||
return 0
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
return ..()
|
||||
|
||||
//Teleports when hit or when it wants to
|
||||
/datum/species/golem/bluespace
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
|
||||
H.visible_message("<span class='danger'>[H] dances in the shadows, evading [P]!</span>")
|
||||
playsound(T, "bullet_miss", 75, 1)
|
||||
return -1
|
||||
return 0
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
return ..()
|
||||
|
||||
/datum/species/shadow/nightmare/check_roundstart_eligible()
|
||||
return FALSE
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE))
|
||||
if(!Proj.nodamage && Proj.damage < src.health && isliving(Proj.firer))
|
||||
retaliate(Proj.firer)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/monkey/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE)
|
||||
if(istype(AM, /obj/item))
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
/mob/living/proc/apply_effects(stun = 0, knockdown = 0, unconscious = 0, irradiate = 0, slur = 0, stutter = 0, eyeblur = 0, drowsy = 0, blocked = FALSE, stamina = 0, jitter = 0, kd_stamoverride, kd_stammax)
|
||||
if(blocked >= 100)
|
||||
return 0
|
||||
return BULLET_ACT_BLOCK
|
||||
if(stun)
|
||||
apply_effect(stun, EFFECT_STUN, blocked)
|
||||
if(knockdown)
|
||||
@@ -131,7 +131,7 @@
|
||||
apply_damage(stamina, STAMINA, null, blocked)
|
||||
if(jitter)
|
||||
apply_effect(jitter, EFFECT_JITTER, blocked)
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
|
||||
/mob/living/proc/getBruteLoss()
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
return FALSE
|
||||
|
||||
/mob/living/proc/on_hit(obj/item/projectile/P)
|
||||
return
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/mob/living/proc/check_shields(atom/AM, damage, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0)
|
||||
var/block_chance_modifier = round(damage / -3)
|
||||
@@ -76,16 +76,16 @@
|
||||
/mob/living/bullet_act(obj/item/projectile/P, def_zone)
|
||||
if(P.original != src || P.firer != src) //try to block or reflect the bullet, can't do so when shooting oneself
|
||||
if(reflect_bullet_check(P, def_zone))
|
||||
return -1 // complete projectile permutation
|
||||
return BULLET_ACT_FORCE_PIERCE // complete projectile permutation
|
||||
if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration))
|
||||
P.on_hit(src, 100, def_zone)
|
||||
return 2
|
||||
return BULLET_ACT_BLOCK
|
||||
var/armor = run_armor_check(def_zone, P.flag, null, null, P.armour_penetration, null)
|
||||
if(!P.nodamage)
|
||||
apply_damage(P.damage, P.damage_type, def_zone, armor)
|
||||
if(P.dismemberment)
|
||||
check_projectile_dismemberment(P, def_zone)
|
||||
return P.on_hit(src, armor)
|
||||
return P.on_hit(src, armor) ? BULLET_ACT_HIT : BULLET_ACT_BLOCK
|
||||
|
||||
/mob/living/proc/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
|
||||
return 0
|
||||
|
||||
@@ -2,6 +2,21 @@
|
||||
. = ..()
|
||||
update_turf_movespeed(loc)
|
||||
|
||||
/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)
|
||||
if(mover.throwing)
|
||||
return (!density || lying)
|
||||
if(buckled == mover)
|
||||
return TRUE
|
||||
if(ismob(mover))
|
||||
if (mover in buckled_mobs)
|
||||
return TRUE
|
||||
return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
|
||||
|
||||
/mob/living/toggle_move_intent()
|
||||
. = ..()
|
||||
update_move_intent_slowdown()
|
||||
|
||||
@@ -42,9 +42,8 @@
|
||||
|
||||
|
||||
/mob/living/silicon/ai/bullet_act(obj/item/projectile/Proj)
|
||||
..(Proj)
|
||||
. = ..()
|
||||
updatehealth()
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/ai/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
return // no eyes, no flashing
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
if(P.stun)
|
||||
fold_in(force = TRUE)
|
||||
visible_message("<span class='warning'>The electrically-charged projectile disrupts [src]'s holomatrix, forcing [src] to fold in!</span>")
|
||||
. = ..()
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/pai/stripPanelUnequip(obj/item/what, mob/who, where) //prevents stripping
|
||||
to_chat(src, "<span class='warning'>Your holochassis stutters and warps intensely as you attempt to interact with the object, forcing you to cease lest the field fail.</span>")
|
||||
|
||||
@@ -184,8 +184,7 @@
|
||||
adjustBruteLoss(30)
|
||||
|
||||
/mob/living/silicon/robot/bullet_act(obj/item/projectile/P, def_zone)
|
||||
..()
|
||||
. = ..()
|
||||
updatehealth()
|
||||
if(prob(75) && P.damage > 0)
|
||||
spark_system.start()
|
||||
return 2
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
unbuckle_mob(M)
|
||||
M.visible_message("<span class='boldwarning'>[M] is knocked off of [src] by the [P]!</span>")
|
||||
P.on_hit(src)
|
||||
return 2
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/static)
|
||||
if(affect_silicon)
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
return
|
||||
apply_damage(Proj.damage, Proj.damage_type)
|
||||
Proj.on_hit(src)
|
||||
return 0
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/mob/living/simple_animal/ex_act(severity, target, origin)
|
||||
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/mob/living/simple_animal/bot/secbot/grievous/bullet_act(obj/item/projectile/P)
|
||||
visible_message("[src] deflects [P] with its energy swords!")
|
||||
playsound(src, 'sound/weapons/blade1.ogg', 50, TRUE)
|
||||
return FALSE
|
||||
return BULLET_ACT_BLOCK
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/grievous/Crossed(atom/movable/AM)
|
||||
..()
|
||||
|
||||
@@ -210,7 +210,7 @@ Auto Patrol[]"},
|
||||
if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE))
|
||||
if(!Proj.nodamage && Proj.damage < src.health && ishuman(Proj.firer))
|
||||
retaliate(Proj.firer)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/bot/ed209/handle_automated_action()
|
||||
if(!..())
|
||||
@@ -510,11 +510,9 @@ Auto Patrol[]"},
|
||||
spawn(100)
|
||||
disabled = 0
|
||||
icon_state = "[lasercolor]ed2091"
|
||||
return 1
|
||||
else
|
||||
..(Proj)
|
||||
else
|
||||
..(Proj)
|
||||
return BULLET_ACT_HIT
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/bot/ed209/bluetag
|
||||
lasercolor = "b"
|
||||
|
||||
@@ -139,7 +139,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
|
||||
/mob/living/simple_animal/bot/honkbot/bullet_act(obj/item/projectile/Proj)
|
||||
if((istype(Proj,/obj/item/projectile/beam)) || (istype(Proj,/obj/item/projectile/bullet) && (Proj.damage_type == BURN))||(Proj.damage_type == BRUTE) && (!Proj.nodamage && Proj.damage < health && ishuman(Proj.firer)))
|
||||
retaliate(Proj.firer)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/bot/honkbot/UnarmedAttack(atom/A)
|
||||
if(!on)
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/bullet_act(obj/item/projectile/Proj)
|
||||
. = ..()
|
||||
if(. && !QDELETED(src)) //Got hit and not blown up yet.
|
||||
if(. == BULLET_ACT_HIT && !QDELETED(src)) //Got hit and not blown up yet.)
|
||||
if(prob(50) && !isnull(load))
|
||||
unload(0)
|
||||
if(prob(25))
|
||||
|
||||
@@ -205,7 +205,7 @@ Auto Patrol: []"},
|
||||
if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE))
|
||||
if(!Proj.nodamage && Proj.damage < src.health && ishuman(Proj.firer))
|
||||
retaliate(Proj.firer)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/UnarmedAttack(atom/A)
|
||||
|
||||
@@ -167,9 +167,9 @@
|
||||
new_angle_s -= 360
|
||||
P.setAngle(new_angle_s)
|
||||
|
||||
return -1 // complete projectile permutation
|
||||
return BULLET_ACT_FORCE_PIERCE // complete projectile permutation
|
||||
|
||||
return (..(P))
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ Difficulty: Very Hard
|
||||
|
||||
var/random_y = rand(0, 72)
|
||||
AT.pixel_y += random_y
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/colossus/proc/enrage(mob/living/L)
|
||||
if(ishuman(L))
|
||||
@@ -395,7 +395,7 @@ Difficulty: Very Hard
|
||||
..()
|
||||
|
||||
/obj/machinery/anomalous_crystal/bullet_act(obj/item/projectile/P, def_zone)
|
||||
..()
|
||||
. = ..()
|
||||
if(istype(P, /obj/item/projectile/magic))
|
||||
ActivationReaction(P.firer, ACTIVATE_MAGIC, P.damage_type)
|
||||
return
|
||||
|
||||
@@ -98,7 +98,7 @@ IGNORE_PROC_IF_NOT_TARGET(attack_slime)
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/curseblob/bullet_act(obj/item/projectile/Proj)
|
||||
if(Proj.firer != set_target)
|
||||
return
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/curseblob/attacked_by(obj/item/I, mob/living/L)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/goldgrub/bullet_act(obj/item/projectile/P)
|
||||
visible_message("<span class='danger'>The [P.name] was repelled by [name]'s girth!</span>")
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/goldgrub/adjustHealth(amount, updating_health = TRUE, forced = FALSE)
|
||||
vision_range = 9
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
if(P.damage < 30 && P.damage_type != BRUTE)
|
||||
P.damage = (P.damage / 3)
|
||||
visible_message("<span class='danger'>[P] has a reduced effect on [src]!</span>")
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM)//No floor tiling them to death, wiseguy
|
||||
if(istype(AM, /obj/item))
|
||||
|
||||
@@ -179,9 +179,10 @@
|
||||
if(T.throwforce)
|
||||
Bruise()
|
||||
|
||||
/mob/living/simple_animal/hostile/mushroom/bullet_act()
|
||||
..()
|
||||
Bruise()
|
||||
/mob/living/simple_animal/hostile/mushroom/bullet_act(obj/item/projectile/P)
|
||||
. = ..()
|
||||
if(!P.nodamage)
|
||||
Bruise()
|
||||
|
||||
/mob/living/simple_animal/hostile/mushroom/harvest()
|
||||
var/counter
|
||||
|
||||
@@ -128,13 +128,10 @@
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/syndicate/melee/bullet_act(obj/item/projectile/Proj)
|
||||
if(!Proj)
|
||||
return
|
||||
if(prob(25))
|
||||
return ..()
|
||||
else
|
||||
visible_message("<span class='danger'>[src] blocks [Proj] with its shield!</span>")
|
||||
return 0
|
||||
visible_message("<span class='danger'>[src] blocks [Proj] with its shield!</span>")
|
||||
return BULLET_ACT_BLOCK
|
||||
|
||||
/mob/living/simple_animal/hostile/syndicate/melee/sword/space
|
||||
icon_state = "syndicate_space_sword"
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
|
||||
//Bullets
|
||||
/mob/living/simple_animal/parrot/bullet_act(obj/item/projectile/Proj)
|
||||
..()
|
||||
. = ..()
|
||||
if(!stat && !client)
|
||||
if(parrot_state == PARROT_PERCH)
|
||||
parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched
|
||||
@@ -347,7 +347,6 @@
|
||||
//parrot_been_shot += 5
|
||||
icon_state = icon_living
|
||||
drop_held_item(0)
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -220,15 +220,12 @@
|
||||
return ..() //Heals them
|
||||
|
||||
/mob/living/simple_animal/slime/bullet_act(obj/item/projectile/Proj)
|
||||
if(!Proj)
|
||||
return
|
||||
attacked += 10
|
||||
if((Proj.damage_type == BURN))
|
||||
adjustBruteLoss(-abs(Proj.damage)) //fire projectiles heals slimes.
|
||||
Proj.on_hit(src)
|
||||
else
|
||||
..(Proj)
|
||||
return 0
|
||||
return BULLET_ACT_BLOCK
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/slime/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
/mob/CanPass(atom/movable/mover, turf/target)
|
||||
if((mover.pass_flags & PASSMOB))
|
||||
return TRUE
|
||||
if(istype(mover, /obj/item/projectile) || mover.throwing)
|
||||
return (!density || lying)
|
||||
if(buckled == mover)
|
||||
return TRUE
|
||||
if(ismob(mover))
|
||||
if (mover in buckled_mobs)
|
||||
return TRUE
|
||||
return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
|
||||
|
||||
//DO NOT USE THIS UNLESS YOU ABSOLUTELY HAVE TO. THIS IS BEING PHASED OUT FOR THE MOVESPEED MODIFICATION SYSTEM.
|
||||
//See mob_movespeed.dm
|
||||
/mob/proc/movement_delay() //update /living/movement_delay() if you change this
|
||||
|
||||
@@ -158,4 +158,5 @@
|
||||
// "Brute" damage mostly damages the casing.
|
||||
/obj/machinery/modular_computer/bullet_act(obj/item/projectile/Proj)
|
||||
if(cpu)
|
||||
cpu.bullet_act(Proj)
|
||||
return cpu.bullet_act(Proj)
|
||||
return ..()
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/explosion, get_turf(src), 2, 3, 4, 8), 100) // Not a normal explosion.
|
||||
|
||||
/obj/machinery/power/rtg/abductor/bullet_act(obj/item/projectile/Proj)
|
||||
..()
|
||||
. = ..()
|
||||
if(!going_kaboom && istype(Proj) && !Proj.nodamage && ((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)))
|
||||
message_admins("[ADMIN_LOOKUPFLW(Proj.firer)] triggered an Abductor Core explosion at [AREACOORD(src)] via projectile.")
|
||||
log_game("[key_name(Proj.firer)] triggered an Abductor Core explosion at [AREACOORD(src)] via projectile.")
|
||||
|
||||
@@ -113,7 +113,8 @@
|
||||
|
||||
|
||||
/obj/singularity/bullet_act(obj/item/projectile/P)
|
||||
return 0 //Will there be an impact? Who knows. Will we see it? No.
|
||||
qdel(P)
|
||||
return BULLET_ACT_HIT //Will there be an impact? Who knows. Will we see it? No.
|
||||
|
||||
|
||||
/obj/singularity/Bump(atom/A)
|
||||
|
||||
@@ -521,7 +521,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
has_been_powered = TRUE
|
||||
else if(takes_damage)
|
||||
damage += Proj.damage * config_bullet_energy
|
||||
return FALSE
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/singularity_act()
|
||||
var/gain = 100
|
||||
|
||||
@@ -569,4 +569,4 @@
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/on_hit()
|
||||
qdel(src)
|
||||
return FALSE
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
icon_state = "blastwave"
|
||||
damage = 0
|
||||
nodamage = FALSE
|
||||
forcedodge = TRUE
|
||||
movement_type = FLYING | UNSTOPPABLE
|
||||
var/heavyr = 0
|
||||
var/mediumr = 0
|
||||
var/lightr = 0
|
||||
|
||||
@@ -11,15 +11,16 @@
|
||||
item_flags = ABSTRACT
|
||||
pass_flags = PASSTABLE
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
movement_type = FLYING
|
||||
hitsound = 'sound/weapons/pierce.ogg'
|
||||
var/hitsound_wall = ""
|
||||
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
var/def_zone = "" //Aiming at
|
||||
var/atom/movable/firer = null//Who shot it
|
||||
var/atom/fired_from = null // the atom that the projectile was fired from (gun, turret)
|
||||
var/atom/fired_from = null // the atom that the projectile was fired from (gun, turret) var/suppressed = FALSE //Attack message
|
||||
var/suppressed = FALSE //Attack message
|
||||
var/candink = FALSE //Can this projectile play the dink sound when hitting the head?
|
||||
var/candink = FALSE //Can this projectile play the dink sound when hitting the head? var/yo = null
|
||||
var/yo = null
|
||||
var/xo = null
|
||||
var/atom/original = null // the original target clicked
|
||||
@@ -84,7 +85,8 @@
|
||||
var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb
|
||||
var/projectile_type = /obj/item/projectile
|
||||
var/range = 50 //This will de-increment every step. When 0, it will deletze the projectile.
|
||||
var/decayedRange
|
||||
var/decayedRange //stores original range
|
||||
var/reflect_range_decrease = 5 //amount of original range that falls off when reflecting, so it doesn't go forever
|
||||
var/is_reflectable = FALSE // Can it be reflected or not?
|
||||
//Effects
|
||||
var/stun = 0
|
||||
@@ -99,11 +101,12 @@
|
||||
var/drowsy = 0
|
||||
var/stamina = 0
|
||||
var/jitter = 0
|
||||
var/forcedodge = 0 //to pass through everything
|
||||
var/dismemberment = 0 //The higher the number, the greater the bonus to dismembering. 0 will not dismember at all.
|
||||
var/impact_effect_type //what type of impact effect to show when hitting something
|
||||
var/log_override = FALSE //is this type spammed enough to not log? (KAs)
|
||||
|
||||
var/temporary_unstoppable_movement = FALSE
|
||||
|
||||
/obj/item/projectile/Initialize()
|
||||
. = ..()
|
||||
permutated = list()
|
||||
@@ -152,12 +155,12 @@
|
||||
|
||||
W.add_dent(WALL_DENT_SHOT, hitx, hity)
|
||||
|
||||
return 0
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
if(!isliving(target))
|
||||
if(impact_effect_type && !hitscan)
|
||||
new impact_effect_type(target_loca, hitx, hity)
|
||||
return 0
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
var/mob/living/L = target
|
||||
|
||||
@@ -185,7 +188,6 @@
|
||||
C.bleed(damage)
|
||||
else
|
||||
L.add_splatter_floor(target_loca)
|
||||
|
||||
else if(impact_effect_type && !hitscan)
|
||||
new impact_effect_type(target_loca, hitx, hity)
|
||||
|
||||
@@ -235,24 +237,20 @@
|
||||
beam_segments[beam_index] = null
|
||||
|
||||
/obj/item/projectile/Bump(atom/A)
|
||||
var/turf/T = get_turf(A)
|
||||
if(trajectory && check_ricochet(A) && check_ricochet_flag(A) && ricochets < ricochets_max)
|
||||
var/datum/point/pcache = trajectory.copy_to()
|
||||
ricochets++
|
||||
if(A.handle_ricochet(src))
|
||||
on_ricochet(A)
|
||||
ignore_source_check = TRUE
|
||||
range = initial(range)
|
||||
decayedRange = max(0, decayedRange - reflect_range_decrease)
|
||||
range = decayedRange
|
||||
if(hitscan)
|
||||
store_hitscan_collision(pcache)
|
||||
return TRUE
|
||||
if(firer && !ignore_source_check)
|
||||
if(A == firer || (A == firer.loc && ismecha(A))) //cannot shoot yourself or your mech
|
||||
trajectory_ignore_forcemove = TRUE
|
||||
forceMove(get_turf(A))
|
||||
trajectory_ignore_forcemove = FALSE
|
||||
return FALSE
|
||||
|
||||
var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
|
||||
var/distance = get_dist(T, starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
|
||||
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
|
||||
|
||||
if(isturf(A) && hitsound_wall)
|
||||
@@ -261,51 +259,66 @@
|
||||
volume = 5
|
||||
playsound(loc, hitsound_wall, volume, 1, -1)
|
||||
|
||||
var/turf/target_turf = get_turf(A)
|
||||
return process_hit(T, select_target(T, A))
|
||||
|
||||
if(!prehit(A))
|
||||
if(forcedodge)
|
||||
trajectory_ignore_forcemove = TRUE
|
||||
forceMove(target_turf)
|
||||
trajectory_ignore_forcemove = FALSE
|
||||
return FALSE
|
||||
#define QDEL_SELF 1 //Delete if we're not UNSTOPPABLE flagged non-temporarily
|
||||
#define DO_NOT_QDEL 2 //Pass through.
|
||||
#define FORCE_QDEL 3 //Force deletion.
|
||||
|
||||
var/permutation = A.bullet_act(src, def_zone) // searches for return value, could be deleted after run so check A isn't null
|
||||
if(permutation == -1 || forcedodge)// the bullet passes through a dense object!
|
||||
trajectory_ignore_forcemove = TRUE
|
||||
forceMove(target_turf)
|
||||
trajectory_ignore_forcemove = FALSE
|
||||
if(A)
|
||||
permutated.Add(A)
|
||||
return FALSE
|
||||
else
|
||||
var/atom/alt = select_target(A)
|
||||
if(alt)
|
||||
if(!prehit(alt))
|
||||
return FALSE
|
||||
alt.bullet_act(src, def_zone)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
/obj/item/projectile/proc/process_hit(turf/T, atom/target, qdel_self, hit_something = FALSE) //probably needs to be reworked entirely when pixel movement is done.
|
||||
if(QDELETED(src) || !T || !target) //We're done, nothing's left.
|
||||
if((qdel_self == FORCE_QDEL) || ((qdel_self == QDEL_SELF) && !temporary_unstoppable_movement && !CHECK_BITFIELD(movement_type, UNSTOPPABLE)))
|
||||
qdel(src)
|
||||
return hit_something
|
||||
permutated |= target //Make sure we're never hitting it again. If we ever run into weirdness with piercing projectiles needing to hit something multiple times.. well.. that's a to-do.
|
||||
if(!prehit(target))
|
||||
return process_hit(T, select_target(T), qdel_self, hit_something) //Hit whatever else we can since that didn't work.
|
||||
var/result = target.bullet_act(src, def_zone)
|
||||
if(result == BULLET_ACT_FORCE_PIERCE)
|
||||
if(!CHECK_BITFIELD(movement_type, UNSTOPPABLE))
|
||||
temporary_unstoppable_movement = TRUE
|
||||
ENABLE_BITFIELD(movement_type, UNSTOPPABLE)
|
||||
return process_hit(T, select_target(T), qdel_self, TRUE) //Hit whatever else we can since we're piercing through but we're still on the same tile.
|
||||
else if(result == BULLET_ACT_TURF) //We hit the turf but instead we're going to also hit something else on it.
|
||||
return process_hit(T, select_target(T), QDEL_SELF, TRUE)
|
||||
else //Whether it hit or blocked, we're done!
|
||||
qdel_self = QDEL_SELF
|
||||
hit_something = TRUE
|
||||
if((qdel_self == FORCE_QDEL) || ((qdel_self == QDEL_SELF) && !temporary_unstoppable_movement && !CHECK_BITFIELD(movement_type, UNSTOPPABLE)))
|
||||
qdel(src)
|
||||
return hit_something
|
||||
|
||||
/obj/item/projectile/proc/select_target(atom/A) //Selects another target from a wall if we hit a wall.
|
||||
if(!A || !A.density || (A.flags_1 & ON_BORDER_1) || ismob(A) || A == original) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs or machines/structures on that tile.
|
||||
return
|
||||
var/turf/T = get_turf(A)
|
||||
if(original in T)
|
||||
#undef QDEL_SELF
|
||||
#undef DO_NOT_QDEL
|
||||
#undef FORCE_QDEL
|
||||
|
||||
/obj/item/projectile/proc/select_target(turf/T, atom/target) //Select a target from a turf.
|
||||
if((original in T) && can_hit_target(original, permutated, TRUE, TRUE))
|
||||
return original
|
||||
var/list/mob/possible_mobs = typecache_filter_list(T, GLOB.typecache_mob) - A
|
||||
if(target && can_hit_target(target, permutated, target == original, TRUE))
|
||||
return target
|
||||
var/list/mob/living/possible_mobs = typecache_filter_list(T, GLOB.typecache_mob)
|
||||
var/list/mob/mobs = list()
|
||||
for(var/i in possible_mobs)
|
||||
var/mob/M = i
|
||||
if(M.lying)
|
||||
for(var/mob/living/M in possible_mobs)
|
||||
if(!can_hit_target(M, permutated, M == original, TRUE))
|
||||
continue
|
||||
mobs += M
|
||||
var/mob/M = safepick(mobs)
|
||||
if(M)
|
||||
return M.lowest_buckled_mob()
|
||||
var/obj/O = safepick(typecache_filter_list(T, GLOB.typecache_machine_or_structure) - A)
|
||||
var/list/obj/possible_objs = typecache_filter_list(T, GLOB.typecache_machine_or_structure)
|
||||
var/list/obj/objs = list()
|
||||
for(var/obj/O in possible_objs)
|
||||
if(!can_hit_target(O, permutated, O == original, TRUE))
|
||||
continue
|
||||
objs += O
|
||||
var/obj/O = safepick(objs)
|
||||
if(O)
|
||||
return O
|
||||
//Nothing else is here that we can hit, hit the turf if we haven't.
|
||||
if(!(T in permutated) && can_hit_target(T, permutated, T == original, TRUE))
|
||||
return T
|
||||
//Returns null if nothing at all was found.
|
||||
|
||||
/obj/item/projectile/proc/check_ricochet()
|
||||
if(prob(ricochet_chance))
|
||||
@@ -332,7 +345,7 @@
|
||||
var/turf/ending = return_predicted_turf_after_moves(moves, forced_angle)
|
||||
return getline(current, ending)
|
||||
|
||||
/obj/item/projectile/Process_Spacemove(var/movement_dir = 0)
|
||||
/obj/item/projectile/Process_Spacemove(movement_dir = 0)
|
||||
return TRUE //Bullets don't drift in space
|
||||
|
||||
/obj/item/projectile/process()
|
||||
@@ -360,8 +373,7 @@
|
||||
|
||||
/obj/item/projectile/proc/fire(angle, atom/direct_target)
|
||||
if(fired_from)
|
||||
SEND_SIGNAL(fired_from, COMSIG_PROJECTILE_BEFORE_FIRE, src, original)
|
||||
//If no angle needs to resolve it from xo/yo!
|
||||
SEND_SIGNAL(fired_from, COMSIG_PROJECTILE_BEFORE_FIRE, src, original) //If no angle needs to resolve it from xo/yo!
|
||||
if(!log_override && firer && original)
|
||||
log_combat(firer, original, "fired at", src, "from [get_area_name(src, TRUE)]")
|
||||
if(direct_target)
|
||||
@@ -498,8 +510,6 @@
|
||||
else if(T != loc)
|
||||
step_towards(src, T)
|
||||
hitscan_last = loc
|
||||
if(can_hit_target(original, permutated))
|
||||
Bump(original)
|
||||
if(!hitscanning && !forcemoved)
|
||||
pixel_x = trajectory.return_px() - trajectory.mpx * trajectory_multiplier * SSprojectiles.global_iterations_per_move
|
||||
pixel_y = trajectory.return_py() - trajectory.mpy * trajectory_multiplier * SSprojectiles.global_iterations_per_move
|
||||
@@ -528,8 +538,28 @@
|
||||
homing_offset_y = -homing_offset_y
|
||||
|
||||
//Returns true if the target atom is on our current turf and above the right layer
|
||||
/obj/item/projectile/proc/can_hit_target(atom/target, var/list/passthrough)
|
||||
return (target && ((target.layer >= PROJECTILE_HIT_THRESHHOLD_LAYER) || ismob(target)) && (loc == get_turf(target)) && (!(target in passthrough)))
|
||||
//If direct target is true it's the originally clicked target.
|
||||
/obj/item/projectile/proc/can_hit_target(atom/target, list/passthrough, direct_target = FALSE, ignore_loc = FALSE)
|
||||
if(QDELETED(target))
|
||||
return FALSE
|
||||
if(!ignore_source_check && firer)
|
||||
var/mob/M = firer
|
||||
if((target == firer) || ((target == firer.loc) && ismecha(firer.loc)) || (target in firer.buckled_mobs) || (istype(M) && (M.buckled == target)))
|
||||
return FALSE
|
||||
if(!ignore_loc && (loc != target.loc))
|
||||
return FALSE
|
||||
if(target in passthrough)
|
||||
return FALSE
|
||||
if(target.density) //This thing blocks projectiles, hit it regardless of layer/mob stuns/etc.
|
||||
return TRUE
|
||||
if(!isliving(target))
|
||||
if(target.layer < PROJECTILE_HIT_THRESHHOLD_LAYER)
|
||||
return FALSE
|
||||
else
|
||||
var/mob/living/L = target
|
||||
if(!direct_target && !L.density)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//Spread is FORCED!
|
||||
/obj/item/projectile/proc/preparePixelProjectile(atom/target, atom/source, params, spread = 0)
|
||||
@@ -591,9 +621,20 @@
|
||||
return list(angle, p_x, p_y)
|
||||
|
||||
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
|
||||
..()
|
||||
if(isliving(AM) && (AM.density || AM == original) && !(src.pass_flags & PASSMOB))
|
||||
Bump(AM)
|
||||
. = ..()
|
||||
if(isliving(AM) && !(pass_flags & PASSMOB))
|
||||
var/mob/living/L = AM
|
||||
if(can_hit_target(L, permutated, (AM == original)))
|
||||
Bump(AM)
|
||||
|
||||
/obj/item/projectile/Move(atom/newloc, dir = NONE)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(temporary_unstoppable_movement)
|
||||
temporary_unstoppable_movement = FALSE
|
||||
DISABLE_BITFIELD(movement_type, UNSTOPPABLE)
|
||||
if(fired && can_hit_target(original, permutated, TRUE))
|
||||
Bump(original)
|
||||
|
||||
/obj/item/projectile/Destroy()
|
||||
if(hitscan)
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = FALSE)
|
||||
life -= 10
|
||||
if(life > 0)
|
||||
. = -1
|
||||
..()
|
||||
. = BULLET_ACT_FORCE_PIERCE
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/beam/emitter
|
||||
name = "emitter beam"
|
||||
@@ -207,4 +207,4 @@
|
||||
. = ..()
|
||||
if(isopenturf(target) || istype(target, /turf/closed/indestructible))//shrunk floors wouldnt do anything except look weird, i-walls shouldnt be bypassable
|
||||
return
|
||||
target.AddComponent(/datum/component/shrink, shrink_time)
|
||||
target.AddComponent(/datum/component/shrink, shrink_time)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
|
||||
..()
|
||||
if(skip == TRUE)
|
||||
return
|
||||
return BULLET_ACT_HIT
|
||||
reagents.reaction(M, INJECT)
|
||||
reagents.trans_to(M, reagents.total_volume)
|
||||
return TRUE
|
||||
@@ -27,7 +27,7 @@
|
||||
..(target, blocked)
|
||||
DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT)
|
||||
reagents.handle_reactions()
|
||||
return TRUE
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/projectile/bullet/dart/metalfoam/Initialize()
|
||||
. = ..()
|
||||
@@ -70,11 +70,11 @@
|
||||
|
||||
target.visible_message("<span class='notice'>\The [src] beeps!</span>")
|
||||
to_chat("<span class='notice'><i>You feel a tiny prick as a smartdart embeds itself in you with a beep.</i></span>")
|
||||
return TRUE
|
||||
return BULLET_ACT_HIT
|
||||
else
|
||||
blocked = 100
|
||||
target.visible_message("<span class='danger'>\The [src] was deflected!</span>", \
|
||||
"<span class='userdanger'>You see a [src] bounce off you, booping sadly!</span>")
|
||||
|
||||
target.visible_message("<span class='danger'>\The [src] fails to land on target!</span>")
|
||||
return TRUE
|
||||
return BULLET_ACT_BLOCK
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
if(M.can_inject(null, FALSE, def_zone, FALSE))
|
||||
if(injector.inject(M, firer))
|
||||
QDEL_NULL(injector)
|
||||
return TRUE
|
||||
return BULLET_ACT_HIT
|
||||
else
|
||||
blocked = 100
|
||||
target.visible_message("<span class='danger'>\The [src] was deflected!</span>", \
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
/obj/item/projectile/bullet/a40mm/on_hit(atom/target, blocked = FALSE)
|
||||
..()
|
||||
explosion(target, -1, 0, 2, 1, 0, flame_range = 3)
|
||||
return TRUE
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
/obj/item/projectile/bullet/shotgun_frag12/on_hit(atom/target, blocked = FALSE)
|
||||
..()
|
||||
explosion(target, -1, 0, 1)
|
||||
return TRUE
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/projectile/bullet/pellet
|
||||
var/tile_dropoff = 0.75
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
icon_state = "gauss"
|
||||
name = "penetrator round"
|
||||
damage = 60
|
||||
forcedodge = TRUE
|
||||
movement_type = FLYING | UNSTOPPABLE
|
||||
dismemberment = 0 //It goes through you cleanly.
|
||||
knockdown = 0
|
||||
breakthings = FALSE
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/obj/item/projectile/bullet/honker
|
||||
damage = 0
|
||||
knockdown = 60
|
||||
forcedodge = TRUE
|
||||
movement_type = FLYING | UNSTOPPABLE
|
||||
nodamage = TRUE
|
||||
candink = FALSE
|
||||
hitsound = 'sound/items/bikehorn.ogg'
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
var/turf/Tloc = get_turf(target)
|
||||
if(!locate(/obj/effect/nettingportal) in Tloc)
|
||||
new /obj/effect/nettingportal(Tloc)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/energy/net/on_range()
|
||||
do_sparks(1, TRUE, src)
|
||||
@@ -69,7 +69,7 @@
|
||||
else if(iscarbon(target))
|
||||
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy(get_turf(target))
|
||||
B.Crossed(target)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/energy/trap/on_range()
|
||||
new /obj/item/restraints/legcuffs/beartrap/energy(loc)
|
||||
@@ -91,7 +91,7 @@
|
||||
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(target))
|
||||
B.Crossed(target)
|
||||
QDEL_IN(src, 10)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/energy/trap/cyborg/on_range()
|
||||
do_sparks(1, TRUE, src)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
var/mob/M = target
|
||||
if(M.anti_magic_check())
|
||||
M.visible_message("<span class='warning'>[src] vanishes on contact with [target]!</span>")
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
M.death(0)
|
||||
|
||||
/obj/item/projectile/magic/resurrection
|
||||
@@ -31,10 +31,10 @@
|
||||
. = ..()
|
||||
if(isliving(target))
|
||||
if(target.hellbound)
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
if(target.anti_magic_check())
|
||||
target.visible_message("<span class='warning'>[src] vanishes on contact with [target]!</span>")
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
C.regenerate_limbs()
|
||||
@@ -60,7 +60,7 @@
|
||||
var/mob/M = target
|
||||
if(M.anti_magic_check())
|
||||
M.visible_message("<span class='warning'>[src] fizzles on contact with [target]!</span>")
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
var/teleammount = 0
|
||||
var/teleloc = target
|
||||
if(!isturf(target))
|
||||
@@ -116,7 +116,7 @@
|
||||
if(M.anti_magic_check())
|
||||
M.visible_message("<span class='warning'>[src] fizzles on contact with [M]!</span>")
|
||||
qdel(src)
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
wabbajack(change)
|
||||
qdel(src)
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
|
||||
/obj/item/projectile/magic/animate/on_hit(atom/target, blocked = FALSE)
|
||||
target.animate_atom_living(firer)
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
/atom/proc/animate_atom_living(var/mob/living/owner = null)
|
||||
if((isitem(src) || isstructure(src)) && !is_type_in_list(src, GLOB.protected_objects))
|
||||
@@ -315,7 +315,7 @@
|
||||
if(M.anti_magic_check())
|
||||
M.visible_message("<span class='warning'>[src] vanishes on contact with [target]!</span>")
|
||||
qdel(src)
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
. = ..()
|
||||
|
||||
/obj/item/projectile/magic/arcane_barrage
|
||||
@@ -334,7 +334,7 @@
|
||||
if(M.anti_magic_check())
|
||||
M.visible_message("<span class='warning'>[src] vanishes on contact with [target]!</span>")
|
||||
qdel(src)
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@
|
||||
if(M.anti_magic_check())
|
||||
visible_message("<span class='warning'>[src] fizzles on contact with [target]!</span>")
|
||||
qdel(src)
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
tesla_zap(src, tesla_range, tesla_power, tesla_flags)
|
||||
qdel(src)
|
||||
|
||||
@@ -487,7 +487,7 @@
|
||||
var/mob/living/M = target
|
||||
if(M.anti_magic_check())
|
||||
visible_message("<span class='warning'>[src] vanishes into smoke on contact with [target]!</span>")
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
M.take_overall_damage(0,10) //between this 10 burn, the 10 brute, the explosion brute, and the onfire burn, your at about 65 damage if you stop drop and roll immediately
|
||||
var/turf/T = get_turf(target)
|
||||
explosion(T, -1, exp_heavy, exp_light, exp_flash, 0, flame_range = exp_fire)
|
||||
@@ -504,7 +504,7 @@
|
||||
if(ismob(target))
|
||||
var/mob/living/M = target
|
||||
if(M.anti_magic_check())
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
var/turf/T = get_turf(target)
|
||||
for(var/i=0, i<50, i+=10)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/explosion, T, -1, exp_heavy, exp_light, exp_flash, FALSE, FALSE, exp_fire), i)
|
||||
@@ -518,11 +518,11 @@
|
||||
|
||||
/obj/item/projectile/magic/nuclear/on_hit(target)
|
||||
if(used)
|
||||
return
|
||||
return BULLET_ACT_HIT
|
||||
new/obj/effect/temp_visual/slugboom(get_turf(src))
|
||||
if(ismob(target))
|
||||
if(target == victim)
|
||||
return
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
used = 1
|
||||
visible_message("<span class='danger'>[victim] slams into [target] with explosive force!</span>")
|
||||
explosion(src, 2, 3, 4, -1, TRUE, FALSE, 5)
|
||||
@@ -531,8 +531,9 @@
|
||||
victim.take_overall_damage(30,30)
|
||||
victim.Knockdown(60)
|
||||
explosion(src, -1, -1, -1, -1, FALSE, FALSE, 5)
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/projectile/magic/nuclear/Destroy()
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.forceMove(get_turf(src))
|
||||
. = ..()
|
||||
. = ..()
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
knockdown = 20
|
||||
speed = 2
|
||||
range = 16
|
||||
forcedodge = TRUE
|
||||
movement_type = FLYING | UNSTOPPABLE
|
||||
var/datum/beam/arm
|
||||
var/handedness = 0
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/obj/item/projectile/curse_hand/prehit(atom/target)
|
||||
if(target == original)
|
||||
forcedodge = FALSE
|
||||
DISABLE_BITFIELD(movement_type, UNSTOPPABLE)
|
||||
else if(!isturf(target))
|
||||
return FALSE
|
||||
return ..()
|
||||
@@ -37,7 +37,7 @@
|
||||
if(arm)
|
||||
arm.End()
|
||||
arm = null
|
||||
if(forcedodge)
|
||||
if(CHECK_BITFIELD(movement_type, UNSTOPPABLE))
|
||||
playsound(src, 'sound/effects/curse3.ogg', 25, 1, -1)
|
||||
var/turf/T = get_step(src, dir)
|
||||
new/obj/effect/temp_visual/dir_setting/curse/hand(T, dir, handedness)
|
||||
|
||||
@@ -6,15 +6,12 @@
|
||||
nodamage = 1
|
||||
flag = "energy"
|
||||
impact_effect_type = /obj/effect/temp_visual/impact_effect/ion
|
||||
var/emp_radius = 1
|
||||
|
||||
/obj/item/projectile/ion/on_hit(atom/target, blocked = FALSE)
|
||||
..()
|
||||
empulse(target, 1, 1)
|
||||
return TRUE
|
||||
empulse(target, emp_radius, emp_radius)
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/projectile/ion/weak
|
||||
|
||||
/obj/item/projectile/ion/weak/on_hit(atom/target, blocked = FALSE)
|
||||
..()
|
||||
empulse(target, 0, 0)
|
||||
return TRUE
|
||||
emp_radius = 0
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
mine_range--
|
||||
range++
|
||||
if(range > 0)
|
||||
return -1
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
|
||||
/obj/item/projectile/plasma/adv
|
||||
damage = 28
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/obj/item/projectile/bullet/gyro/on_hit(atom/target, blocked = FALSE)
|
||||
..()
|
||||
explosion(target, -1, 0, 2)
|
||||
return TRUE
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/projectile/bullet/a84mm
|
||||
name ="\improper HEDP rocket"
|
||||
@@ -28,7 +28,7 @@
|
||||
if(issilicon(target))
|
||||
var/mob/living/silicon/S = target
|
||||
S.take_overall_damage(anti_armour_damage*0.75, anti_armour_damage*0.25)
|
||||
return TRUE
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/projectile/bullet/a84mm_he
|
||||
name ="\improper HE missile"
|
||||
@@ -43,4 +43,4 @@
|
||||
explosion(target, 0, 1, 2, 4)
|
||||
else
|
||||
explosion(target, 0, 0, 2, 4)
|
||||
return TRUE
|
||||
return BULLET_ACT_HIT
|
||||
@@ -25,5 +25,5 @@
|
||||
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
|
||||
if(!gun)
|
||||
qdel(src)
|
||||
return
|
||||
return BULLET_ACT_BLOCK
|
||||
gun.create_portal(src, get_turf(src))
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
boom()
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/bullet_act(obj/item/projectile/P)
|
||||
..()
|
||||
. = ..()
|
||||
if(!QDELETED(src)) //wasn't deleted by the projectile's effects.
|
||||
if(!P.nodamage && ((P.damage_type == BURN) || (P.damage_type == BRUTE)))
|
||||
var/boom_message = "[ADMIN_LOOKUPFLW(P.firer)] triggered a fueltank explosion via projectile."
|
||||
|
||||
@@ -99,5 +99,6 @@
|
||||
|
||||
/obj/effect/dummy/phased_mob/spell_jaunt/ex_act(blah)
|
||||
return
|
||||
|
||||
/obj/effect/dummy/phased_mob/spell_jaunt/bullet_act(blah)
|
||||
return
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
@@ -91,7 +91,7 @@
|
||||
return
|
||||
|
||||
/obj/effect/dummy/phased_mob/shadow/bullet_act()
|
||||
return
|
||||
return BULLET_ACT_FORCE_PIERCE
|
||||
|
||||
/obj/effect/dummy/phased_mob/shadow/singularity_act()
|
||||
return
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
range = 2
|
||||
|
||||
/obj/item/projectile/sickshot/on_hit(var/atom/movable/target, var/blocked = 0)
|
||||
. = ..()
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/H = target
|
||||
if(prob(5))
|
||||
@@ -28,7 +29,7 @@
|
||||
H.release_vore_contents()
|
||||
H.visible_message("<span class='danger'>[H] contracts strangely, spewing out contents on the floor!</span>", \
|
||||
"<span class='userdanger'>You spew out everything inside you on the floor!</span>")
|
||||
return
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
|
||||
////////////////////////// Anti-Noms Drugs //////////////////////////
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
impact_type = /obj/effect/projectile/xray/impact
|
||||
|
||||
/obj/item/projectile/beam/shrinklaser/on_hit(var/atom/target, var/blocked = 0)
|
||||
if(istype(target, /mob/living))
|
||||
. = ..()
|
||||
if(isliving(target))
|
||||
var/mob/living/M = target
|
||||
switch(M.size_multiplier)
|
||||
if(SIZESCALE_HUGE to INFINITY)
|
||||
@@ -54,7 +55,7 @@
|
||||
if((0 - INFINITY) to SIZESCALE_NORMAL)
|
||||
M.sizescale(SIZESCALE_TINY)
|
||||
M.update_transform()
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/projectile/beam/growlaser
|
||||
name = "growth beam"
|
||||
@@ -68,7 +69,8 @@
|
||||
impact_type = /obj/effect/projectile/laser_blue/impact
|
||||
|
||||
/obj/item/projectile/beam/growlaser/on_hit(var/atom/target, var/blocked = 0)
|
||||
if(istype(target, /mob/living))
|
||||
. = ..()
|
||||
if(isliving(target))
|
||||
var/mob/living/M = target
|
||||
switch(M.size_multiplier)
|
||||
if(SIZESCALE_BIG to SIZESCALE_HUGE)
|
||||
@@ -80,7 +82,7 @@
|
||||
if((0 - INFINITY) to SIZESCALE_TINY)
|
||||
M.sizescale(SIZESCALE_SMALL)
|
||||
M.update_transform()
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
*/
|
||||
|
||||
datum/design/sizeray
|
||||
@@ -108,7 +110,8 @@ datum/design/sizeray
|
||||
icon_state="laser"
|
||||
|
||||
/obj/item/projectile/sizeray/shrinkray/on_hit(var/atom/target, var/blocked = 0)
|
||||
if(istype(target, /mob/living))
|
||||
. = ..()
|
||||
if(isliving(target))
|
||||
var/mob/living/M = target
|
||||
switch(M.size_multiplier)
|
||||
if(SIZESCALE_HUGE to INFINITY)
|
||||
@@ -120,10 +123,11 @@ datum/design/sizeray
|
||||
if((0 - INFINITY) to SIZESCALE_NORMAL)
|
||||
M.sizescale(SIZESCALE_TINY)
|
||||
M.update_transform()
|
||||
return 1
|
||||
return BULLET_ACT_
|
||||
|
||||
/obj/item/projectile/sizeray/growthray/on_hit(var/atom/target, var/blocked = 0)
|
||||
if(istype(target, /mob/living))
|
||||
. = ..()
|
||||
if(isliving(target))
|
||||
var/mob/living/M = target
|
||||
switch(M.size_multiplier)
|
||||
if(SIZESCALE_BIG to SIZESCALE_HUGE)
|
||||
@@ -135,7 +139,7 @@ datum/design/sizeray
|
||||
if((0 - INFINITY) to SIZESCALE_TINY)
|
||||
M.sizescale(SIZESCALE_SMALL)
|
||||
M.update_transform()
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/ammo_casing/energy/laser/growthray
|
||||
projectile_type = /obj/item/projectile/sizeray/growthray
|
||||
|
||||
@@ -66,6 +66,7 @@ obj/item/projectile/bullet/c10mm/soporific
|
||||
knockdown = 0
|
||||
|
||||
/obj/item/projectile/bullet/c10mm/soporific/on_hit(atom/target, blocked = FALSE)
|
||||
. = ..()
|
||||
if((blocked != 100) && isliving(target))
|
||||
var/mob/living/L = target
|
||||
L.blur_eyes(6)
|
||||
@@ -73,7 +74,6 @@ obj/item/projectile/bullet/c10mm/soporific
|
||||
L.Sleeping(300)
|
||||
else
|
||||
L.adjustStaminaLoss(25)
|
||||
return 1
|
||||
|
||||
/obj/item/ammo_casing/c10mm/soporific
|
||||
name = ".10mm soporific bullet casing"
|
||||
|
||||
@@ -355,7 +355,7 @@
|
||||
damage = 10
|
||||
armour_penetration = 10
|
||||
stamina = 10
|
||||
forcedodge = TRUE
|
||||
movement_type = FLYING | UNSTOPPABLE
|
||||
range = 6
|
||||
light_range = 1
|
||||
light_color = LIGHT_COLOR_RED
|
||||
@@ -363,14 +363,14 @@
|
||||
/obj/item/projectile/bullet/mags/hyper/inferno
|
||||
icon_state = "magjectile-large"
|
||||
stamina = 0
|
||||
forcedodge = FALSE
|
||||
movement_type = FLYING | UNSTOPPABLE
|
||||
range = 25
|
||||
light_range = 4
|
||||
|
||||
/obj/item/projectile/bullet/mags/hyper/inferno/on_hit(atom/target, blocked = FALSE)
|
||||
..()
|
||||
explosion(target, -1, 1, 2, 4, 5)
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
///ammo casings///
|
||||
|
||||
@@ -436,7 +436,7 @@
|
||||
icon = 'modular_citadel/icons/obj/guns/cit_guns.dmi'
|
||||
icon_state = "magjectile-toy"
|
||||
name = "lasertag magbolt"
|
||||
forcedodge = TRUE //for penetration memes
|
||||
movement_type = FLYING | UNSTOPPABLE //for penetration memes
|
||||
range = 5 //so it isn't super annoying
|
||||
light_range = 2
|
||||
light_color = LIGHT_COLOR_YELLOW
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/obj/item/projectile/bullet/spinfusor/on_hit(atom/target, blocked = FALSE) //explosion to emulate the spinfusor's AOE
|
||||
..()
|
||||
explosion(target, -1, -1, 2, 0, -1)
|
||||
return 1
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/obj/item/ammo_casing/caseless/spinfusor
|
||||
name = "spinfusor disk"
|
||||
|
||||
Reference in New Issue
Block a user