Skip to content

Commit

Permalink
cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
Trilbyspaceclone committed Mar 25, 2023
1 parent 8dbbf5e commit 6c61a29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
3 changes: 3 additions & 0 deletions code/controllers/subsystems/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/start_restart_vote_loop()
addtimer(CALLBACK(src, /datum/controller/subsystem/vote/proc/recall_vote), 240 MINUTES)

/datum/controller/subsystem/vote/proc/recall_vote_loop()
addtimer(CALLBACK(src, /datum/controller/subsystem/vote/proc/recall_vote), 60 MINUTES)

/datum/controller/subsystem/vote/proc/recall_vote()
if(SSvote.active_vote) //No sneaky attempt to stop the recall vote
stop_vote()
Expand Down
27 changes: 8 additions & 19 deletions code/controllers/subsystems/voting/poll_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
///////////////////VOTES//////////////////////
//////////////////////////////////////////////

/*To prevent abuse and rule-by-salt, the evac vote weights each player's vote based on a few parameters
If you are alive and have been for a while, then you have the normal 1 vote
If you are dead, or just spawned, you get only 0.6 votes
If you are an antag or a head of staff, you get 1.2 votes
*/

#define VOTE_WEIGHT_LOW 0.6
#define VOTE_WEIGHT_NORMAL 1
#define VOTE_WEIGHT_HIGH 1.2 //To tie 2 dead votes but not over-rule 2 living
Expand Down Expand Up @@ -40,19 +46,12 @@
non_admin = FALSE
name = "Supper Majority: End Round"
question = "End Shift?"
choice_types = list(/datum/vote_choice/restart, /datum/vote_choice/countinue_round/admin)
choice_types = list(/datum/vote_choice/restart, /datum/vote_choice/countinue_round)
minimum_win_percentage = 0.75
next_vote = 255 MINUTES //Minimum round length before it can be called for the first time
cooldown = 30 MINUTES //Cooldown is set to 30 mins as 1 hour is a bit much when things change so much in so little time + maxium 8 hour rounds means we should be a bit more forgiven.
only_admin = FALSE


/*To prevent abuse and rule-by-salt, the evac vote weights each player's vote based on a few parameters
If you are alive and have been for a while, then you have the normal 1 vote
If you are dead, or just spawned, you get only 0.6 votes
If you are an antag or a head of staff, you get 1.2 votes
*/

/datum/poll/restart/get_vote_power(var/client/C)
if (!istype(C))
return 0 //Shouldnt be possible, but safety
Expand Down Expand Up @@ -93,15 +92,9 @@
/datum/poll/restart/on_end()
if(non_admin)
lower_minium()

addtimer(CALLBACK(src, /datum/poll/restart/proc/recall_vote), 60 MINUTES)
SSvote.recall_vote_loop()
..()

/datum/poll/restart/proc/recall_vote()
SSvote.start_vote(/datum/poll/restart)



#undef VOTE_WEIGHT_LOW
#undef VOTE_WEIGHT_NORMAL
#undef VOTE_WEIGHT_HIGH
Expand All @@ -123,10 +116,6 @@
/datum/vote_choice/countinue_round
text = "Continue Shift"

/datum/vote_choice/countinue_round/admin
text = "Continue Shift"


/*********************
Storyteller
**********************/
Expand Down

0 comments on commit 6c61a29

Please sign in to comment.