Skip to content

Commit

Permalink
Rebalances the 3 least used non temp or illegal guns, + BSG (#27476)
Browse files Browse the repository at this point in the history
* guns

* bsg fix, shield

* lwap scoped always hits crawling mobs

* decrease scope time

* Apply suggestions from code review

Co-authored-by: Burzah <[email protected]>
Signed-off-by: Qwertytoforty <[email protected]>

---------

Signed-off-by: Qwertytoforty <[email protected]>
Co-authored-by: Burzah <[email protected]>
  • Loading branch information
Qwertytoforty and Burzah authored Dec 5, 2024
1 parent 4146b97 commit 9f01db0
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 22 deletions.
1 change: 1 addition & 0 deletions code/__HELPERS/trait_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NPC_ZOMBIE "npc_zombie" // A trait for checking if a zombie should act like an NPC and attack
#define TRAIT_ABSTRACT_HANDS "abstract_hands" // Mobs with this trait can only pick up abstract items.
#define TRAIT_LANGUAGE_LOCKED "language_locked" // cant add/remove languages until removed (excludes babel because fuck everything i guess)
#define TRAIT_BSG_IMMUNE "bsg_immune" // Granted by BSG when held, prevents BSG AOE from hitting you
#define TRAIT_PLAYING_CARDS "playing_cards"
#define TRAIT_EMP_IMMUNE "emp_immune" //The mob will take no damage from EMPs
#define TRAIT_EMP_RESIST "emp_resist" //The mob will take less damage from EMPs
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_LANGUAGE_LOCKED" = TRAIT_LANGUAGE_LOCKED,
"TRAIT_NON_INFECTIOUS_ZOMBIE" = TRAIT_NON_INFECTIOUS_ZOMBIE,
"TRAIT_CANNOT_PULL" = TRAIT_CANNOT_PULL,
"TRAIT_BSG_IMMUNE" = TRAIT_BSG_IMMUNE,
"TRAIT_FLYING" = TRAIT_FLYING

),

/datum/mind = list(
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ emp_act
return TRUE

/mob/living/carbon/human/projectile_hit_check(obj/item/projectile/P)
return (HAS_TRAIT(src, TRAIT_FLOORED) || HAS_TRAIT(src, TRAIT_NOKNOCKDOWNSLOWDOWN)) && !density // hit mobs that are intentionally lying down to prevent combat crawling.
return (HAS_TRAIT(src, TRAIT_FLOORED) || HAS_TRAIT(src, TRAIT_NOKNOCKDOWNSLOWDOWN)) && !density && !(P.always_hit_living_nondense && (stat != DEAD)) // hit mobs that are intentionally lying down to prevent combat crawling.

/mob/living/carbon/human/canBeHandcuffed()
return has_left_hand() || has_right_hand()
2 changes: 1 addition & 1 deletion code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
return (!mover.density || !density || horizontal)

/mob/proc/projectile_hit_check(obj/item/projectile/P)
return !density
return !(P.always_hit_living_nondense && (stat != DEAD)) && !density

/client/verb/toggle_throw_mode()
set hidden = 1
Expand Down
3 changes: 1 addition & 2 deletions code/modules/projectiles/ammunition/energy_lens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@

/obj/item/ammo_casing/energy/arc_revolver
fire_sound = 'sound/magic/lightningbolt.ogg' //New sound
e_cost = 125 //8 shots?
select_name = "lightning beam" //I guess
muzzle_flash_color = LIGHT_COLOR_FADEDPURPLE // Depends on sprite
projectile_type = /obj/item/projectile/energy/arc_revolver
Expand All @@ -280,7 +279,7 @@
select_name = null //If the select name is null, it does not send a message of switching modes to the user, important on the pistol.

/obj/item/ammo_casing/energy/charged_plasma
projectile_type = /obj/item/projectile/energy/charged_plasma
projectile_type = /obj/item/projectile/homing/charged_plasma
e_cost = 0 //Charge is used when you charge the gun. Prevents issues.
muzzle_flash_color = LIGHT_COLOR_FADEDPURPLE
fire_sound = 'sound/weapons/marauder.ogg' //Should be different enough to get attention
Expand Down
8 changes: 5 additions & 3 deletions code/modules/projectiles/guns/energy/laser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@

/obj/item/gun/energy/lwap/Initialize(mapload)
. = ..()
AddComponent(/datum/component/scope, range_modifier = 2, time_to_scope = 3 SECONDS, flags = SCOPE_MOVEMENT_CANCELS | SCOPE_TURF_ONLY | SCOPE_NEED_ACTIVE_HAND)
AddComponent(/datum/component/scope, range_modifier = 2, time_to_scope = 2 SECONDS, flags = SCOPE_MOVEMENT_CANCELS | SCOPE_TURF_ONLY | SCOPE_NEED_ACTIVE_HAND)

/obj/item/gun/energy/lwap/on_scope_success(mob/living/user)
to_chat(user, "<b><span class='robot'>SCOPE_CREEPER_[rand(1, 9999)] Online.</span></b>")
Expand All @@ -258,7 +258,7 @@
muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
select_name = null
fire_sound = 'sound/weapons/marauder.ogg'
delay = 5 SECONDS
delay = 2 SECONDS

/obj/item/ammo_casing/energy/laser/sniper/pierce
projectile_type = /obj/item/projectile/beam/laser/sniper/pierce
Expand Down Expand Up @@ -287,16 +287,18 @@
/obj/item/projectile/beam/laser/sniper/pierce
forcedodge = 1 // Can pierce one non wall thing.
speed = 0.5
always_hit_living_nondense = TRUE //This means if you are scoped in sniping at crit xenomorphs or crit humans, you can always hit them even if you do not directly click on them
/// Have we hit an r_wall? If we have, don't pierce it again so we don't become too effective on reinforced locations (AI sat)
var/hit_a_r_wall = FALSE
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE | PASSGIRDER

/obj/item/projectile/beam/laser/sniper/pierce/prehit(atom/target)
if(istype(target, /turf/simulated/wall/r_wall))
if(!hit_a_r_wall)
hit_a_r_wall = TRUE
if(!forcedodge)
forcedodge++
else if((isturf(target) || istype(target, /obj/structure/alien/resin)) && !forcedodge)
else if((isturf(target) || istype(target, /obj/structure/alien/resin) || istype(target, /obj/structure/spider)) && !forcedodge)
forcedodge++
..()

Expand Down
8 changes: 8 additions & 0 deletions code/modules/projectiles/guns/energy/special_eguns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,14 @@
else
return ..()

/obj/item/gun/energy/bsg/equipped(mob/user, slot, initial)
. = ..()
ADD_TRAIT(user, TRAIT_BSG_IMMUNE, "[UID(src)]")

/obj/item/gun/energy/bsg/dropped(mob/user, silent)
. = ..()
REMOVE_TRAIT(user, TRAIT_BSG_IMMUNE, "[UID(src)]")

/obj/item/gun/energy/bsg/process_fire(atom/target, mob/living/user, message = TRUE, params, zone_override, bonus_spread = 0)
if(!has_bluespace_crystal)
to_chat(user, "<span class='warning'>[src] has no bluespace crystal to power it!</span>")
Expand Down
50 changes: 35 additions & 15 deletions code/modules/projectiles/projectile/energy_projectiles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@
name = "orb of pure bluespace energy"
icon_state = "bluespace"
impact_effect_type = /obj/effect/temp_visual/bsg_kaboom
damage = 60
damage = 90
damage_type = BURN
armour_penetration_flat = 50
range = 9
knockdown = 4 SECONDS //This is going to knock you off your feet
eyeblur = 10 SECONDS
Expand All @@ -79,30 +80,30 @@

/obj/item/projectile/energy/bsg/on_hit(atom/target)
. = ..()
kaboom()
kaboom(target)
qdel(src)

/obj/item/projectile/energy/bsg/on_range()
kaboom()
new /obj/effect/temp_visual/bsg_kaboom(loc)
..()

/obj/item/projectile/energy/bsg/proc/kaboom()
/obj/item/projectile/energy/bsg/proc/kaboom(atom/target)
playsound(src, 'sound/weapons/bsg_explode.ogg', 75, TRUE)
for(var/mob/living/M in hearers(7, src)) //No stuning people with thermals through a wall.
if(M == target)
continue
var/floored = FALSE
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/gun/energy/bsg/N = locate() in H
if(N)
to_chat(H, "<span class='notice'>[N] deploys an energy shield to project you from [src]'s explosion.</span>")
continue
if(HAS_TRAIT(M, TRAIT_BSG_IMMUNE))
to_chat(M, "<span class='notice'>Your B.S.G deploys an energy shield to project you from [src]'s explosion.</span>")
new /obj/effect/temp_visual/at_shield(get_turf(M), M)
continue
var/distance = (1 + get_dist(M, src))
if(prob(min(400 / distance, 100))) //100% chance to hit with the blast up to 3 tiles, after that chance to hit is 80% at 4 tiles, 66.6% at 5, 57% at 6, and 50% at 7
if(prob(min(150 / distance, 100)))//100% chance to upgraded to a stun as well at a direct hit, 75% at 1 tile, 50% at 2, 37.5% at 3, 30% at 4, 25% at 5, 21% at 6, and finaly 19% at 7. This is calculated after the first hit however.
if(prob(min(200 / distance, 100)))//100% chance to upgraded to a stun as well at a direct hit, 100% at 1 tile, 66% at 2, 50% at 3, 40% at 4, 33% at 5, 28.5% at 6, and finaly 25% at 7. This is calculated after the first hit however.
floored = TRUE
M.apply_damage((rand(15, 30) * (1.1 - distance / 10)), BURN) //reduced by 10% per tile
add_attack_logs(src, M, "Hit heavily by [src]")
M.apply_damage((rand(60, 80) * (1.1 - distance / 10)), BURN) //reduced by 10% per tile
add_attack_logs(firer, M, "Hit heavily by [src]")
if(floored)
to_chat(M, "<span class='userdanger'>You see a flash of briliant blue light as [src] explodes, knocking you to the ground and burning you!</span>")
M.KnockDown(4 SECONDS)
Expand All @@ -113,23 +114,42 @@
M.IgniteMob()
else
to_chat(M, "<span class='userdanger'>You feel the heat of the explosion of [src], but the blast mostly misses you.</span>")
add_attack_logs(src, M, "Hit lightly by [src]")
M.apply_damage(rand(1, 5), BURN)
add_attack_logs(firer, M, "Hit lightly by [src]")
M.apply_damage(rand(20, 25), BURN)
if(ROLE_BLOB in M.faction)
M.apply_damage(rand(20, 25), BURN) //Ensures it clears all blob spores on the screen without fail.

/obj/item/projectile/energy/weak_plasma
name = "plasma bolt"
icon_state = "plasma_light"
damage = 12.5
damage_type = BURN

/obj/item/projectile/energy/charged_plasma
/obj/item/projectile/homing/charged_plasma
name = "charged plasma bolt"
icon_state = "plasma_heavy"
damage = 45
damage_type = BURN
flag = "energy"
armour_penetration_flat = 10 // It can have a little armor pen, as a treat. Bigger than it looks, energy armor is often low.
shield_buster = TRUE
reflectability = REFLECTABILITY_PHYSICAL //I will let eswords block it like a normal projectile, but it's not getting reflected, and eshields will take the hit hard. Carp still can reflect though, screw you.
var/reached_target = FALSE

/obj/item/projectile/homing/charged_plasma/pixel_move(trajectory_multiplier)
homing_active = FALSE
if(isturf(original))
return ..() //It gets weird if it is a turf. Turfs don't move anyway.
if(reached_target || get_turf(original) == get_turf(src))
reached_target = TRUE
return ..()
var/fake_Angle = Angle
if(fake_Angle < 0)
fake_Angle += 360
if(abs(get_angle(get_turf(src), original) - fake_Angle) > 45)
return ..()
homing_active = TRUE
..()

/obj/item/projectile/energy/arc_revolver
name = "arc emitter"
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/projectile_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
///Has the projectile been fired?
var/has_been_fired = FALSE

/// Does this projectile hit living non dense mobs?
var/always_hit_living_nondense = FALSE

//Hitscan
var/hitscan = FALSE //Whether this is hitscan. If it is, speed is basically ignored.
var/list/beam_segments //assoc list of datum/point_precise or datum/point_precise/vector, start = end. Used for hitscan effect generation.
Expand Down

0 comments on commit 9f01db0

Please sign in to comment.