From 0ad6e367274fff286682ab7c7244fd2a3e635a07 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 21 Oct 2017 03:44:21 -0500 Subject: [PATCH] [MIRROR] Apprentice fixes (#3533) * Apprentice fixes (#31880) * Fixes apprentices summoning for non-wizards * Fixes admin antaghud not showing for solo wizards * Apprentice fixes --- code/datums/antagonists/wizard.dm | 5 ++--- code/game/gamemodes/antag_spawner.dm | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/code/datums/antagonists/wizard.dm b/code/datums/antagonists/wizard.dm index 253322b43d..740e7e156e 100644 --- a/code/datums/antagonists/wizard.dm +++ b/code/datums/antagonists/wizard.dm @@ -157,8 +157,7 @@ /datum/antagonist/wizard/apply_innate_effects(mob/living/mob_override) var/mob/living/M = mob_override || owner.current - if(wiz_team) //Don't bother with the icon if you're solo wizard - update_wiz_icons_added(M) + update_wiz_icons_added(M, wiz_team ? TRUE : FALSE) //Don't bother showing the icon if you're solo wizard M.faction |= "wizard" /datum/antagonist/wizard/remove_innate_effects(mob/living/mob_override) @@ -250,7 +249,7 @@ owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/turf_teleport/blink(null)) owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(null)) -/datum/antagonist/wizard/proc/update_wiz_icons_added(mob/living/wiz) +/datum/antagonist/wizard/proc/update_wiz_icons_added(mob/living/wiz,join = TRUE) var/datum/atom_hud/antag/wizhud = GLOB.huds[ANTAG_HUD_WIZ] wizhud.join_hud(wiz) set_antag_hud(wiz, hud_version) diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index ad989eb2fb..8a0a622a63 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -67,20 +67,25 @@ else to_chat(H, "Unable to reach your apprentice! You can either attack the spellbook with the contract to refund your points, or wait and try again later.") -/obj/item/antag_spawner/contract/spawn_antag(client/C, turf/T, school,datum/mind/wizard) +/obj/item/antag_spawner/contract/spawn_antag(client/C, turf/T, school,datum/mind/user) new /obj/effect/particle_effect/smoke(T) var/mob/living/carbon/human/M = new/mob/living/carbon/human(T) C.prefs.copy_to(M) M.key = C.key var/datum/mind/app_mind = M.mind - var/datum/antagonist/wizard/master_antag = wizard.has_antag_datum(/datum/antagonist/wizard) - if(!master_antag.wiz_team) - master_antag.create_wiz_team() + + + var/datum/antagonist/wizard/apprentice/app = new(app_mind) - app.wiz_team = master_antag.wiz_team - app.master = wizard + app.master = user app.school = school - master_antag.wiz_team.add_member(app_mind) + + var/datum/antagonist/wizard/master_wizard = user.has_antag_datum(/datum/antagonist/wizard) + if(master_wizard) + if(!master_wizard.wiz_team) + master_wizard.create_wiz_team() + app.wiz_team = master_wizard.wiz_team + master_wizard.wiz_team.add_member(app_mind) app_mind.add_antag_datum(app) //TODO Kill these if possible app_mind.assigned_role = "Apprentice"