Skip to content

Commit

Permalink
Ghost HUD Respawn Button (#4037)
Browse files Browse the repository at this point in the history
<!-- 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. -->

## About The Pull Request
Replaces the Jump To Mob HUD button with a respawn button.


![image](https://github.com/user-attachments/assets/d5adc2be-893f-4a06-97e3-4a513c597a7e)
Thanks @meikiato from the discord for the above text. I am not wordy.

![image](https://github.com/user-attachments/assets/23c53a46-4f17-40ad-b383-377ad41c8319)
The respawn button confirms your choice if you have a body to return to,
otherwise this confirmation will not appear.

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Respawning is an important part of shiptest, whether you're checking
ships before the round or respawning after an unfortunate death. This
makes it a more accessible and obvious option for new players, and
requires less mucking about in the verb menu.
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: Replaced Jump To Mob on ghost HUD with a respawn option.
/: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
Thera-Pissed authored Jan 19, 2025
1 parent cb019db commit 28c4dd5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
#define ui_pai_view_images "SOUTH:6,WEST+13"

//Ghosts
#define ui_ghost_jumptomob "SOUTH:6,CENTER-3:24"
#define ui_ghost_respawn "SOUTH:6,CENTER-3:24"
#define ui_ghost_orbit "SOUTH:6,CENTER-2:24"
#define ui_ghost_reenter_corpse "SOUTH:6,CENTER-1:24"
#define ui_ghost_teleport "SOUTH:6,CENTER:24"
Expand Down
14 changes: 12 additions & 2 deletions code/_onclick/hud/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@
. = ..()
flick(icon_state + "_anim", src)

/*
/atom/movable/screen/ghost/jumptomob
name = "Jump to mob"
icon_state = "jumptomob"
/atom/movable/screen/ghost/jumptomob/Click()
var/mob/dead/observer/G = usr
G.jumptomob()
*/

/atom/movable/screen/ghost/respawn
name = "Respawn"
icon_state = "respawn"

/atom/movable/screen/ghost/respawn/Click()
var/mob/dead/observer/G = usr
G.respawn()

/atom/movable/screen/ghost/orbit
name = "Orbit"
Expand Down Expand Up @@ -58,8 +68,8 @@
..()
var/atom/movable/screen/using

using = new /atom/movable/screen/ghost/jumptomob()
using.screen_loc = ui_ghost_jumptomob
using = new /atom/movable/screen/ghost/respawn()
using.screen_loc = ui_ghost_respawn
using.hud = src
static_inventory += using

Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
else
to_chat(A, "<span class='danger'>This mob is not located in the game world.</span>")

/mob/dead/observer/verb/respawn()
if(can_reenter_corpse && client?.holder)
var/poll_client = tgui_alert(usr, "Returning to the title screen will forfeit any possible revival. Are you sure?", "Confirmation", list("Yes", "No"))
if(poll_client == "No")
return
abandon_mob()

/mob/dead/observer/verb/change_view_range()
set category = "Ghost"
set name = "View Range"
Expand Down
Binary file modified icons/hud/screen_ghost.dmi
Binary file not shown.

0 comments on commit 28c4dd5

Please sign in to comment.