mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
Wizard apprentices made their own thing (#11939)
* seperates wizard apprentices from traitors * revision 1 * why did I think this was needed * conflicts * seperates wizard apprentices from traitors * revision 1 * why did I think this was needed * conflicts?
This commit is contained in:
@@ -157,6 +157,8 @@
|
||||
|
||||
#define iswizard(H) (H.mind in ticker.mode.wizards)
|
||||
|
||||
#define isapprentice(H) (H.mind in ticker.mode.apprentices)
|
||||
|
||||
#define isbadmonkey(H) ((/datum/disease/jungle_fever in H.viruses) || H.mind in ticker.mode.infected_monkeys)
|
||||
|
||||
#define isdeathsquad(H) (H.mind in ticker.mode.deathsquads)
|
||||
|
||||
@@ -134,6 +134,7 @@
|
||||
"revolution",
|
||||
"cult",
|
||||
"wizard",
|
||||
"apprentice",
|
||||
"changeling",
|
||||
"vampire",
|
||||
"nuclear",
|
||||
@@ -214,6 +215,21 @@
|
||||
text += "<a href='?src=\ref[src];wizard=wizard'>yes</a>|<b>NO</b>"
|
||||
sections["wizard"] = text
|
||||
|
||||
/** WIZARD'S APPRENTICES ***/
|
||||
text = "apprentice"
|
||||
if (ticker.mode.config_tag=="wizard")
|
||||
text = uppertext(text)
|
||||
text = "<i><b>[text]</b></i>: "
|
||||
if (src in ticker.mode.apprentices)
|
||||
|
||||
text += {"<b>YES</b>|<a href='?src=\ref[src];apprentice=clear'>no</a>
|
||||
<br><a href='?src=\ref[src];apprentice=lair'>To lair</a>, <a href='?src=\ref[src];common=undress'>undress</a>, <a href='?src=\ref[src];apprentice=dressup'>dress up</a>, <a href='?src=\ref[src];apprentice=name'>let choose name</a>."}
|
||||
if (objectives.len==0)
|
||||
text += "<br>Objectives are empty! <a href='?src=\ref[src];apprentice=autoobjectives'>Randomize!</a>"
|
||||
else
|
||||
text += "<a href='?src=\ref[src];apprentice=apprentice'>yes</a>|<b>NO</b>"
|
||||
sections["apprentice"] = text
|
||||
|
||||
/** CHANGELING ***/
|
||||
text = "changeling"
|
||||
if (ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan")
|
||||
@@ -742,6 +758,37 @@
|
||||
to_chat(usr, "<span class='notice'>The objectives for wizard [key] have been generated. You can edit them and anounce manually.</span>")
|
||||
ticker.mode.update_all_wizard_icons()
|
||||
|
||||
else if (href_list["apprentice"])
|
||||
switch(href_list["apprentice"])
|
||||
if("clear")
|
||||
if(src in ticker.mode.apprentices)
|
||||
ticker.mode.apprentices -= src
|
||||
special_role = null
|
||||
current.spellremove(current, config.feature_object_spell_system? "object":"verb")
|
||||
to_chat(current, "<span class='danger'><FONT size = 3>You have been brainwashed! You are no longer a wizard's apprentice!</FONT></span>")
|
||||
ticker.mode.update_wizard_icons_removed(src)
|
||||
log_admin("[key_name_admin(usr)] has de-apprentice'ed [current].")
|
||||
if("apprentice")
|
||||
if(!(src in ticker.mode.apprentices))
|
||||
ticker.mode.apprentices += src
|
||||
special_role = "apprentice"
|
||||
//ticker.mode.learn_basic_spells(current)
|
||||
to_chat(current, "<span class='danger'>You are a Space Wizard's apprentice!!</span>")
|
||||
var/wikiroute = role_wiki[ROLE_WIZARD]
|
||||
to_chat(current, "<span class='info'><a HREF='?src=\ref[current];getwiki=[wikiroute]'>(Wiki Guide)</a></span>")
|
||||
ticker.mode.update_wizard_icons_added(src)
|
||||
log_admin("[key_name_admin(usr)] has apprentice'ed [current].")
|
||||
if("lair")
|
||||
current.forceMove(pick(wizardstart))
|
||||
if("dressup")
|
||||
ticker.mode.equip_wizard(current)
|
||||
if("name")
|
||||
ticker.mode.name_wizard(current)
|
||||
if("autoobjectives")
|
||||
ticker.mode.forge_wizard_objectives(src)
|
||||
to_chat(usr, "<span class='notice'>Random wizard objectives for apprentice [key] have been generated. You can edit them and anounce manually.</span>")
|
||||
ticker.mode.update_all_wizard_icons()
|
||||
|
||||
else if (href_list["changeling"])
|
||||
switch(href_list["changeling"])
|
||||
if("clear")
|
||||
|
||||
@@ -657,7 +657,7 @@
|
||||
attack_verb = wielded ? list("rams into", "charges at") : list("bludgeons", "whacks", "cleans", "dusts")
|
||||
if(user)
|
||||
user.update_inv_hands()
|
||||
if(user.mind in ticker.mode.wizards)
|
||||
if(iswizard(user) || isapprentice(user))
|
||||
user.flying = wielded ? 1 : 0
|
||||
if(wielded)
|
||||
to_chat(user, "<span class='notice'>You hold \the [src] between your legs.</span>")
|
||||
|
||||
@@ -127,7 +127,8 @@
|
||||
new_objective:target = usr:mind
|
||||
new_objective.explanation_text = "Protect [usr.real_name], the wizard."
|
||||
M.mind.objectives += new_objective
|
||||
ticker.mode.traitors += M.mind
|
||||
ticker.mode.apprentices += M.mind
|
||||
ticker.mode.update_wizard_icons_added(M.mind)
|
||||
M.mind.special_role = "apprentice"
|
||||
|
||||
M.make_all_robot_parts_organic()
|
||||
|
||||
@@ -236,6 +236,13 @@
|
||||
to_chat(M.current, "<span class='danger'><FONT size = 3>Your powers ebb and you feel weak. You are no longer a wizard.</FONT></span>")
|
||||
ticker.mode.update_wizard_icons_removed(M)
|
||||
|
||||
if(M in ticker.mode.apprentices)
|
||||
ticker.mode.apprentices -= M
|
||||
M.special_role = null
|
||||
M.current.spellremove(M.current, config.feature_object_spell_system? "object":"verb")
|
||||
to_chat(M.current, "<span class='danger'><FONT size = 3>What little magic you have leaves you. You are no longer a wizard's apprentice.</FONT></span>")
|
||||
ticker.mode.update_wizard_icons_removed(M)
|
||||
|
||||
if(M in ticker.mode.changelings)
|
||||
ticker.mode.changelings -= M
|
||||
M.special_role = null
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
/datum/game_mode
|
||||
var/list/datum/mind/wizards = list()
|
||||
var/list/datum/mind/apprentices = list()
|
||||
|
||||
/datum/game_mode/wizard
|
||||
name = "wizard"
|
||||
@@ -322,6 +323,66 @@
|
||||
i++
|
||||
text += "<br>"
|
||||
text += "<HR>"
|
||||
if(apprentices.len)
|
||||
var/icon/logo = icon('icons/mob/mob.dmi', "apprentice-logo")
|
||||
end_icons += logo
|
||||
var/tempstate = end_icons.len
|
||||
text += {"<br><img src="logo_[tempstate].png"> <font size=2><b>the wizard's apprentices were:</b></font> <img src="logo_[tempstate].png">"}
|
||||
|
||||
for(var/datum/mind/apprentice in apprentices)
|
||||
|
||||
if(apprentice.current)
|
||||
var/icon/flat = getFlatIcon(apprentice.current, SOUTH, 1, 1)
|
||||
end_icons += flat
|
||||
tempstate = end_icons.len
|
||||
text += {"<br><img src="logo_[tempstate].png"> <b>[apprentice.key]</b> was <b>[apprentice.name]</b> ("}
|
||||
if(apprentice.current.stat == DEAD)
|
||||
text += "died"
|
||||
flat.Turn(90)
|
||||
end_icons[tempstate] = flat
|
||||
else
|
||||
text += "survived"
|
||||
if(apprentice.current.real_name != apprentice.name)
|
||||
text += " as <b>[apprentice.current.real_name]</b>"
|
||||
else
|
||||
var/icon/sprotch = icon('icons/effects/blood.dmi', "floor1-old")
|
||||
end_icons += sprotch
|
||||
tempstate = end_icons.len
|
||||
text += {"<br><img src="logo_[tempstate].png"> <b>[apprentice.key]</b> was <b>[apprentice.name]</b> ("}
|
||||
text += "body destroyed"
|
||||
text += ")"
|
||||
|
||||
var/count = 1
|
||||
var/apprenticewin = 1
|
||||
for(var/datum/objective/objective in apprentice.objectives)
|
||||
if(objective.check_completion())
|
||||
text += "<br><B>Objective #[count]</B>: [objective.explanation_text] <font color='green'><B>Success!</B></font>"
|
||||
feedback_add_details("wizard_objective","[objective.type]|SUCCESS")
|
||||
else
|
||||
text += "<br><B>Objective #[count]</B>: [objective.explanation_text] <font color='red'>Fail.</font>"
|
||||
feedback_add_details("wizard_objective","[objective.type]|FAIL")
|
||||
apprenticewin = 0
|
||||
count++
|
||||
|
||||
if(apprentice.current && apprentice.current.stat!=2 && apprenticewin)
|
||||
text += "<br><font color='green'><B>The apprentice was successful!</B></font>"
|
||||
feedback_add_details("wizard_success","SUCCESS")
|
||||
else
|
||||
text += "<br><font color='red'><B>The apprentice has failed!</B></font>"
|
||||
feedback_add_details("wizard_success","FAIL")
|
||||
if(apprentice.current && apprentice.current.spell_list)
|
||||
text += "<br><B>[apprentice.name] used the following spells: </B>"
|
||||
var/i = 1
|
||||
for(var/spell/S in apprentice.current.spell_list)
|
||||
var/icon/spellicon = icon('icons/mob/screen_spells.dmi', S.hud_state)
|
||||
end_icons += spellicon
|
||||
tempstate = end_icons.len
|
||||
text += {"<br><img src="logo_[tempstate].png"> [S.name]"}
|
||||
if(apprentice.current.spell_list.len > i)
|
||||
text += ", "
|
||||
i++
|
||||
text += "<br>"
|
||||
text += "<HR>"
|
||||
return text
|
||||
|
||||
//OTHER PROCS
|
||||
@@ -378,9 +439,24 @@ Made a proc so this is not repeated 14 (or more) times.*/
|
||||
if(I.icon_state == "wizard")
|
||||
wizard_mind.current.client.images -= I
|
||||
|
||||
for(var/datum/mind/apprentice_mind in apprentices)
|
||||
if(apprentice_mind.current)
|
||||
if(apprentice_mind.current.client)
|
||||
for(var/image/I in apprentice_mind.current.client.images)
|
||||
if(I.icon_state == "wizard" || I.icon_state == "apprentice")
|
||||
apprentice_mind.current.client.images -= I
|
||||
|
||||
for(var/datum/mind/wizard_mind in wizards)
|
||||
if(wizard_mind.current)
|
||||
if(wizard_mind.current.client)
|
||||
for(var/datum/mind/apprentice in apprentices)
|
||||
if(apprentice.current)
|
||||
var/imageloc = apprentice.current
|
||||
if(istype(apprentice.current.loc,/obj/mecha))
|
||||
imageloc = apprentice.current.loc
|
||||
var/image/I = image('icons/mob/mob.dmi', loc = imageloc, icon_state = "apprentice")
|
||||
I.plane = WIZ_ANTAG_HUD_PLANE
|
||||
wizard_mind.current.client.images += I
|
||||
for(var/datum/mind/wizard_mind_1 in wizards)
|
||||
if(wizard_mind_1.current)
|
||||
var/imageloc = wizard_mind_1.current
|
||||
@@ -390,16 +466,63 @@ Made a proc so this is not repeated 14 (or more) times.*/
|
||||
I.plane = WIZ_ANTAG_HUD_PLANE
|
||||
wizard_mind.current.client.images += I
|
||||
|
||||
for(var/datum/mind/apprentice_mind in apprentices)
|
||||
if(apprentice_mind.current)
|
||||
if(apprentice_mind.current.client)
|
||||
for(var/datum/mind/wizard in wizards)
|
||||
if(wizard.current)
|
||||
var/imageloc = wizard.current
|
||||
if(istype(wizard.current.loc,/obj/mecha))
|
||||
imageloc = wizard.current.loc
|
||||
var/image/I = image('icons/mob/mob.dmi', loc = imageloc, icon_state = "wizard")
|
||||
I.plane = WIZ_ANTAG_HUD_PLANE
|
||||
apprentice_mind.current.client.images += I
|
||||
for(var/datum/mind/apprentice_1 in apprentices)
|
||||
if(apprentice_1.current)
|
||||
var/imageloc = apprentice_1.current
|
||||
if(istype(apprentice_1.current.loc,/obj/mecha))
|
||||
imageloc = apprentice_1.current.loc
|
||||
var/image/I = image('icons/mob/mob.dmi', loc = imageloc, icon_state = "apprentice")
|
||||
I.plane = WIZ_ANTAG_HUD_PLANE
|
||||
apprentice_mind.current.client.images += I
|
||||
|
||||
/datum/game_mode/proc/update_wizard_icons_added(datum/mind/wizard_mind)
|
||||
spawn(0)
|
||||
if(wizard_mind.current)
|
||||
if(wizard_mind.current.client)
|
||||
var/imageloc = wizard_mind.current
|
||||
if(istype(wizard_mind.current.loc,/obj/mecha))
|
||||
imageloc = wizard_mind.current.loc
|
||||
var/image/I = image('icons/mob/mob.dmi', loc = imageloc, icon_state = "wizard")
|
||||
I.plane = WIZ_ANTAG_HUD_PLANE
|
||||
wizard_mind.current.client.images += I
|
||||
for(var/datum/mind/wizard_mind_1 in wizards)
|
||||
if(wizard_mind_1.current)
|
||||
if(wizard_mind_1.current.client)
|
||||
var/imageloc = wizard_mind.current
|
||||
if(istype(wizard_mind.current.loc,/obj/mecha))
|
||||
imageloc = wizard_mind.current.loc
|
||||
var/image/I = image('icons/mob/mob.dmi', loc = imageloc, icon_state = "apprentice")
|
||||
I.plane = WIZ_ANTAG_HUD_PLANE
|
||||
wizard_mind_1.current.client.images += I
|
||||
if(wizard_mind.current)
|
||||
if(wizard_mind.current.client)
|
||||
var/imageloc = wizard_mind_1.current
|
||||
if(istype(wizard_mind_1.current.loc,/obj/mecha))
|
||||
imageloc = wizard_mind_1.current.loc
|
||||
var/image/J = image('icons/mob/mob.dmi', loc = imageloc, icon_state = "wizard")
|
||||
J.plane = WIZ_ANTAG_HUD_PLANE
|
||||
wizard_mind.current.client.images += J
|
||||
|
||||
for(var/datum/mind/apprentice_mind in apprentices)
|
||||
if(apprentice_mind.current)
|
||||
if(apprentice_mind.current.client)
|
||||
var/imageloc = wizard_mind.current
|
||||
if(istype(wizard_mind.current.loc,/obj/mecha))
|
||||
imageloc = wizard_mind.current.loc
|
||||
var/image/I = image('icons/mob/mob.dmi', loc = imageloc, icon_state = "apprentice")
|
||||
I.plane = WIZ_ANTAG_HUD_PLANE
|
||||
apprentice_mind.current.client.images += I
|
||||
if(wizard_mind.current)
|
||||
if(wizard_mind.current.client)
|
||||
var/imageloc = apprentice_mind.current
|
||||
if(istype(apprentice_mind.current.loc,/obj/mecha))
|
||||
imageloc = apprentice_mind.current.loc
|
||||
var/image/J = image('icons/mob/mob.dmi', loc = imageloc, icon_state = "apprentice")
|
||||
J.plane = WIZ_ANTAG_HUD_PLANE
|
||||
wizard_mind.current.client.images += J
|
||||
|
||||
/datum/game_mode/proc/update_wizard_icons_removed(datum/mind/wizard_mind)
|
||||
spawn(0)
|
||||
@@ -407,13 +530,21 @@ Made a proc so this is not repeated 14 (or more) times.*/
|
||||
if(wizard.current)
|
||||
if(wizard.current.client)
|
||||
for(var/image/I in wizard.current.client.images)
|
||||
if(I.icon_state == "wizard" && ((I.loc == wizard_mind.current) || (I.loc == wizard_mind.current.loc)))
|
||||
if((I.icon_state == "wizard" || I.icon_state == "apprentice") && ((I.loc == wizard_mind.current) || (I.loc == wizard_mind.current.loc)))
|
||||
//del(I)
|
||||
wizard.current.client.images -= I
|
||||
|
||||
for(var/datum/mind/apprentice_mind in apprentices)
|
||||
if(apprentice_mind.current)
|
||||
if(apprentice_mind.current.client)
|
||||
for(var/image/I in apprentice_mind.current.client.images)
|
||||
if((I.icon_state == "wizard" || I.icon_state == "apprentice") && ((I.loc == wizard_mind.current) || (I.loc == wizard_mind.current.loc)))
|
||||
//del(I)
|
||||
apprentice_mind.current.client.images -= I
|
||||
|
||||
if(wizard_mind.current)
|
||||
if(wizard_mind.current.client)
|
||||
for(var/image/I in wizard_mind.current.client.images)
|
||||
if(I.icon_state == "wizard")
|
||||
if(I.icon_state == "wizard" || I.icon_state == "apprentice")
|
||||
//del(I)
|
||||
wizard_mind.current.client.images -= I
|
||||
|
||||
@@ -1131,13 +1131,13 @@
|
||||
|
||||
// -- Mode/mind specific stuff goes here
|
||||
if(H.mind)
|
||||
if((H.mind in ticker.mode:revolutionaries) || (H.mind in ticker.mode:head_revolutionaries))
|
||||
if(isrev(H) || isrevhead(H))
|
||||
ticker.mode.update_all_rev_icons()
|
||||
if(H.mind in ticker.mode.syndicates)
|
||||
if(isnukeop(H))
|
||||
ticker.mode.update_all_synd_icons()
|
||||
if (H.mind in ticker.mode.cult)
|
||||
if (iscult(H))
|
||||
ticker.mode.update_all_cult_icons()
|
||||
if(H.mind in ticker.mode.wizards)
|
||||
if(iswizard(H) || isapprentice(H))
|
||||
ticker.mode.update_all_wizard_icons()
|
||||
// -- End mode specific stuff
|
||||
|
||||
@@ -1309,13 +1309,13 @@
|
||||
|
||||
// -- Mode/mind specific stuff goes here
|
||||
if(src.occupant.mind)
|
||||
if((src.occupant.mind in ticker.mode:revolutionaries) || (src.occupant.mind in ticker.mode:head_revolutionaries))
|
||||
if(isrev(src.occupant) || isrevhead(src.occupant))
|
||||
ticker.mode.update_all_rev_icons()
|
||||
if(src.occupant.mind in ticker.mode.syndicates)
|
||||
if(isnukeop(src.occupant))
|
||||
ticker.mode.update_all_synd_icons()
|
||||
if (src.occupant.mind in ticker.mode.cult)
|
||||
if (iscult(src.occupant))
|
||||
ticker.mode.update_all_cult_icons()
|
||||
if(src.occupant.mind in ticker.mode.wizards)
|
||||
if(iswizard(src.occupant) || isapprentice(src.occupant))
|
||||
ticker.mode.update_all_wizard_icons()
|
||||
// -- End mode specific stuff
|
||||
|
||||
|
||||
@@ -1172,7 +1172,7 @@ var/global/floorIsLava = 0
|
||||
if (ticker.mode.config_tag == "nuclear")
|
||||
return 2
|
||||
return 1
|
||||
if(iswizard(M))
|
||||
if(iswizard(M) || isapprentice(M))
|
||||
if (ticker.mode.config_tag == "wizard")
|
||||
return 2
|
||||
return 1
|
||||
|
||||
@@ -98,6 +98,19 @@
|
||||
dat += "<tr><td><i>Wizard not found!</i></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
if(ticker.mode.apprentices.len > 0)
|
||||
dat += "<br><table cellspacing=5><tr><td><B>Wizard's apprentices</B></td><td></td><td></td></tr>"
|
||||
for(var/datum/mind/apprentice in ticker.mode.apprentices)
|
||||
var/mob/M = apprentice.current
|
||||
if(M)
|
||||
|
||||
dat += {"<tr><td><a href='?src=\ref[src];adminplayeropts=\ref[M]'>[M.real_name]</a>[M.client ? "" : " <i>(logged out)</i>"][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>
|
||||
<td><A href='?src=\ref[usr];priv_msg=\ref[M]'>PM</A></td>
|
||||
<td><A HREF='?src=\ref[src];traitor=\ref[M]'>Show Objective</A></td></tr>"}
|
||||
else
|
||||
dat += "<tr><td><i>Apprentice not found!</i></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
/* REMOVED as requested
|
||||
if(ticker.mode.raiders.len > 0)
|
||||
dat += "<br><table cellspacing=5><tr><td><B>Raiders</B></td><td></td><td></td></tr>"
|
||||
|
||||
@@ -247,14 +247,14 @@
|
||||
|
||||
// -- Mode/mind specific stuff goes here
|
||||
|
||||
if((H.mind in ticker.mode:revolutionaries) || (H.mind in ticker.mode:head_revolutionaries))
|
||||
if(isrev(H) || isrevhead(H))
|
||||
ticker.mode.update_all_rev_icons() //So the icon actually appears
|
||||
if(H.mind in ticker.mode.syndicates)
|
||||
if(isnukeop(H))
|
||||
ticker.mode.update_all_synd_icons()
|
||||
if (H.mind in ticker.mode.cult)
|
||||
if (iscult(H))
|
||||
ticker.mode.add_cultist(src.occupant.mind)
|
||||
ticker.mode.update_all_cult_icons() //So the icon actually appears
|
||||
if(H.mind in ticker.mode.wizards)
|
||||
if(iswizard(H) || isapprentice(H))
|
||||
ticker.mode.update_all_wizard_icons()
|
||||
if(("\ref[H.mind]" in ticker.mode.necromancer) || (H.mind in ticker.mode.risen))
|
||||
ticker.mode.update_all_necro_icons()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
ticker.mode.update_cult_icons_added(src.mind)
|
||||
if(mind in ticker.mode:syndicates)
|
||||
ticker.mode.update_all_synd_icons()
|
||||
if(mind in ticker.mode.wizards)
|
||||
if(mind in ticker.mode.wizards || mind in ticker.mode.apprentices)
|
||||
ticker.mode.update_all_wizard_icons()
|
||||
var/ref = "\ref[mind]"
|
||||
if(ref in ticker.mode.implanter)
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here.
|
||||
for(var/V in caster.mind.special_verbs)
|
||||
victim.verbs += V
|
||||
ticker.mode.update_all_wizard_icons()
|
||||
//MIND TRANSFER END
|
||||
|
||||
//Target is handled in ..(), so we handle the caster here
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 233 KiB After Width: | Height: | Size: 234 KiB |
Reference in New Issue
Block a user