Skip to content

Commit

Permalink
Added the very basis of cultist mode, it doesn't have proper objectiv…
Browse files Browse the repository at this point in the history
…es yet, but at least I can catch some bugs via playtesting, hopefully.

Wizards now shout a spell when they're casting - not corresponding to the spell itself, though, it's a placeholder until granny finishes his voice acting.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@336 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
uporotiy committed Oct 20, 2010
1 parent c53ece1 commit 39efab2
Show file tree
Hide file tree
Showing 42 changed files with 498 additions and 5 deletions.
4 changes: 4 additions & 0 deletions code/WorkInProgress/cloning.dm
Expand Up @@ -483,6 +483,10 @@
if ((src.occupant.mind in ticker.mode:revolutionaries) || (src.occupant.mind in ticker.mode:head_revolutionaries))
ticker.mode:add_revolutionary(src.occupant.mind)
ticker.mode:update_all_rev_icons() //So the icon actually appears
if ("cult")
if (src.occupant.mind in ticker.mode:cult)
ticker.mode:add_cultist(src.occupant.mind)
ticker.mode:update_all_cult_icons() //So the icon actually appears
if ("changeling")
if (src.occupant.mind in ticker.mode:changelings)
src.occupant.make_changeling()
Expand Down
313 changes: 313 additions & 0 deletions code/game/gamemodes/cult/cult.dm
@@ -0,0 +1,313 @@
// To add a rev to the list of revolutionaries, make sure it's rev (with if(ticker.mode.name == "revolution)),
// then call ticker.mode:add_revolutionary(_THE_PLAYERS_MIND_)
// nothing else needs to be done, as that proc will check if they are a valid target.
// Just make sure the converter is a head before you call it!
// To remove a rev (from brainwashing or w/e), call ticker.mode:remove_revolutionary(_THE_PLAYERS_MIND_),
// this will also check they're not a head, so it can just be called freely
// If the rev icons start going wrong for some reason, ticker.mode:update_all_rev_icons() can be called to correct them.
// If the game somtimes isn't registering a win properly, then ticker.mode.check_win() isn't being called somewhere.

/datum/game_mode/cult
name = "cult"
config_tag = "cult"

var/list/datum/mind/cult = list()
var/finished = 0
var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds)
var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds)


/datum/game_mode/cult/announce()
world << "<B>The current game mode is - Cult!</B>"
world << "<B>Some crewmembers are attempting to start a cult!<BR>\nCultists - Kill the Captain, HoP, RD, CE and HoS. Convert other crewmembers (excluding the heads, security officers and chaplain) to your cause by using the convert rune. Remember - there is no you, there is only the cult.<BR>\nPersonnel - Protect the heads. Destroy the cult either via killing the cultists or brainwashing them with the chaplain's bible.</B>"

/datum/game_mode/cult/post_setup()

var/list/cultists_possible = list()
cultists_possible = get_possible_cultists()
var/list/heads = list()
heads = get_living_heads()
var/cultists_number = 0

if(!cultists_possible || !heads)
world << "<B> \red Not enough players for cult game mode. Restarting world in 5 seconds."
sleep(50)
world.Reboot()
return

if(cultists_possible.len >= 3)
cultists_number = 3
else
cultists_number = cultists_possible.len

while(cultists_number > 0)
cult += pick(cultists_possible)
cultists_possible -= cult
cultists_number--

for(var/datum/mind/cult_mind in cult)
for(var/datum/mind/head_mind in heads)
var/datum/objective/assassinate/cult_obj = new
cult_obj.owner = cult_mind
cult_obj.find_target_by_role(head_mind.assigned_role)
cult_mind.objectives += cult_obj

equip_cultist(cult_mind.current)
update_cult_icons_added(cult_mind)

for(var/datum/mind/cult_mind in cult)
var/obj_count = 1
cult_mind.current << "\blue You are a member of the cult!"
for(var/datum/objective/objective in cult_mind.objectives)
cult_mind.current << "<B>Objective #[obj_count]</B>: [objective.explanation_text]"
obj_count++

spawn (rand(waittime_l, waittime_h))
send_intercept()

/datum/game_mode/cult/proc/equip_cultist(mob/living/carbon/human/cult_mob)
if(!istype(cult_mob))
return
spawn (0)
var/obj/item/weapon/paper/talisman/supply/T = null
cult_mob.equip_if_possible(new /obj/item/weapon/paper/talisman/supply(cult_mob), cult_mob.slot_l_store)
if (!T && istype(cult_mob.l_store, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = cult_mob.l_store
var/list/L = S.return_inv()
for (var/obj/item/weapon/paper/talisman/supply/foo in L)
T = foo
break
if (!T)
cult_mob << "Unfortunately, you weren't able to get a talisman. This is very bad and you should adminhelp immediately."
else
cult_mob << "You have a talisman in your backpack, one that will help you start the cult on this station. Use it well and remember - there are others."
if(!wordtravel)
runerandom()
var/word=pick("1","2","3","4","5","6","7","8")
switch(word)
if("1")
cult_mob << "\red You remembered one thing from the dark teachings of your master... [wordtravel] is travel..."
if("2")
cult_mob << "\red You remembered one thing from the dark teachings of your master... [wordblood] is blood..."
if("3")
cult_mob << "\red You remembered one thing from the dark teachings of your master... [wordjoin] is join..."
if("4")
cult_mob << "\red You remembered one thing from the dark teachings of your master... [wordhell] is Hell..."
if("5")
cult_mob << "\red You remembered one thing from the dark teachings of your master... [worddestr] is destroy..."
if("6")
cult_mob << "\red You remembered one thing from the dark teachings of your master... [wordtech] is technology..."
if("7")
cult_mob << "\red You remembered one thing from the dark teachings of your master... [wordself] is self..."
if("8")
cult_mob << "\red You remembered one thing from the dark teachings of your master... [wordsee] is see..."

/datum/game_mode/cult/send_intercept()
var/intercepttext = "<FONT size = 3><B>Cent. Com. Update</B> Requested staus information:</FONT><HR>"
intercepttext += "<B> Cent. Com has recently been contacted by the following syndicate affiliated organisations in your area, please investigate any information you may have:</B>"

var/list/possible_modes = list()
possible_modes.Add("revolution", "cult", "wizard", "nuke", "traitor", "malf", "changeling")
possible_modes -= "[ticker.mode]"
var/number = pick(2, 3)
var/i = 0
for(i = 0, i < number, i++)
possible_modes.Remove(pick(possible_modes))
possible_modes.Insert(rand(possible_modes.len), "[ticker.mode]")

var/datum/intercept_text/i_text = new /datum/intercept_text
for(var/A in possible_modes)
intercepttext += i_text.build(A, pick(cult))

for (var/obj/machinery/computer/communications/comm in world)
if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept)
var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc )
intercept.name = "paper- 'Cent. Com. Status Summary'"
intercept.info = intercepttext

comm.messagetitle.Add("Cent. Com. Status Summary")
comm.messagetext.Add(intercepttext)

command_alert("Summary downloaded and printed out at all communications consoles.", "Enemy communication intercept. Security Level Elevated.")
world << sound('intercept.ogg')


/datum/game_mode/cult/check_win()
if(check_cult_victory())
finished = 1
else if(check_heads_victory())
finished = 2
return

/datum/game_mode/cult/check_finished()
if(finished != 0)
return 1
else
return 0

/datum/game_mode/cult/proc/add_cultist(datum/mind/cult_mind)
var/list/uncons = get_unconvertables()
if(!(cult_mind in cult) && !(cult_mind in uncons))
cult += cult_mind
update_cult_icons_added(cult_mind)

/datum/game_mode/cult/proc/remove_cultist(datum/mind/cult_mind)
if(cult_mind in cult)
cult -= cult_mind
cult_mind.current << "\red <FONT size = 3><B>You have been brainwashed! You are no longer a cultist!</B></FONT>"
update_cult_icons_removed(cult_mind)
for(var/mob/living/M in view(cult_mind.current))
M << "<FONT size = 3>[cult_mind.current] looks like they just reverted to their old faith!</FONT>"

/datum/game_mode/cult/proc/update_all_cult_icons()
spawn(0)
for(var/datum/mind/cultist in cult)
if(cultist.current)
if(cultist.current.client)
for(var/image/I in cultist.current.client.images)
if(I.icon_state == "cult")
del(I)

for(var/datum/mind/cultist in cult)
if(cultist.current)
if(cultist.current.client)
for(var/datum/mind/cultist_1 in cult)
if(cultist_1.current)
var/I = image('mob.dmi', loc = cultist_1.current, icon_state = "cult")
cultist.current.client.images += I

/datum/game_mode/cult/proc/update_cult_icons_added(datum/mind/cult_mind)
spawn(0)
for(var/datum/mind/cultist in cult)
if(cultist.current)
if(cultist.current.client)
var/I = image('mob.dmi', loc = cult_mind.current, icon_state = "cult")
cultist.current.client.images += I
if(cult_mind.current)
if(cult_mind.current.client)
var/image/J = image('mob.dmi', loc = cultist.current, icon_state = "cult")
cult_mind.current.client.images += J

/datum/game_mode/cult/proc/update_cult_icons_removed(datum/mind/cult_mind)
spawn(0)
for(var/datum/mind/cultist in cult)
if(cultist.current)
if(cultist.current.client)
for(var/image/I in cultist.current.client.images)
if(I.loc == cult_mind.current)
del(I)

if(cult_mind.current)
if(cult_mind.current.client)
for(var/image/I in cult_mind.current.client.images)
if(I.icon_state == "cult")
del(I)

/datum/game_mode/cult/proc/get_possible_cultists()
var/list/candidates = list()

for(var/mob/living/carbon/human/player in world)
if(player.client)
if(player.be_syndicate)
candidates += player.mind

if(candidates.len < 1)
for(var/mob/living/carbon/human/player in world)
if(player.client)
candidates += player.mind

var/list/uncons = get_unconvertables()
for(var/datum/mind/mind in uncons)
candidates -= mind

if(candidates.len < 1)
return null
else
return candidates

/datum/game_mode/cult/proc/get_living_heads()
var/list/heads = list()

for(var/mob/living/carbon/human/player in world)
if(player.mind)
var/role = player.mind.assigned_role
if(role in list("Captain", "Head of Security", "Head of Personnel", "Chief Engineer", "Research Director"))
heads += player.mind

return heads


/datum/game_mode/cult/proc/get_all_heads()
var/list/heads = list()

for(var/mob/player in world)
if(player.mind)
var/role = player.mind.assigned_role
if(role in list("Captain", "Head of Security", "Head of Personnel", "Chief Engineer", "Research Director"))
heads += player.mind

return heads

/datum/game_mode/cult/proc/get_unconvertables()
var/list/ucs = list()
for(var/mob/living/carbon/human/player in world)
if(player.mind)
var/role = player.mind.assigned_role
if(role in list("Captain", "Head of Security", "Head of Personnel", "Chief Engineer", "Research Director", "Security Officer", "Detective", "AI", "Chaplain"))
ucs += player.mind

return ucs

/datum/game_mode/cult/proc/check_cult_victory()
for(var/datum/mind/cult_mind in cult)
for(var/datum/objective/objective in cult_mind.objectives)
if(!(objective.check_completion()))
return 0

return 1

/datum/game_mode/cult/proc/check_heads_victory()
for(var/datum/mind/cult_mind in cult)
if(cult_mind.current.stat != 2)
return 0
return 1

/datum/game_mode/cult/declare_completion()

var/text = ""
if(finished == 1)
world << "\red <FONT size = 3><B> The heads of staff were killed! The cult win!</B></FONT>"
else if(finished == 2)
world << "\red <FONT size = 3><B> The heads of staff managed to stop the cult!</B></FONT>"

world << "<FONT size = 2><B>The cultists were: </B></FONT>"
for(var/datum/mind/cult_nh_mind in cultists)
if(cult_nh_mind.current)
text += "[cult_nh_mind.current.real_name]"
if(cult_nh_mind.current.stat == 2)
text += " (Dead)"
else
text += " (Survived!)"
else
text += "[cult_nh_mind.key] (character destroyed)"
text += ", "

world << text

world << "<FONT size = 2><B>The heads of staff were: </B></FONT>"
var/list/heads = list()
heads = get_all_heads()
for(var/datum/mind/head_mind in heads)
text = ""
if(head_mind.current)
text += "[head_mind.current.real_name]"
if(head_mind.current.stat == 2)
text += " (Dead)"
else
text += " (Survived!)"
else
text += "[head_mind.key] (character destroyed)"

world << text

return 1
31 changes: 31 additions & 0 deletions code/game/gamemodes/intercept_report.dm
Expand Up @@ -28,6 +28,10 @@
src.text = ""
src.build_rev(correct_mob)
return src.text
if("cult")
src.text = ""
src.build_cult(correct_mob)
return src.text
if("wizard")
src.text = ""
src.build_wizard(correct_mob)
Expand Down Expand Up @@ -85,6 +89,33 @@
src.text += "discovered the following set of fingerprints ([fingerprints]) on sensitive materials, and their owner should be closely observed."
src.text += "However, these could also belong to a current Cent. Com employee, so do not act on this without reason."

/datum/intercept_text/proc/build_cult(correct_mob)
var/name_1 = pick(src.org_names_1)
var/name_2 = pick(src.org_names_2)
var/traitor_name
var/traitor_job
var/prob_right_dude = rand(prob_correct_person_lower, prob_correct_person_higher)
var/prob_right_job = rand(prob_correct_job_lower, prob_correct_job_higher)
if(prob(prob_right_job))
if (correct_mob)
traitor_job = correct_mob:assigned_role
else
var/list/job_tmp = get_all_jobs()
job_tmp.Remove("Captain", "Chaplain", "Security Officer", "Detective", "Head Of Security", "Head of Personnel", "Chief Engineer", "Research Director")
traitor_job = pick(job_tmp)
if(prob(prob_right_dude) && ticker.mode == "cult")
traitor_name = correct_mob:current
else
traitor_name = src.pick_mob()

src.text += "<BR><BR>It has been brought to our attention that the [name_1] [name_2] have stumbled upon some dark secrets. They apparently want to spread the dangerous knowledge on as many stations as they can.<BR>"
src.text += "Based on our intelligence, we are [prob_right_job]% sure that if true, someone doing the job of [traitor_job] on your station may have been converted "
src.text += "and instilled with the idea of the flimsiness of the real world, seeking to destroy it. "
if(prob(prob_right_dude))
src.text += "<BR> In addition, we are [prob_right_dude]% sure that [traitor_name] may have also some in to contact with this "
src.text += "organisation."
src.text += "<BR>However, if this information is acted on without substantial evidence, those responsible will face severe repercussions."

/datum/intercept_text/proc/build_rev(correct_mob)
var/name_1 = pick(src.org_names_1)
var/name_2 = pick(src.org_names_2)
Expand Down
5 changes: 5 additions & 0 deletions code/game/gamemodes/wizard/spell10.dm
Expand Up @@ -17,6 +17,11 @@
spawn(400)
usr.verbs += /client/proc/mutate
usr.say("BIRUZ BENNAR")
if(!usr.miming)
if(usr.gender=="male")
playsound(usr.loc, pick('vs_chant_conj_hm.wav','vs_chant_conj_lm.wav','vs_chant_ench_hm.wav','vs_chant_ench_lm.wav','vs_chant_evoc_hm.wav','vs_chant_evoc_lm.wav','vs_chant_illu_hm.wav','vs_chant_illu_lm.wav','vs_chant_necr_hm.wav','vs_chant_necr_lm.wav'), 100, 1)
else
playsound(usr.loc, pick('vs_chant_conj_hf.wav','vs_chant_conj_lf.wav','vs_chant_ench_hf.wav','vs_chant_ench_lf.wav','vs_chant_evoc_hf.wav','vs_chant_evoc_lf.wav','vs_chant_illu_hf.wav','vs_chant_illu_lf.wav','vs_chant_necr_hf.wav','vs_chant_necr_lf.wav'), 100, 1)
usr << text("\blue You feel strong! Your mind expands!")
if (!(usr.mutations & 8))
usr.mutations |= 8
Expand Down
6 changes: 6 additions & 0 deletions code/game/gamemodes/wizard/spell12.dm
Expand Up @@ -30,6 +30,12 @@
A = input("Area to jump to", "BOOYEA", A) in theareas
var/area/thearea = theareas[A]
usr.say("SCYAR NILA [uppertext(A)]")
if(!usr.miming)
if(usr.gender=="male")
playsound(usr.loc, pick('vs_chant_conj_hm.wav','vs_chant_conj_lm.wav','vs_chant_ench_hm.wav','vs_chant_ench_lm.wav','vs_chant_evoc_hm.wav','vs_chant_evoc_lm.wav','vs_chant_illu_hm.wav','vs_chant_illu_lm.wav','vs_chant_necr_hm.wav','vs_chant_necr_lm.wav'), 100, 1)
else
playsound(usr.loc, pick('vs_chant_conj_hf.wav','vs_chant_conj_lf.wav','vs_chant_ench_hf.wav','vs_chant_ench_lf.wav','vs_chant_evoc_hf.wav','vs_chant_evoc_lf.wav','vs_chant_illu_hf.wav','vs_chant_illu_lf.wav','vs_chant_necr_hf.wav','vs_chant_necr_lf.wav'), 100, 1)


var/datum/effects/system/harmless_smoke_spread/smoke = new /datum/effects/system/harmless_smoke_spread()
smoke.set_up(5, 0, usr.loc)
Expand Down

0 comments on commit 39efab2

Please sign in to comment.