Files
Bubberstation/code/game/gamemodes/devil/game_mode.dm
SteelSlayer f77d0db3e4 Refactors antag datum hud adding and removing procs (#47573)
* Refactors antag datum hud giving code

* epic fail. this is a much better way to do it

* reduces copy and paste for clown mutation

* review additions

* didn't mean to put that there

* re-add check
2019-11-06 21:30:21 +01:00

27 lines
1.2 KiB
Plaintext

/datum/game_mode
var/list/datum/mind/devils = list()
var/devil_ascended = 0 // Number of arch devils on station
/datum/game_mode/proc/add_devil_objectives(datum/mind/devil_mind, quantity)
var/list/validtypes = list(/datum/objective/devil/soulquantity, /datum/objective/devil/soulquality, /datum/objective/devil/sintouch, /datum/objective/devil/buy_target)
var/datum/antagonist/devil/D = devil_mind.has_antag_datum(/datum/antagonist/devil)
for(var/i = 1 to quantity)
var/type = pick(validtypes)
var/datum/objective/devil/objective = new type(null)
objective.owner = devil_mind
D.objectives += objective
if(!istype(objective, /datum/objective/devil/buy_target))
validtypes -= type //prevent duplicate objectives, EXCEPT for buy_target.
else
objective.find_target()
/datum/game_mode/proc/update_soulless_icons_added(datum/mind/soulless_mind)
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SOULLESS]
hud.join_hud(soulless_mind.current)
set_antag_hud(soulless_mind.current, "soulless")
/datum/game_mode/proc/update_soulless_icons_removed(datum/mind/soulless_mind)
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SOULLESS]
hud.leave_hud(soulless_mind.current)
set_antag_hud(soulless_mind.current, null)