Skip to content

Commit

Permalink
Merge pull request #43 from russ-money/roguemode
Browse files Browse the repository at this point in the history
roguemode fixes??
  • Loading branch information
russ-money authored Aug 30, 2024
2 parents 904f21e + d0a95e9 commit b32b68e
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 29 deletions.
6 changes: 6 additions & 0 deletions code/__DEFINES/roguetown/rebel.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// Time the rebels get after victory to rule before it round ends
#define REBEL_RULE_TIME 15 MINUTES
/// Time the rebel leader needs to sit on the throne to be capable
#define REBEL_THRONE_TIME 5 MINUTES
/// Every other rebel nearby the ruler on the throne makes it this much faster to announce victory, in percents
#define REBEL_THRONE_SPEEDUP_PER_PERSON 0.3
59 changes: 31 additions & 28 deletions code/game/gamemodes/roguetown/roguetown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var/global/list/roguegamemodes = list("Rebellion", "Vampires and Werewolves", "E
var/skeletons = FALSE

var/headrebdecree = FALSE
var/reb_end_time = 0

var/check_for_lord = TRUE
var/next_check_lord = 0
Expand Down Expand Up @@ -75,7 +76,16 @@ var/global/list/roguegamemodes = list("Rebellion", "Vampires and Werewolves", "E
SSvote.initiate_vote("endround", pick("Zlod", "Sun King", "Gaia", "Moon Queen", "Aeon", "Gemini", "Aries"))

if(headrebdecree)
return TRUE
if(reb_end_time == 0)
to_chat(world, span_boldannounce("The peasant rebels took control of the throne, hail the new community!"))
if(ttime >= INITIAL_ROUND_TIMER)
reb_end_time = ttime + REBEL_RULE_TIME
to_chat(world, span_boldwarning("The round will end in 15 minutes."))
else
reb_end_time = INITIAL_ROUND_TIMER
to_chat(world, span_boldwarning("The round will end at the 2:30 hour mark."))
if(ttime >= reb_end_time)
return TRUE

check_for_lord()
/*
Expand Down Expand Up @@ -124,11 +134,7 @@ var/global/list/roguegamemodes = list("Rebellion", "Vampires and Werewolves", "E
return TRUE
if(SSticker.manualmodes)
forcedmodes |= SSticker.manualmodes
var/list/major_modes = list(1, 2, 3)
var/list/minor_modes = list(1,2,3)
if(prob(25))
minor_modes += 4 //maniac
var/majorpicked = pick(major_modes)

if(forcedmodes.len)
message_admins("Manual gamemodes selected.")
for(var/G in forcedmodes)
Expand All @@ -152,34 +158,31 @@ var/global/list/roguegamemodes = list("Rebellion", "Vampires and Werewolves", "E
if("Extended")
log_game("Major Antagonist: Extended")
return TRUE
switch(majorpicked)
if(1)

var/major_roll = rand(1,100)
switch(major_roll)
if(1 to 35)
pick_rebels()
log_game("Major Antagonist: Rebellion")
if(2)
log_game("Major Antagonist: Extended") //gotta put something here.
if(3) //WWs and Vamps now normally roll together
if(36 to 80)
//WWs and Vamps now normally roll together
pick_vampires()
pick_werewolves()
log_game("Major Antagonist: Vampires and Werewolves")
minor_modes = shuffle(minor_modes)
for(var/m in minor_modes)
switch(m)
if(1)
pick_bandits()
log_game("Minor Antagonist: Bandit")
if(2)
pick_aspirants()
log_game("Minor Antagonist: Aspirant")
if(3)
log_game("Minor Antagonist: Extended") // placeholder.
if(4)
pick_maniac()
log_game("Minor Antagonist: Maniac")
if(prob(30))
continue
return TRUE
if(81 to 100)
log_game("Major Antagonist: Extended") //gotta put something here.

if(prob(80))
pick_bandits()
log_game("Minor Antagonist: Bandit")
if(prob(45))
pick_aspirants()
log_game("Minor Antagonist: Aspirant")
// if(prob(10))
// pick_maniac()
// log_game("Minor Antagonist: Maniac")

return TRUE
/datum/game_mode/chaosmode/proc/pick_bandits()
//BANDITS
banditgoal = rand(200,400)
Expand Down
36 changes: 36 additions & 0 deletions code/modules/roguetown/roguemachine/throne.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GLOBAL_VAR(king_throne)

/obj/structure/roguethrone
name = "throne of rockhill"
desc = "A big throne, to hold the Lord's giant personality. Say 'help' with the crown on your head if you are confused."
Expand All @@ -9,6 +11,8 @@
max_integrity = 999999
buckle_lying = FALSE
obj_flags = NONE
var/rebel_leader_sit_time = 0
var/notified_rebel_able = FALSE

/obj/structure/roguethrone/post_buckle_mob(mob/living/M)
..()
Expand All @@ -31,6 +35,38 @@
GLOB.lordcolor -= src
return ..()

/obj/structure/roguethrone/process()
var/dt = 1 SECONDS
process_rebel_leader_sit(dt)
. = ..()

/obj/structure/roguethrone/proc/process_rebel_leader_sit(dt)
if(!length(buckled_mobs))
return
var/mob/living/user = buckled_mobs[1]
if(user.stat != CONSCIOUS)
return
var/datum/antagonist/prebel/P = user.mind?.has_antag_datum(/datum/antagonist/prebel)
if(!P)
return
if(rebel_leader_sit_time == 0)
to_chat(user, span_notice("Finally, I'm sitting on the throne - when I get more comfortable here I'll be able to announce victory. Other rebels here will help me get comfortable faster."))
var/time_modifier = 1.0
/// Increase modifier for every other conscious rebel in view
for(var/mob/living/living_mob in view(7, loc))
if(living_mob == user)
continue
if(living_mob.stat != CONSCIOUS)
continue
var/datum/antagonist/prebel/rebel_antag = living_mob.mind?.has_antag_datum(/datum/antagonist/prebel)
if(!rebel_antag)
continue
time_modifier += REBEL_THRONE_SPEEDUP_PER_PERSON
rebel_leader_sit_time += (dt * time_modifier)
if(rebel_leader_sit_time >= REBEL_THRONE_TIME && !notified_rebel_able)
notified_rebel_able = TRUE
to_chat(user, span_notice("That's it - time to announce our victory!"))

/obj/structure/roguethrone/lordcolor(primary,secondary)
if(!primary || !secondary)
return
Expand Down
2 changes: 1 addition & 1 deletion config/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ NO_INTERCEPT_REPORT
## Default probablity is 1, increase to make that mode more likely to be picked.
## Set to 0 to disable that mode.

PROBABILITY ROGUEMODE 99
PROBABILITY CHAOSMODE 99
PROBABILITY TRAITOR 0
PROBABILITY TRAITORBRO 0
PROBABILITY TRAITORCHAN 0
Expand Down
1 change: 1 addition & 0 deletions roguetown.dme
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
#include "code\__DEFINES\dcs\helpers.dm"
#include "code\__DEFINES\dcs\signals.dm"
#include "code\__DEFINES\dcs\signals_atom_lighting.dm"
#include "code\__DEFINES\roguetown\rebel.dm"
#include "code\__DEFINES\roguetown\werewolf.dm"
#include "code\__HELPERS\_lists.dm"
#include "code\__HELPERS\_logging.dm"
Expand Down

0 comments on commit b32b68e

Please sign in to comment.