From 4f8133c3d13c71f7bdd7deaff2defe98c4f4144d Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Wed, 8 Jun 2016 15:50:06 -0400 Subject: [PATCH 1/8] unfucks ratvar conversion --- code/datums/mind.dm | 6 +- code/game/gamemodes/clock_cult/clock_cult.dm | 65 +++++++++++++------- code/game/gamemodes/game_mode.dm | 1 + code/game/objects/items/robot/robot_parts.dm | 7 ++- code/game/objects/structures/ai_core.dm | 2 +- 5 files changed, 54 insertions(+), 27 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index b17189be12182..a57bb20ea69fa 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1043,12 +1043,12 @@ else if(href_list["clockcult"]) switch(href_list["clockcult"]) 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].") log_admin("[key_name(usr)] has removed clockwork servant status from [current].") if("servant") - if(!(src in ticker.mode.servants_of_ratvar)) - add_servant_of_ratvar(current) + if(!is_servant_of_ratvar(current)) + add_servant_of_ratvar(current, TRUE) 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.") if("slab") diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index 86340e1dfbbb6..0507d26ce79d1 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -36,11 +36,29 @@ This file's folder contains: // 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) -/proc/is_eligible_servant(mob/M) - return M && istype(M) && M.mind && !iscultist(M) && !isconstruct(M) && !isloyal(M) +/proc/is_eligible_servant(mob/living/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) if(is_servant_of_ratvar(M) || !ticker || !ticker.mode) @@ -49,23 +67,24 @@ This file's folder contains: if(!silent) M << "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." - if(!is_eligible_servant(M)) - M.visible_message("[M] seems to resist an unseen force!", "And yet, you somehow push it all away.") - return 0 else if(issilicon(M)) if(!silent) M << "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." if(!is_eligible_servant(M)) - M.visible_message("[M] whirs as it resists an outside influence!", \ - "Corrupt data purged. Resetting cortex chip to factory defaults... complete.") - return 0 - else - if(!silent) - M << "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." - if(!is_eligible_servant(M)) - M.visible_message("[M] seems to resist an unseen force!", "And yet, you somehow push it all away.") + if(!M.stat) + M.visible_message("[M] whirs as it resists an outside influence!") + M << "Corrupt data purged. Resetting cortex chip to factory defaults... complete." //silicons have a custom fail message return 0 + else if(!silent) + M << "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." + + if(!is_eligible_servant(M)) + if(!silent && !M.stat) + M.visible_message("[M] seems to resist an unseen force!") + M << "And yet, you somehow push it all away." + return 0 + if(!silent) M.visible_message("[M]'s eyes glow a blazing yellow!", \ "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 << "You have been desynced from your master AI. In addition, your onboard camera is no longer active and your safeties have been disabled." S.laws = new/datum/ai_laws/ratvar + S.laws.associate(S) S.update_icons() S.show_laws() if(istype(ticker.mode, /datum/game_mode/clockwork_cult)) @@ -89,11 +109,12 @@ This file's folder contains: C.present_tasks(M) //Memorize the objectives 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 return 0 - M.visible_message("[M] seems to have remembered their true allegiance!", \ - "A cold, cold darkness flows through your mind, extinguishing the Justiciar's light and all of your memories as his servant.") + if(!silent) + M.visible_message("[M] seems to have remembered their true allegiance!", \ + "A cold, cold darkness flows through your mind, extinguishing the Justiciar's light and all of your memories as his servant.") ticker.mode.servants_of_ratvar -= M.mind ticker.mode.update_servant_icons_removed(M.mind) all_clockwork_mobs -= M @@ -106,7 +127,7 @@ This file's folder contains: var/mob/living/silicon/robot/R = S R.emagged = initial(R.emagged) R << "Despite your freedom from Ratvar's influence, you are still irreparably damaged and no longer possess certain functions such as AI linking." - S.laws = initial(S.laws) + S.make_laws() S.update_icons() S.show_laws() return 1 @@ -143,6 +164,8 @@ This file's folder contains: recommended_enemies = 4 enemy_minimum_age = 14 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() world << "The game mode is: Clockwork Cult!" @@ -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 while(starter_servants) var/datum/mind/servant = pick(antag_candidates) - servants_of_ratvar += servant + servants_to_serve += servant antag_candidates -= servant modePlayer += servant servant.special_role = "Servant of Ratvar" @@ -169,13 +192,13 @@ This file's folder contains: /datum/game_mode/clockwork_cult/post_setup() forge_clock_objectives() - for(var/S in servants_of_ratvar) + for(var/S in servants_to_serve) var/datum/mind/servant = S log_game("[servant.key] was made an initial servant of Ratvar") var/mob/living/L = servant.current greet_servant(L) equip_servant(L) - present_tasks(L) + add_servant_of_ratvar(L) ..() return 1 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index a7c0407d0e885..bced896741e8d 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -536,3 +536,4 @@ ticker.mode.remove_revolutionary(newborgie, 0) ticker.mode.remove_gangster(newborgie, 0, remove_bosses=1) ticker.mode.remove_hog_follower(newborgie, 0) + remove_servant_of_ratvar(newborgie, TRUE) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 8b505b4fda537..50f8095051b5e 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -219,12 +219,15 @@ if(M.hacked || M.clockwork) aisync = 0 lawsync = 0 + var/datum/ai_laws/L if(M.clockwork) - O.laws = new/datum/ai_laws/ratvar + L = new/datum/ai_laws/ratvar spawn(1) add_servant_of_ratvar(O) 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 //Transfer debug settings to new mob diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index e08900cdc3024..05361b5a7df82 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -144,7 +144,7 @@ user << "This MMI does not seem to fit!" return - if(M.hacked) + if(M.hacked || M.clockwork) user << "This MMI does not seem to fit!" return From 0765173ee2133374ac9e2c05863528272cd98b95 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Wed, 8 Jun 2016 15:59:12 -0400 Subject: [PATCH 2/8] hudupdate --- code/game/gamemodes/game_mode.dm | 1 - code/game/objects/items/robot/robot_parts.dm | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index bced896741e8d..a7c0407d0e885 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -536,4 +536,3 @@ ticker.mode.remove_revolutionary(newborgie, 0) ticker.mode.remove_gangster(newborgie, 0, remove_bosses=1) ticker.mode.remove_hog_follower(newborgie, 0) - remove_servant_of_ratvar(newborgie, TRUE) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 50f8095051b5e..2e23ee7862f53 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -223,7 +223,7 @@ if(M.clockwork) L = new/datum/ai_laws/ratvar spawn(1) - add_servant_of_ratvar(O) + ticker.mode.update_servant_icons_added(O.mind) else L = new/datum/ai_laws/syndicate_override O.laws = L From 0b8503bba87c69fa6bfdaf921170ae551823e914 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Wed, 8 Jun 2016 16:01:53 -0400 Subject: [PATCH 3/8] you can't update mob-related things in pre_setup() because they DO NOT HAVE A LIVING MOB AT THAT POINT --- code/game/gamemodes/clock_cult/clock_cult.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index 0507d26ce79d1..d5ee23c63a05c 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -186,7 +186,6 @@ This file's folder contains: modePlayer += servant servant.special_role = "Servant of Ratvar" servant.restricted_roles = restricted_jobs - update_servant_icons_added(servant) starter_servants-- return 1 @@ -198,7 +197,7 @@ This file's folder contains: var/mob/living/L = servant.current greet_servant(L) equip_servant(L) - add_servant_of_ratvar(L) + add_servant_of_ratvar(L, TRUE) ..() return 1 From 16fa622e56dbb3509c4ae23a7b323e136db4773e Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Wed, 8 Jun 2016 23:18:23 -0400 Subject: [PATCH 4/8] this is all butts --- code/game/objects/items/robot/robot_parts.dm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 2e23ee7862f53..ea083b544fefe 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -209,11 +209,11 @@ user << "This MMI does not seem to fit!" return - var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc)) - if(!O) + if(!user.unEquip(W)) return - if(!user.unEquip(W)) + var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc)) + if(!O) return if(M.hacked || M.clockwork) @@ -240,9 +240,10 @@ O.notify_ai(1) if(forced_ai) O.connected_ai = forced_ai - if(!lawsync && !M.hacked) + if(!lawsync) O.lawupdate = 0 - O.make_laws() + if(!M.hacked && !M.clockwork) + O.make_laws() ticker.mode.remove_antag_for_borging(BM.mind) BM.mind.transfer_to(O) From c5ee14a0e35e10ade901a7d8a399c59aeacb57dd Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Thu, 9 Jun 2016 08:21:24 -0400 Subject: [PATCH 5/8] gotta emag the borg --- code/game/objects/items/robot/robot_parts.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index ea083b544fefe..eaefdbc7b0d8c 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -222,8 +222,6 @@ var/datum/ai_laws/L if(M.clockwork) L = new/datum/ai_laws/ratvar - spawn(1) - ticker.mode.update_servant_icons_added(O.mind) else L = new/datum/ai_laws/syndicate_override O.laws = L @@ -248,6 +246,12 @@ ticker.mode.remove_antag_for_borging(BM.mind) BM.mind.transfer_to(O) + if(clockwork) + O.emagged = 1 + O.visible_message("[M]'s eyes glow a blazing yellow!", \ + "As you serve Ratvar, your onboard camera is not active and your safeties are disabled.") + ticker.mode.update_servant_icons_added(O.mind) + if(O.mind && O.mind.special_role) O.mind.store_memory("As a cyborg, you must obey your silicon laws and master AI above all else. Your objectives will consider you to be dead.") O << "You have been robotized!" From 8d2da45e8c05171b7f45623b248cdad2a4babfd1 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Thu, 9 Jun 2016 08:39:16 -0400 Subject: [PATCH 6/8] duh --- code/game/objects/items/robot/robot_parts.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index eaefdbc7b0d8c..451d5a2f6b339 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -246,7 +246,7 @@ ticker.mode.remove_antag_for_borging(BM.mind) BM.mind.transfer_to(O) - if(clockwork) + if(M.clockwork) O.emagged = 1 O.visible_message("[M]'s eyes glow a blazing yellow!", \ "As you serve Ratvar, your onboard camera is not active and your safeties are disabled.") From a6ffdeb223b440b30e391f7b65edae7e026d94db Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Thu, 9 Jun 2016 09:30:43 -0400 Subject: [PATCH 7/8] Theme --- code/game/gamemodes/clock_cult/clock_cult.dm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index d5ee23c63a05c..6fbfc7395156b 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -50,14 +50,21 @@ This file's folder contains: 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 + if(isguardian(M)) + var/mob/living/simple_animal/hostile/guardian/G = M + G.summoner << "You feel your guardian being subverted, and try to stop it-" + if(is_eligible_servant(G.summoner)) + G.summoner << "-But you fail." + G.summoner << "Gjb-sbe-bar. Jung n qrny." + add_servant_of_ratvar(G.summoner) + return 1 + else + G.summoner << "-And manage to push back, preventing whatever that was from taking you over." + return 0 //can't convert it unless the owner got converted return 1 /proc/add_servant_of_ratvar(mob/M, silent = FALSE) From 790351b4a7e546e9520cd0bc2f6dcb23c915a7fb Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Thu, 9 Jun 2016 09:39:01 -0400 Subject: [PATCH 8/8] Revert "Theme" This reverts commit a6ffdeb223b440b30e391f7b65edae7e026d94db. --- code/game/gamemodes/clock_cult/clock_cult.dm | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index 6fbfc7395156b..d5ee23c63a05c 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -50,21 +50,14 @@ This file's folder contains: 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 - if(isguardian(M)) - var/mob/living/simple_animal/hostile/guardian/G = M - G.summoner << "You feel your guardian being subverted, and try to stop it-" - if(is_eligible_servant(G.summoner)) - G.summoner << "-But you fail." - G.summoner << "Gjb-sbe-bar. Jung n qrny." - add_servant_of_ratvar(G.summoner) - return 1 - else - G.summoner << "-And manage to push back, preventing whatever that was from taking you over." - return 0 //can't convert it unless the owner got converted return 1 /proc/add_servant_of_ratvar(mob/M, silent = FALSE)