unfucks ratvar conversion

This commit is contained in:
Joan Lung
2016-06-08 15:50:06 -04:00
parent 33b9d7c8c2
commit 4f8133c3d1
5 changed files with 54 additions and 27 deletions

View File

@@ -1043,12 +1043,12 @@
else if(href_list["clockcult"]) else if(href_list["clockcult"])
switch(href_list["clockcult"]) switch(href_list["clockcult"])
if("clear") if("clear")
remove_servant_of_ratvar(current) remove_servant_of_ratvar(current, TRUE)
message_admins("[key_name_admin(usr)] has removed clockwork servant status from [current].") message_admins("[key_name_admin(usr)] has removed clockwork servant status from [current].")
log_admin("[key_name(usr)] has removed clockwork servant status from [current].") log_admin("[key_name(usr)] has removed clockwork servant status from [current].")
if("servant") if("servant")
if(!(src in ticker.mode.servants_of_ratvar)) if(!is_servant_of_ratvar(current))
add_servant_of_ratvar(current) add_servant_of_ratvar(current, TRUE)
message_admins("[key_name_admin(usr)] has made [current] into a servant of Ratvar.") message_admins("[key_name_admin(usr)] has made [current] into a servant of Ratvar.")
log_admin("[key_name(usr)] has made [current] into a servant of Ratvar.") log_admin("[key_name(usr)] has made [current] into a servant of Ratvar.")
if("slab") if("slab")

View File

@@ -36,11 +36,29 @@ This file's folder contains:
// PROCS // // PROCS //
/////////// ///////////
/proc/is_servant_of_ratvar(mob/M) /proc/is_servant_of_ratvar(mob/living/M)
return M && istype(M) && M.mind && ticker && ticker.mode && (M.mind in ticker.mode.servants_of_ratvar) return M && istype(M) && M.mind && ticker && ticker.mode && (M.mind in ticker.mode.servants_of_ratvar)
/proc/is_eligible_servant(mob/M) /proc/is_eligible_servant(mob/living/M)
return M && istype(M) && M.mind && !iscultist(M) && !isconstruct(M) && !isloyal(M) if(!istype(M))
return 0
if(!M.mind)
return 0
if(ishuman(M) && (M.mind.assigned_role in list("Captain", "Chaplain")))
return 0
if(iscultist(M))
return 0
if(isconstruct(M))
return 0
if(isguardian(M))
var/mob/living/simple_animal/hostile/guardian/G = M
if(!is_servant_of_ratvar(G.summoner))
return 0 //can't convert it unless the owner is converted
if(isloyal(M))
return 0
if(M.mind.enslaved_to)
return 0
return 1
/proc/add_servant_of_ratvar(mob/M, silent = FALSE) /proc/add_servant_of_ratvar(mob/M, silent = FALSE)
if(is_servant_of_ratvar(M) || !ticker || !ticker.mode) if(is_servant_of_ratvar(M) || !ticker || !ticker.mode)
@@ -49,23 +67,24 @@ This file's folder contains:
if(!silent) if(!silent)
M << "<span class='heavy_brass'>Your mind is racing! Your body feels incredibly light! Your world glows a brilliant yellow! All at once it comes to you. Ratvar, the Clockwork \ M << "<span class='heavy_brass'>Your mind is racing! Your body feels incredibly light! Your world glows a brilliant yellow! All at once it comes to you. Ratvar, the Clockwork \
Justiciar, lies in exile, derelict and forgotten in an unseen realm.</span>" Justiciar, lies in exile, derelict and forgotten in an unseen realm.</span>"
if(!is_eligible_servant(M))
M.visible_message("<span class='warning'>[M] seems to resist an unseen force!</span>", "<span class='warning'><b>And yet, you somehow push it all away.</b></span>")
return 0
else if(issilicon(M)) else if(issilicon(M))
if(!silent) if(!silent)
M << "<span class='heavy_brass'>You are unable to compute this truth. Your vision glows a brilliant yellow, and all at once it comes to you. Ratvar, the Clockwork Justiciar, lies in \ M << "<span class='heavy_brass'>You are unable to compute this truth. Your vision glows a brilliant yellow, and all at once it comes to you. Ratvar, the Clockwork Justiciar, lies in \
exile, derelict and forgotten in an unseen realm.</span>" exile, derelict and forgotten in an unseen realm.</span>"
if(!is_eligible_servant(M)) if(!is_eligible_servant(M))
M.visible_message("<span class='warning'>[M] whirs as it resists an outside influence!</span>", \ if(!M.stat)
"<span class='warning'><b>Corrupt data purged. Resetting cortex chip to factory defaults... complete.</b></span>") M.visible_message("<span class='warning'>[M] whirs as it resists an outside influence!</span>")
M << "<span class='warning'><b>Corrupt data purged. Resetting cortex chip to factory defaults... complete.</b></span>" //silicons have a custom fail message
return 0 return 0
else else if(!silent)
if(!silent)
M << "<span class='heavy_brass'>Your world glows a brilliant yellow! All at once it comes to you. Ratvar, the Clockwork Justiciar, lies in exile, derelict and forgotten in an unseen realm.</span>" M << "<span class='heavy_brass'>Your world glows a brilliant yellow! All at once it comes to you. Ratvar, the Clockwork Justiciar, lies in exile, derelict and forgotten in an unseen realm.</span>"
if(!is_eligible_servant(M)) if(!is_eligible_servant(M))
M.visible_message("<span class='warning'>[M] seems to resist an unseen force!</span>", "<span class='warning'><b>And yet, you somehow push it all away.</b></span>") if(!silent && !M.stat)
M.visible_message("<span class='warning'>[M] seems to resist an unseen force!</span>")
M << "<span class='warning'><b>And yet, you somehow push it all away.</b></span>"
return 0 return 0
if(!silent) if(!silent)
M.visible_message("<span class='heavy_brass'>[M]'s eyes glow a blazing yellow!</span>", \ M.visible_message("<span class='heavy_brass'>[M]'s eyes glow a blazing yellow!</span>", \
"<span class='heavy_brass'>Assist your new companions in their righteous efforts. Your goal is theirs, and theirs yours. You serve the Clockwork Justiciar above all else. Perform his every \ "<span class='heavy_brass'>Assist your new companions in their righteous efforts. Your goal is theirs, and theirs yours. You serve the Clockwork Justiciar above all else. Perform his every \
@@ -82,6 +101,7 @@ This file's folder contains:
R.emagged = 1 R.emagged = 1
R << "<span class='warning'><b>You have been desynced from your master AI. In addition, your onboard camera is no longer active and your safeties have been disabled.</b></span>" R << "<span class='warning'><b>You have been desynced from your master AI. In addition, your onboard camera is no longer active and your safeties have been disabled.</b></span>"
S.laws = new/datum/ai_laws/ratvar S.laws = new/datum/ai_laws/ratvar
S.laws.associate(S)
S.update_icons() S.update_icons()
S.show_laws() S.show_laws()
if(istype(ticker.mode, /datum/game_mode/clockwork_cult)) if(istype(ticker.mode, /datum/game_mode/clockwork_cult))
@@ -89,9 +109,10 @@ This file's folder contains:
C.present_tasks(M) //Memorize the objectives C.present_tasks(M) //Memorize the objectives
return 1 return 1
/proc/remove_servant_of_ratvar(mob/M) /proc/remove_servant_of_ratvar(mob/living/M, silent = FALSE)
if(!is_servant_of_ratvar(M)) //In this way, is_servant_of_ratvar() checks the existence of ticker and minds if(!is_servant_of_ratvar(M)) //In this way, is_servant_of_ratvar() checks the existence of ticker and minds
return 0 return 0
if(!silent)
M.visible_message("<span class='big'>[M] seems to have remembered their true allegiance!</span>", \ M.visible_message("<span class='big'>[M] seems to have remembered their true allegiance!</span>", \
"<span class='userdanger'>A cold, cold darkness flows through your mind, extinguishing the Justiciar's light and all of your memories as his servant.</span>") "<span class='userdanger'>A cold, cold darkness flows through your mind, extinguishing the Justiciar's light and all of your memories as his servant.</span>")
ticker.mode.servants_of_ratvar -= M.mind ticker.mode.servants_of_ratvar -= M.mind
@@ -106,7 +127,7 @@ This file's folder contains:
var/mob/living/silicon/robot/R = S var/mob/living/silicon/robot/R = S
R.emagged = initial(R.emagged) R.emagged = initial(R.emagged)
R << "<span class='warning'>Despite your freedom from Ratvar's influence, you are still irreparably damaged and no longer possess certain functions such as AI linking.</span>" R << "<span class='warning'>Despite your freedom from Ratvar's influence, you are still irreparably damaged and no longer possess certain functions such as AI linking.</span>"
S.laws = initial(S.laws) S.make_laws()
S.update_icons() S.update_icons()
S.show_laws() S.show_laws()
return 1 return 1
@@ -143,6 +164,8 @@ This file's folder contains:
recommended_enemies = 4 recommended_enemies = 4
enemy_minimum_age = 14 enemy_minimum_age = 14
protected_jobs = list("AI", "Cyborg", "Security Officer", "Warden", "Detective", "Head of Security", "Captain") //Silicons can eventually be converted protected_jobs = list("AI", "Cyborg", "Security Officer", "Warden", "Detective", "Head of Security", "Captain") //Silicons can eventually be converted
restricted_jobs = list("Chaplain", "Captain")
var/servants_to_serve = list()
/datum/game_mode/clockwork_cult/announce() /datum/game_mode/clockwork_cult/announce()
world << "<b>The game mode is: Clockwork Cult!</b>" world << "<b>The game mode is: Clockwork Cult!</b>"
@@ -158,7 +181,7 @@ This file's folder contains:
var/starter_servants = max(1, round(num_players() / 10)) //Guaranteed one cultist - otherwise, about one cultist for every ten players var/starter_servants = max(1, round(num_players() / 10)) //Guaranteed one cultist - otherwise, about one cultist for every ten players
while(starter_servants) while(starter_servants)
var/datum/mind/servant = pick(antag_candidates) var/datum/mind/servant = pick(antag_candidates)
servants_of_ratvar += servant servants_to_serve += servant
antag_candidates -= servant antag_candidates -= servant
modePlayer += servant modePlayer += servant
servant.special_role = "Servant of Ratvar" servant.special_role = "Servant of Ratvar"
@@ -169,13 +192,13 @@ This file's folder contains:
/datum/game_mode/clockwork_cult/post_setup() /datum/game_mode/clockwork_cult/post_setup()
forge_clock_objectives() forge_clock_objectives()
for(var/S in servants_of_ratvar) for(var/S in servants_to_serve)
var/datum/mind/servant = S var/datum/mind/servant = S
log_game("[servant.key] was made an initial servant of Ratvar") log_game("[servant.key] was made an initial servant of Ratvar")
var/mob/living/L = servant.current var/mob/living/L = servant.current
greet_servant(L) greet_servant(L)
equip_servant(L) equip_servant(L)
present_tasks(L) add_servant_of_ratvar(L)
..() ..()
return 1 return 1

View File

@@ -536,3 +536,4 @@
ticker.mode.remove_revolutionary(newborgie, 0) ticker.mode.remove_revolutionary(newborgie, 0)
ticker.mode.remove_gangster(newborgie, 0, remove_bosses=1) ticker.mode.remove_gangster(newborgie, 0, remove_bosses=1)
ticker.mode.remove_hog_follower(newborgie, 0) ticker.mode.remove_hog_follower(newborgie, 0)
remove_servant_of_ratvar(newborgie, TRUE)

View File

@@ -219,12 +219,15 @@
if(M.hacked || M.clockwork) if(M.hacked || M.clockwork)
aisync = 0 aisync = 0
lawsync = 0 lawsync = 0
var/datum/ai_laws/L
if(M.clockwork) if(M.clockwork)
O.laws = new/datum/ai_laws/ratvar L = new/datum/ai_laws/ratvar
spawn(1) spawn(1)
add_servant_of_ratvar(O) add_servant_of_ratvar(O)
else else
O.laws = new/datum/ai_laws/syndicate_override L = new/datum/ai_laws/syndicate_override
O.laws = L
L.associate(O)
O.invisibility = 0 O.invisibility = 0
//Transfer debug settings to new mob //Transfer debug settings to new mob

View File

@@ -144,7 +144,7 @@
user << "<span class='warning'>This MMI does not seem to fit!</span>" user << "<span class='warning'>This MMI does not seem to fit!</span>"
return return
if(M.hacked) if(M.hacked || M.clockwork)
user << "<span class='warning'>This MMI does not seem to fit!</span>" user << "<span class='warning'>This MMI does not seem to fit!</span>"
return return