forked from Bubberstation/Bubberstation
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
You now need to spend 30 minutes in a round to be able to vote on tra…
…nsfer (Bubberstation#1579) ## About The Pull Request You need to spend 30 minutes in game, living, and not afk, to be able to vote on a transfer. Pros: - Ghostroles get to vote again after spending enough time in a round - Leaving midround, or getting RRd still allows you to have a vote Cons: - You have to actually play the game for 30 minutes (Impossible) ## Why It's Good For The Game It gives our beloved ghost roles their vote back, and also still keeps ghosts from having a say in the game after not playing for the whole round. ## Proof Of Testing I bashed two clients together on a test server. It is working ## Changelog :cl: qol: Makes the vote requirements code not terrible by allowing anyone with some effect on the round to use it /:cl: --------- Co-authored-by: projectkepler-RU <[email protected]>
- Loading branch information
1 parent
8aa2bac
commit f6004e0
Showing
6 changed files
with
18 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
|
||
/datum/vote | ||
// Specifies if ghosts without linked bodies or ghostroles are allowed to vote | ||
// Specifies if people who haven't spent INGAME_TIME_NEEDED minutes in the round are allowed to vote | ||
var/allow_ghosts = TRUE | ||
|
||
#define INGAME_TIME_NEEDED 30 | ||
|
||
// Checks if a mob can partake in voting. Feel free to add overrides when adding your own votes! | ||
// This is called directly from /datum/controller/subsystem/vote so some nullchecks are excluded as they are included before this is called | ||
/datum/vote/proc/can_mob_vote(mob/voter) | ||
if(SSticker.HasRoundStarted() && !allow_ghosts) | ||
// Handle the lobby people first | ||
if(istype(voter, /mob/dead/new_player)) | ||
return FALSE | ||
// Check if there is a mind. This should only be a case on ghosts, but also doubles down as a nullcheck for the next check | ||
// We also check the is_offstation_ghost because it stays with your mind even after dying. No cheating this! | ||
else if(!voter.mind || QDELETED(voter.mind.current) || voter.mind.is_offstation_ghost) | ||
return FALSE | ||
// Check if the person is living. If they are, check if they're on the centcom level | ||
else if(istype(voter, /mob/living) && (is_centcom_level(voter.z))) | ||
if(GLOB.client_minutes_in_round[voter.client.ckey] >= INGAME_TIME_NEEDED) | ||
return TRUE | ||
else | ||
return FALSE | ||
|
||
return TRUE | ||
|
||
#undef INGAME_TIME_NEEDED | ||
|
||
/datum/vote/transfer_vote | ||
allow_ghosts = FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
GLOBAL_LIST_EMPTY(client_minutes_in_round) | ||
|
||
/client/proc/update_living_minutes(mins) | ||
if(!isliving(mob)) | ||
return | ||
GLOB.client_minutes_in_round[ckey] += mins |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters