Skip to content

Commit

Permalink
Attempts to fix CWC apprentices (#36698)
Browse files Browse the repository at this point in the history
* Update dynamic_rulesets_roundstart.dm

* Update apprentice_contract.dm

* Now removes contract faction roles before doing it

* Update apprentice_contract.dm
  • Loading branch information
boy2mantwicethefam authored Jun 25, 2024
1 parent a80c1b4 commit 61a9ca5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@

/datum/dynamic_ruleset/roundstart/cwc/execute()
var/datum/faction/wizard/civilwar/wpf/WPF = ticker.mode.CreateFaction(/datum/faction/wizard/civilwar/wpf, null, 1)
var/datum/faction/wizard/civilwar/wpf/PFW = ticker.mode.CreateFaction(/datum/faction/wizard/civilwar/pfw, null, 1)
var/datum/faction/wizard/civilwar/pfw/PFW = ticker.mode.CreateFaction(/datum/faction/wizard/civilwar/pfw, null, 1)
for(var/mob/new_player/M in assigned)
var/datum/role/wizard/newWizard = new
if (WPF.members.len < PFW.members.len)
Expand Down
7 changes: 7 additions & 0 deletions code/game/gamemodes/wizard/apprentice_contract.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ var/list/wizard_apprentice_setups_by_name = list()
contract_faction.forgeObjectives()

var/datum/role/wizard_apprentice/apprentice_role = contract_faction.HandleRecruitedMind(apprentice.mind, override = TRUE)
if(owner.GetRole(WIZARD))
var/datum/faction/wizard/civilwar/CW = find_active_faction_by_typeandmember(/datum/faction/wizard/civilwar, WIZARD, owner)
if(CW) //Apprentice is being drafted into the civil war
contract_faction.HandleRemovedRole(apprentice_role) //Remove the apprentice from the contract faction
contract_faction.HandleRemovedRole(owner) //The master is no longer a contract master, everyone is in this together
CW.HandleRecruitedRole(apprentice_role) //Bring the apprentice into the owner's civil war faction
CW.HandleRecruitedRole(owner) //HandleRemovedRole removes a role's faction and orphans the role, this should help
apprentice_role.Greet(GREET_DEFAULT)
apprentice_role.AnnounceObjectives()
if(forced_apprentice_name)
Expand Down

0 comments on commit 61a9ca5

Please sign in to comment.