Skip to content

Commit

Permalink
Cult communication is now innate and has an action button
Browse files Browse the repository at this point in the history
  • Loading branch information
ChangelingRain committed May 2, 2016
1 parent 009988b commit 0897f3b
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 135 deletions.
9 changes: 2 additions & 7 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,7 @@

/datum/mind/proc/remove_cultist()
if(src in ticker.mode.cult)
ticker.mode.cult -= src
ticker.mode.update_cult_icons_removed(src)
var/datum/game_mode/cult/cult = ticker.mode
if(istype(cult))
cult.memorize_cult_objectives(src)
ticker.mode.remove_cultist(src, 0, 0)
special_role = null
remove_objectives()
remove_antag_equip()
Expand Down Expand Up @@ -983,12 +979,11 @@
switch(href_list["cult"])
if("clear")
remove_cultist()
current << "<span class='userdanger'>You have been brainwashed! You are no longer a cultist!</span>"
message_admins("[key_name_admin(usr)] has de-cult'ed [current].")
log_admin("[key_name(usr)] has de-cult'ed [current].")
if("cultist")
if(!(src in ticker.mode.cult))
ticker.mode.add_cultist(src)
ticker.mode.add_cultist(src, 0)
message_admins("[key_name_admin(usr)] has cult'ed [current].")
log_admin("[key_name(usr)] has cult'ed [current].")
if("tome")
Expand Down
55 changes: 16 additions & 39 deletions code/game/gamemodes/cult/cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,6 @@
if(is_sacrifice_target(mind)) return 0
return 1

/proc/cultist_commune(mob/living/user, clear = 0, say = 0, message)
if(!message)
return
if(say)
user.say("O bidai nabora se[pick("'","`")]sma!")
else
user.whisper("O bidai nabora se[pick("'","`")]sma!")
sleep(10)
if(!user)
return
if(say)
user.say(message)
else
user.whisper(message)
var/my_message = "Error, message null. You should probably report this."
for(var/mob/M in mob_list)
if(iscultist(M) || (M in dead_mob_list))
if(clear || !ishuman(user))
my_message = "<span class='cultitalic'><b>[(ishuman(user) ? "Acolyte" : "Construct")] [user]:</b> [message]</span>"
else //Emergency comms
my_message = "<span class='purple'><i>Acolyte ???:</i> <b>[message]</b></span>"
if(M in dead_mob_list)
M << "<a href='?src=\ref[M];follow=\ref[user]'>(F)</a> [my_message]"
else
M << my_message

log_say("[user.real_name]/[user.key] : [message]")



/datum/game_mode/cult
name = "cult"
config_tag = "cult"
Expand Down Expand Up @@ -120,6 +90,7 @@
explanation = "Summon Nar-Sie by invoking the rune 'Summon Nar-Sie' with nine acolytes around and on it. You must do this after sacrificing your target."
cult_mind.current << "<B>Objective #[obj_count]</B>: [explanation]"
cult_mind.memory += "<B>Objective #[obj_count]</B>: [explanation]<BR>"

/datum/game_mode/cult/post_setup()
modePlayer += cult
if("sacrifice" in cult_objectives)
Expand All @@ -139,12 +110,12 @@
equip_cultist(cult_mind.current)
update_cult_icons_added(cult_mind)
cult_mind.current << "<span class='userdanger'>You are a member of the cult!</span>"
memorize_cult_objectives(cult_mind)
add_cultist(cult_mind, 0)
..()

/datum/game_mode/proc/equip_cultist(mob/living/carbon/human/mob,tome = 0)
if(!istype(mob))
return
mob.cult_add_comm()
if (mob.mind)
if (mob.mind.assigned_role == "Clown")
mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself."
Expand Down Expand Up @@ -180,33 +151,39 @@
B.show_to(mob)
return 1

/datum/game_mode/proc/add_cultist(datum/mind/cult_mind) //BASE
/datum/game_mode/proc/add_cultist(datum/mind/cult_mind, stun) //BASE
if (!istype(cult_mind))
return 0
if(!(cult_mind in cult) && is_convertable_to_cult(cult_mind))
cult_mind.current.Paralyse(5)
if(stun)
cult_mind.current.Paralyse(5)
cult += cult_mind
cult_mind.current.faction |= "cult"
cult_mind.current.cult_add_comm()
cult_mind.current.verbs += /mob/living/proc/cult_help
var/datum/action/innate/cultcomm/C = new()
C.Grant(cult_mind.current)
update_cult_icons_added(cult_mind)
cult_mind.current.attack_log += "\[[time_stamp()]\] <span class='danger'>Has been converted to the cult!</span>"
if(jobban_isbanned(cult_mind.current, ROLE_CULTIST))
replace_jobbaned_player(cult_mind.current, ROLE_CULTIST, ROLE_CULTIST)
return 1


/datum/game_mode/cult/add_cultist(datum/mind/cult_mind) //INHERIT
/datum/game_mode/cult/add_cultist(datum/mind/cult_mind, stun) //INHERIT
if (!..(cult_mind))
return
memorize_cult_objectives(cult_mind)


/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, show_message = 1)
/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, show_message = 1, stun)
if(cult_mind in cult)
cult -= cult_mind
cult_mind.current.faction -= "cult"
cult_mind.current.verbs -= /mob/living/proc/cult_innate_comm
cult_mind.current.Paralyse(5)
cult_mind.current.verbs -= /mob/living/proc/cult_help
for(var/datum/action/innate/cultcomm/C in cult_mind.current.actions)
qdel(C)
if(stun)
cult_mind.current.Paralyse(5)
cult_mind.current << "<span class='userdanger'>An unfamiliar white light flashes through your mind, cleansing the taint of the Dark One and all your memories as its servant.</span>"
cult_mind.memory = ""
update_cult_icons_removed(cult_mind)
Expand Down
75 changes: 75 additions & 0 deletions code/game/gamemodes/cult/cult_comms.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

/datum/action/innate/cultcomm
name = "Communion"
button_icon_state = "cult_comms"
background_icon_state = "bg_demon"
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS

/datum/action/innate/cultcomm/IsAvailable()
if(!iscultist(owner))
return 0
return ..()

/datum/action/innate/cultcomm/Activate()
var/input = stripped_input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")
if(!input || !IsAvailable())
return

cultist_commune(usr, input)
return

/proc/cultist_commune(mob/living/user, message)
if(!message)
return
if(!ishuman(user))
user.say("O bidai nabora se[pick("'","`")]sma!")
else
user.whisper("O bidai nabora se[pick("'","`")]sma!")
sleep(10)
if(!user)
return
if(!ishuman(user))
user.say(message)
else
user.whisper(message)
var/my_message = "<span class='cultitalic'><b>[(ishuman(user) ? "Acolyte" : "Construct")] [user]:</b> [message]</span>"
for(var/mob/M in mob_list)
if(iscultist(M))
M << my_message
else if(M in dead_mob_list)
M << "<a href='?src=\ref[M];follow=\ref[user]'>(F)</a> [my_message]"

log_say("[user.real_name]/[user.key] : [message]")

/mob/living/proc/cult_help()
set category = "Cultist"
set name = "How to Play Cult"
var/text = ""
text += "<center><font color='red' size=3><b><i>Tenets of the Dark One</i></b></font></center><br><br><br>"

text += "<font color='red'><b>I. SECRECY</b></font><br>Your cult is a SECRET organization. Your success DEPENDS on keeping your cult's members and locations SECRET for as long as possible. This means that your tome should be hidden \
in your bag and never brought out in public. You should never create runes where other crew might find them, and you should avoid using talismans or other cult magic with witnesses around.<br><br>"

text += "<font color='red'><b>II. TOME</b></font><br>You start with a unique talisman in your bag. This supply talisman can be used 3 times, and creates starter equipment for your cult. The most critical of the talisman's functions is \
the power to create a tome. This tome is your most important item and summoning one (in secret) is your FIRST PRIORITY. It lets you talk to fellow cultists and create runes, which in turn is essential to growing the cult's power.<br><br>"

text += "<font color='red'><b>III. RUNES</b></font><br>Runes are powerful sources of cult magic. Your tome will allow you to draw runes with your blood. Those runes, when hit with an empty hand, will attempt to \
trigger the rune's magic. Runes are essential for the cult to convert new members, create powerful minions, or call upon incredibly powerful magic. Some runes require more than one cultist to use.<br><br>"

text += "<font color='red'><b>IV. TALISMANS</b></font><br>Talismans are a mobile source of cult magic that are NECESSARY to achieve success as a cult. Your starting talisman can produce certain talismans, but you will need \
to use the -create talisman- rune (with ordinary paper on top) to get more talismans. Talismans are EXTREMELY powerful, therefore creating more talismans in a HIDDEN location should be one of your TOP PRIORITIES.<br><br>"

text += "<font color='red'><b>V. GROW THE CULT</b></font><br>There are certain basic strategies that all cultists should master. STUN talismans are the foundation of a successful cult. If you intend to convert the stunned person \
you should use cuffs or a talisman of shackling on them and remove their headset before they recover (it takes about 10 seconds to recover). If you intend to sacrifice the victim, striking them quickly and repeatedly with your tome \
will knock them out before they can recover. Sacrificed victims will their soul behind in a shard, these shards can be used on construct shells to make powerful servants for the cult. Remember you need TWO cultists standing near a \
conversion rune to convert someone. Your construct minions cannot trigger most runes, but they will count as cultists in helping you trigger more powerful runes like conversion or blood boil.<br><br>"

text += "<font color='red'><b>VI. VICTORY</b></font><br>You have two ultimate goals as a cultist, sacrifice your target, and summon Nar-Sie. Sacrificing the target involves killing that individual and then placing \
their corpse on a sacrifice rune and triggering that rune with THREE cultists. Do NOT lose the target's corpse! Only once the target is sacrificed can Nar-Sie be summoned. Summoning Nar-Sie will take nearly one minute \
just to draw the massive rune needed. Do not create the rune until your cult is ready, the crew will receive the NAME and LOCATION of anyone who attempts to create the Nar-Sie rune. Once the Nar-Sie rune is drawn \
you must gathered 9 cultists (or constructs) over the rune and then click it to bring the Dark One into this world!<br><br>"

var/datum/browser/popup = new(usr, "mind", "", 800, 600)
popup.set_content(text)
popup.open()
return 1
86 changes: 4 additions & 82 deletions code/game/gamemodes/cult/ritual.dm
Original file line number Diff line number Diff line change
@@ -1,84 +1,9 @@
/*
This file contains the arcane tome files as well as innate cultist emergency communications.
This file contains the arcane tome files.
*/

/mob/proc/cult_add_comm() //why the fuck does this have its own proc? not removing it because it might be used somewhere but...
verbs += /mob/living/proc/cult_help
verbs += /mob/living/proc/cult_innate_comm


/mob/living/proc/cult_help()
set category = "Cultist"
set name = "How to Play Cult"
var/text = ""
text += "<center><font color='red' size=3><b><i>Tenets of the Dark One</i></b></font></center><br><br><br>"

text += "<font color='red'><b>I. SECRECY</b></font><br>Your cult is a SECRET organization. Your success DEPENDS on keeping your cult's members and locations SECRET for as long as possible. This means that your tome should be hidden \
in your bag and never brought out in public. You should never create runes where other crew might find them, and you should avoid using talismans or other cult magic with witnesses around.<br><br>"

text += "<font color='red'><b>II. TOME</b></font><br>You start with a unique talisman in your bag. This supply talisman can be used 3 times, and creates starter equipment for your cult. The most critical of the talisman's functions is \
the power to create a tome. This tome is your most important item and summoning one (in secret) is your FIRST PRIORITY. It lets you talk to fellow cultists and create runes, which in turn is essential to growing the cult's power.<br><br>"

text += "<font color='red'><b>III. RUNES</b></font><br>Runes are powerful sources of cult magic. Your tome will allow you to draw runes with your blood. Those runes, when hit with an empty hand, will attempt to \
trigger the rune's magic. Runes are essential for the cult to convert new members, create powerful minions, or call upon incredibly powerful magic. Some runes require more than one cultist to use.<br><br>"

text += "<font color='red'><b>IV. TALISMANS</b></font><br>Talismans are a mobile source of cult magic that are NECESSARY to achieve success as a cult. Your starting talisman can produce certain talismans, but you will need \
to use the -create talisman- rune (with ordinary paper on top) to get more talismans. Talismans are EXTREMELY powerful, therefore creating more talismans in a HIDDEN location should be one of your TOP PRIORITIES.<br><br>"

text += "<font color='red'><b>V. GROW THE CULT</b></font><br>There are certain basic strategies that all cultists should master. STUN talismans are the foundation of a successful cult. If you intend to convert the stunned person \
you should use cuffs or a talisman of shackling on them and remove their headset before they recover (it takes about 10 seconds to recover). If you intend to sacrifice the victim, striking them quickly and repeatedly with your tome \
will knock them out before they can recover. Sacrificed victims will their soul behind in a shard, these shards can be used on construct shells to make powerful servants for the cult. Remember you need TWO cultists standing near a \
conversion rune to convert someone. Your construct minions cannot trigger most runes, but they will count as cultists in helping you trigger more powerful runes like conversion or blood boil.<br><br>"

text += "<font color='red'><b>VI. VICTORY</b></font><br>You have two ultimate goals as a cultist, sacrifice your target, and summon Nar-Sie. Sacrificing the target involves killing that individual and then placing \
their corpse on a sacrifice rune and triggering that rune with THREE cultists. Do NOT lose the target's corpse! Only once the target is sacrificed can Nar-Sie be summoned. Summoning Nar-Sie will take nearly one minute \
just to draw the massive rune needed. Do not create the rune until your cult is ready, the crew will receive the NAME and LOCATION of anyone who attempts to create the Nar-Sie rune. Once the Nar-Sie rune is drawn \
you must gathered 9 cultists (or constructs) over the rune and then click it to bring the Dark One into this world!<br><br>"

var/datum/browser/popup = new(usr, "mind", "", 800, 600)
popup.set_content(text)
popup.open()
return 1

/mob/living/proc/cult_innate_comm()
set category = "Cultist"
set name = "Emergency Communion"

if(!iscultist(usr) || usr.incapacitated())
return
if(!istype(usr, /mob/living/simple_animal))
var/confirm_desperation = alert(usr, "This is a LAST RESORT; you should use a tome to communicate if possible. This ritual will inflict serious injury on you!", "Is this what you want?", "Yes", "No")
if(confirm_desperation == "No")
usr << "On second thought, maybe I should summon a tome."
return
var/input = stripped_input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")
if(!input)
return

if(!iscultist(usr) || usr.incapacitated())
return //we do this again because input() sleeps

if(ishuman(usr) || ismonkey(usr)) //Damage only applies to humans and monkeys, to allow constructs to communicate
usr.visible_message("<span class='warning'>[usr] starts clawing at \his arms with \his fingernails!</span>", "<span class='cultitalic'>You begin slicing open your arms with your fingernails!</span>")
apply_damage(10,BRUTE, "l_arm")
apply_damage(10,BRUTE, "r_arm")
sleep(50)
if(usr.incapacitated())
return //Hard to drawn intrinsic symbols when you're bleeding out in your cell.
var/turf/location = loc
if(istype(location, /turf)) // tearing your arms apart is going to spill a bit of blood, in fact thats the idea
location.add_blood(usr) // TO-DO change this to a badly drawn rune
apply_damage(10,BRUTE, "l_arm") // does a metric fuck ton of damage because this meant to be an emergency method of communication.
apply_damage(10,BRUTE, "r_arm")
if(usr.incapacitated())
return
usr.visible_message("<span class='warning'>[usr] paints strange symbols with their own blood.</span>", "<span class='cultitalic'>You paint a messy rune with your own blood.</span>")
sleep(20)

cultist_commune(usr, 0, 1, input)
return

/obj/item/weapon/tome
name = "arcane tome"
Expand Down Expand Up @@ -123,17 +48,14 @@ This file contains the arcane tome files as well as innate cultist emergency com
open_tome(user)

/obj/item/weapon/tome/proc/open_tome(mob/user)
var/choice = alert(user,"You open the tome...",,"Commune","Scribe Rune","More Information")
var/choice = alert(user,"You open the tome...",,"Scribe Rune","More Information","Cancel")
switch(choice)
if("More Information")
read_tome(user)
if("Scribe Rune")
scribe_rune(user)
if("Commune")
var/input = stripped_input(usr, "Please enter a message to tell to the other acolytes.", "Voice of Blood", "")
if(!input)
return
cultist_commune(user, 1, 0, input)
if("Cancel")
return

/obj/item/weapon/tome/proc/read_tome(mob/user)
var/text = ""
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ var/list/teleport_runes = list()
..()
new_cultist.visible_message("<span class='warning'>[new_cultist] writhes in pain as the markings below them glow a bloody red!</span>", \
"<span class='cultlarge'><i>AAAAAAAAAAAAAA-</i></span>")
ticker.mode.add_cultist(new_cultist.mind)
ticker.mode.add_cultist(new_cultist.mind, 1)
new /obj/item/weapon/tome(get_turf(src))
new_cultist.mind.special_role = "Cultist"
new_cultist << "<span class='cultitalic'><b>Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible, truth. The veil of reality has been ripped away \
Expand Down Expand Up @@ -840,7 +840,7 @@ var/list/teleport_runes = list()
N.health = 20
N.mouse_opacity = 0
new_human.key = ghost_to_spawn.key
ticker.mode.add_cultist(new_human.mind)
ticker.mode.add_cultist(new_human.mind, 0)
new_human << "<span class='cultitalic'><b>You are a servant of the Geometer. You have been made semi-corporeal by the cult of Nar-Sie, and you are to serve them at all costs.</b></span>"

while(user in get_turf(src))
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@
M.key = theghost.key

/datum/game_mode/proc/remove_antag_for_borging(datum/mind/newborgie)
ticker.mode.remove_cultist(newborgie, 0)
ticker.mode.remove_cultist(newborgie, 0, 0)
ticker.mode.remove_revolutionary(newborgie, 0)
ticker.mode.remove_gangster(newborgie, 0, remove_bosses=1)
ticker.mode.remove_hog_follower(newborgie, 0)
4 changes: 2 additions & 2 deletions code/game/gamemodes/wizard/soulstone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
if(newstruct.mind)
if(stoner && iscultist(stoner) || cultoverride)
if(ticker.mode.name == "cult")
ticker.mode:add_cultist(newstruct.mind)
ticker.mode:add_cultist(newstruct.mind, 0)
else
ticker.mode.cult += newstruct.mind
ticker.mode.update_cult_icons_added(newstruct.mind)
Expand Down Expand Up @@ -213,7 +213,7 @@
if(U)
S.faction |= "\ref[U]" //Add the master as a faction, allowing inter-mob cooperation
if(U && iscultist(U))
ticker.mode.add_cultist(S.mind,2)
ticker.mode.add_cultist(S.mind, 0)
S.cancel_camera()
name = "soulstone: Shade of [T.real_name]"
icon_state = "soulstone2"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/login.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/mob/living/silicon/Login()
if(mind && ticker && ticker.mode)
ticker.mode.remove_cultist(mind, 0)
ticker.mode.remove_cultist(mind, 0, 0)
ticker.mode.remove_revolutionary(mind, 0)
ticker.mode.remove_gangster(mind, remove_bosses=1)
ticker.mode.remove_thrall(mind,0)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
M.confused = 1
M.confused += 3
if(iscultist(M) || (is_handofgod_cultist(M) && !is_handofgod_prophet(M)))
ticker.mode.remove_cultist(M.mind)
ticker.mode.remove_cultist(M.mind, 1, 1)
ticker.mode.remove_hog_follower(M.mind)
holder.remove_reagent(src.id, src.volume) // maybe this is a little too perfect and a max() cap on the statuses would be better??
M.jitteriness = 0
Expand Down
Binary file modified icons/mob/actions.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
#include "code\game\gamemodes\changeling\powers\tiny_prick.dm"
#include "code\game\gamemodes\changeling\powers\transform.dm"
#include "code\game\gamemodes\cult\cult.dm"
#include "code\game\gamemodes\cult\cult_comms.dm"
#include "code\game\gamemodes\cult\cult_items.dm"
#include "code\game\gamemodes\cult\cult_structures.dm"
#include "code\game\gamemodes\cult\ritual.dm"
Expand Down

0 comments on commit 0897f3b

Please sign in to comment.