mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-18 11:30:35 +01:00
Powerful Mechs (#12193)
This commit is contained in:
@@ -120,6 +120,8 @@
|
||||
var/has_safety = TRUE
|
||||
var/image/safety_overlay
|
||||
|
||||
var/iff_capable = FALSE // if true, applies the user's ID iff_faction to the projectile
|
||||
|
||||
// sounds n shit
|
||||
var/safetyon_sound = 'sound/weapons/blade_open.ogg'
|
||||
var/safetyoff_sound = 'sound/weapons/blade_close.ogg'
|
||||
|
||||
@@ -99,6 +99,8 @@
|
||||
var/hit_effect
|
||||
var/anti_materiel_potential = 1 //how much the damage of this bullet is increased against mechs
|
||||
|
||||
var/iff // identify friend or foe. will check mob's IDs to see if they match, if they do, won't hit
|
||||
|
||||
/obj/item/projectile/CanPass()
|
||||
return TRUE
|
||||
|
||||
@@ -173,8 +175,17 @@
|
||||
shot_from = launcher.name
|
||||
silenced = launcher.silenced
|
||||
|
||||
if(launcher.iff_capable && user)
|
||||
iff = get_iff_from_user(user)
|
||||
|
||||
return launch_projectile(target, target_zone, user, params, angle_override, forced_spread)
|
||||
|
||||
/obj/item/projectile/proc/get_iff_from_user(var/mob/user)
|
||||
var/obj/item/card/id/ID = user.GetIdCard()
|
||||
if(ID)
|
||||
return ID.iff_faction
|
||||
return null
|
||||
|
||||
//Called when the projectile intercepts a mob. Returns 1 if the projectile hit the mob, 0 if it missed and should keep flying.
|
||||
/obj/item/projectile/proc/attack_mob(var/mob/living/target_mob, var/distance, var/miss_modifier=0)
|
||||
if(!istype(target_mob))
|
||||
@@ -203,14 +214,7 @@
|
||||
if(PROJECTILE_STOPPED)
|
||||
return TRUE
|
||||
|
||||
var/impacted_organ = parse_zone(def_zone)
|
||||
if(isanimal(target_mob))
|
||||
var/mob/living/simple_animal/SA = target_mob
|
||||
impacted_organ = pick(SA.organ_names)
|
||||
else if(ishuman(target_mob))
|
||||
var/mob/living/carbon/human/H = target_mob
|
||||
var/obj/item/organ/external/E = H.organs_by_name[impacted_organ]
|
||||
impacted_organ = E.name
|
||||
var/impacted_organ = target_mob.get_organ_name_from_zone(def_zone)
|
||||
//hit messages
|
||||
if(silenced)
|
||||
to_chat(target_mob, "<span class='danger'>You've been hit in the [impacted_organ] by \a [src]!</span>")
|
||||
@@ -268,15 +272,18 @@
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
if(isliving(A)) //so ghosts don't stop bullets
|
||||
if(M.dir & get_dir(M, starting)) // only check neckgrab if they're facing in the direction the bullets came from
|
||||
//if they have a neck grab on someone, that person gets hit instead
|
||||
for(var/obj/item/grab/G in list(M.l_hand, M.r_hand))
|
||||
if(!G.affecting.lying && G.state >= GRAB_NECK)
|
||||
visible_message(SPAN_DANGER("\The [M] uses [G.affecting] as a shield!"))
|
||||
if(Collide(G.affecting))
|
||||
return //If Collide() returns 0 (keep going) then we continue on to attack M.
|
||||
if(check_iff(M))
|
||||
passthrough = TRUE
|
||||
else
|
||||
if(M.dir & get_dir(M, starting)) // only check neckgrab if they're facing in the direction the bullets came from
|
||||
//if they have a neck grab on someone, that person gets hit instead
|
||||
for(var/obj/item/grab/G in list(M.l_hand, M.r_hand))
|
||||
if(!G.affecting.lying && G.state >= GRAB_NECK)
|
||||
visible_message(SPAN_DANGER("\The [M] uses [G.affecting] as a shield!"))
|
||||
if(Collide(G.affecting))
|
||||
return //If Collide() returns 0 (keep going) then we continue on to attack M.
|
||||
|
||||
passthrough = !attack_mob(M, distance)
|
||||
passthrough = !attack_mob(M, distance)
|
||||
else
|
||||
passthrough = TRUE
|
||||
else
|
||||
@@ -312,6 +319,14 @@
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/obj/item/projectile/proc/check_iff(var/mob/M)
|
||||
if(isnull(iff))
|
||||
return FALSE
|
||||
var/obj/item/card/id/ID = M.GetIdCard()
|
||||
if(ID && (ID.iff_faction == iff))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/projectile/ex_act(var/severity = 2.0)
|
||||
return //explosions probably shouldn't delete projectiles
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
damage = 35
|
||||
armor_penetration = 10
|
||||
|
||||
/obj/item/projectile/beam/midlaser/mech
|
||||
armor_penetration = 35
|
||||
|
||||
/obj/item/projectile/beam/heavylaser
|
||||
name = "heavy laser"
|
||||
icon_state = "heavylaser"
|
||||
@@ -70,6 +73,10 @@
|
||||
tracer_type = /obj/effect/projectile/tracer/xray
|
||||
impact_type = /obj/effect/projectile/impact/xray
|
||||
|
||||
/obj/item/projectile/beam/xray/mech
|
||||
damage = 40
|
||||
armor_penetration = 75
|
||||
|
||||
/obj/item/projectile/beam/pulse
|
||||
name = "pulse"
|
||||
icon_state = "u_laser"
|
||||
@@ -80,6 +87,10 @@
|
||||
tracer_type = /obj/effect/projectile/tracer/pulse
|
||||
impact_type = /obj/effect/projectile/impact/pulse
|
||||
|
||||
/obj/item/projectile/beam/pulse/mech
|
||||
damage = 45
|
||||
armor_penetration = 40
|
||||
|
||||
/obj/item/projectile/beam/pulse/on_hit(var/atom/target, var/blocked = 0)
|
||||
if(isturf(target))
|
||||
target.ex_act(2)
|
||||
|
||||
@@ -127,6 +127,9 @@
|
||||
/obj/item/projectile/bullet/pistol/medium
|
||||
damage = 30
|
||||
|
||||
/obj/item/projectile/bullet/pistol/medium/mech
|
||||
armor_penetration = 35
|
||||
|
||||
/obj/item/projectile/bullet/pistol/strong
|
||||
damage = 45
|
||||
armor_penetration = 20
|
||||
|
||||
Reference in New Issue
Block a user