Skip to content

Commit

Permalink
Brings back old gun suicide_act behavior (#2784)
Browse files Browse the repository at this point in the history
## About The Pull Request
Brings back old suicide_act on handle_suicide proc of guns.

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->


https://github.com/shiptest-ss13/Shiptest/assets/81882910/a5363807-0b49-46fc-aae6-cc1253cc1dbf

## Changelog

:cl:
add: Suicide & Execution with a damaging firearm is now more deadly and
gruesome.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
thgvr authored Apr 11, 2024
1 parent 1f8da5f commit 1e1e543
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
51 changes: 40 additions & 11 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -744,39 +744,68 @@
safety_overlay.icon_state = "[safety_wording]-off"
. += safety_overlay

#define BRAINS_BLOWN_THROW_RANGE 2
#define BRAINS_BLOWN_THROW_SPEED 1

/obj/item/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params, bypass_timer)
if(!ishuman(user) || !ishuman(target))
return

if(semicd)
return

if(!can_shoot()) //Just because you can pull the trigger doesn't mean it can shoot.
shoot_with_empty_chamber(user)
return

if(user == target)
target.visible_message("<span class='warning'>[user] sticks [src] in [user.p_their()] mouth, ready to pull the trigger...</span>", \
"<span class='userdanger'>You stick [src] in your mouth, ready to pull the trigger...</span>")
target.visible_message(span_warning("[user] sticks [src] in [user.p_their()] mouth, ready to pull the trigger..."), \
span_userdanger("You stick [src] in your mouth, ready to pull the trigger..."))
else
target.visible_message("<span class='warning'>[user] points [src] at [target]'s head, ready to pull the trigger...</span>", \
"<span class='userdanger'>[user] points [src] at your head, ready to pull the trigger...</span>")
target.visible_message(span_warning("[user] points [src] at [target]'s head, ready to pull the trigger..."), \
span_userdanger("[user] points [src] at your head, ready to pull the trigger..."))

semicd = TRUE

if(!bypass_timer && (!do_mob(user, target, 120) || user.zone_selected != BODY_ZONE_PRECISE_MOUTH))
if(!bypass_timer && (!do_mob(user, target, 100) || user.zone_selected != BODY_ZONE_PRECISE_MOUTH))
if(user)
if(user == target)
user.visible_message("<span class='notice'>[user] decided not to shoot.</span>")
user.visible_message(span_notice("[user] decided not to shoot."))
else if(target && target.Adjacent(user))
target.visible_message("<span class='notice'>[user] has decided to spare [target]</span>", "<span class='notice'>[user] has decided to spare your life!</span>")
target.visible_message(span_notice("[user] has decided to spare [target]."), span_notice("[user] has decided to spare your life!"))
semicd = FALSE
return

semicd = FALSE

target.visible_message("<span class='warning'>[user] pulls the trigger!</span>", "<span class='userdanger'>[(user == target) ? "You pull" : "[user] pulls"] the trigger!</span>")
target.visible_message(span_warning("[user] pulls the trigger!"), span_userdanger("[(user == target) ? "You pull" : "[user] pulls"] the trigger!"))

if(chambered && chambered.BB)
chambered.BB.damage *= 5
if(chambered && chambered.BB && can_trigger_gun(user))
chambered.BB.damage *= 3
//Check is here for safeties and such, brain will be removed after
process_fire(target, user, TRUE, params, BODY_ZONE_HEAD)

var/obj/item/organ/brain/brain_to_blast = target.getorganslot(ORGAN_SLOT_BRAIN)
if(brain_to_blast)

//Check if the projectile is actually damaging and not of type STAMINA
if(chambered.BB.nodamage || !chambered.BB.damage || chambered.BB.damage_type == STAMINA)
return

//Remove brain of the mob shot
brain_to_blast.Remove(target)

var/turf/splat_turf = get_turf(target)
//Move the brain of the person shot to selected turf
brain_to_blast.forceMove(splat_turf)

var/turf/splat_target = get_ranged_target_turf(target, REVERSE_DIR(target.dir), BRAINS_BLOWN_THROW_RANGE)
var/datum/callback/gibspawner = CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(spawn_atom_to_turf), /obj/effect/gibspawner/generic, brain_to_blast, 1, FALSE, target)
//Throw the brain that has been removed away and place a gibspawner on landing
brain_to_blast.throw_at(splat_target, BRAINS_BLOWN_THROW_RANGE, BRAINS_BLOWN_THROW_SPEED, callback = gibspawner)

process_fire(target, user, TRUE, params, BODY_ZONE_HEAD)
#undef BRAINS_BLOWN_THROW_RANGE
#undef BRAINS_BLOWN_THROW_SPEED

/obj/item/gun/proc/unlock() //used in summon guns and as a convience for admins
if(pin)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
var/homing_offset_y = 0

var/damage = 10
var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE are the only things that should be in here
var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE, STAMINA are the only things that should be in here
var/nodamage = FALSE //Determines if the projectile will skip any damage inflictions
var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb
///How much armor this projectile pierces.
Expand Down

0 comments on commit 1e1e543

Please sign in to comment.