Skip to content

Commit

Permalink
Adds Balloon Alerts to Smartgunners (#5866)
Browse files Browse the repository at this point in the history
# About the pull request
Adds balloon alert texts to:
* swapping round type
* attempting to fire with insufficient skills
* attempting to fire with no harness
* attempting to fire with cover opened
* attempting to fire with no power

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
I wanted to have more balloon alerts.
QoL for SGs to know why they can't fire without reading chat.
# Testing Photographs and Procedure
<details>
<summary>Pictures here</summary>
ignore the dot, fixed.


![image](https://github.com/cmss13-devs/cmss13/assets/54422837/8151cada-b3e3-4c64-ad76-1259408e7b8b)

![image](https://github.com/cmss13-devs/cmss13/assets/54422837/166af4b5-6e50-4f68-a8a9-724c5f6dc6ad)


![image](https://github.com/cmss13-devs/cmss13/assets/54422837/190aadab-81ce-468c-82ca-5c06095186e3)

![image](https://github.com/cmss13-devs/cmss13/assets/54422837/a9d8e70a-7f64-4a8f-bfe9-6bdd3874fb90)

![image](https://github.com/cmss13-devs/cmss13/assets/54422837/d0b75fe4-7ea7-44f4-90c2-431fbccec4ef)


</details>


# Changelog
:cl:
qol: Added balloon alerts to smartgunners
/:cl:
  • Loading branch information
private-tristan authored Mar 3, 2024
1 parent b074cae commit fb31411
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/modules/projectiles/guns/smartgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,15 @@
return FALSE
var/mob/living/carbon/human/H = user
if(!skillcheckexplicit(user, SKILL_SPEC_WEAPONS, SKILL_SPEC_SMARTGUN) && !skillcheckexplicit(user, SKILL_SPEC_WEAPONS, SKILL_SPEC_ALL))
to_chat(H, SPAN_WARNING("You don't seem to know how to use \the [src]..."))
balloon_alert(user, "insufficient skills")
return FALSE
if(requires_harness)
if(!H.wear_suit || !(H.wear_suit.flags_inventory & SMARTGUN_HARNESS))
to_chat(H, SPAN_WARNING("You need a harness suit to be able to fire [src]..."))
balloon_alert(user, "harness required")
return FALSE
if(cover_open)
to_chat(H, SPAN_WARNING("You can't fire \the [src] with the feed cover open! (alt-click to close)"))
balloon_alert(user, "cannot fire; feed cover open")
return FALSE

/obj/item/weapon/gun/smartgun/unique_action(mob/user)
Expand All @@ -337,6 +338,7 @@
return
secondary_toggled = !secondary_toggled
to_chat(user, "[icon2html(src, usr)] You changed \the [src]'s ammo preparation procedures. You now fire [secondary_toggled ? "armor shredding rounds" : "highly precise rounds"].")
balloon_alert(user, "firing [secondary_toggled ? "armor shredding" : "highly precise"]")
playsound(loc,'sound/machines/click.ogg', 25, 1)
ammo = secondary_toggled ? ammo_secondary : ammo_primary
var/datum/action/item_action/smartgun/toggle_ammo_type/TAT = locate(/datum/action/item_action/smartgun/toggle_ammo_type) in actions
Expand Down Expand Up @@ -387,7 +389,7 @@
return FALSE
return TRUE
if(!battery || battery.power_cell.charge == 0)
to_chat(usr, SPAN_WARNING("[src] emits a low power warning and immediately shuts down!"))
balloon_alert(usr, "low power")
return FALSE
return FALSE

Expand Down

0 comments on commit fb31411

Please sign in to comment.