Just deleted about 400 bot accounts and a bunch of spam. To mitigate this in the future, we've enabled reCaptcha on signup. Let me know if someone got caught in the crossfire.

Commit f5f8644a authored by JustSumBody's avatar JustSumBody Committed by Intigracy
Browse files

Converts Malfunctioning AI modules from verbs to spells (#12218)

* Look at you hacker

* a pathetic creature of etc

* Three left

* meme

* law 2

* Forgot some trailing returns

* removes the debug thing and error

* Apparently changing ranges when range is irrelevant breaks things

* it's ez2b

* a clever smart boy like me

* It is a mystery
parent 399b3966
......@@ -63,6 +63,8 @@
RestrainedClickOn(A)
else
*/
if(INVOKE_EVENT(on_uattack,list("atom"=A))) //This returns 1 when doing an action intercept
return
A.add_hiddenprint(src)
A.attack_ai(src)
......
......@@ -159,6 +159,15 @@
screen_loc = ui_alien_master
length = 9
/obj/screen/movable/spell_master/malf
name = "Malfunction Modules"
icon_state = "grey_spell_ready"
open_state = "malf_open"
closed_state = "malf_closed"
screen_loc = ui_alien_master
//////////////ACTUAL SPELLS//////////////
//This is what you click to cast things//
......
......@@ -966,16 +966,8 @@
special_role = null
var/mob/living/silicon/ai/A = current
A.verbs.Remove(/mob/living/silicon/ai/proc/choose_modules,
/datum/game_mode/malfunction/proc/takeover,
/datum/game_mode/malfunction/proc/ai_win)
A.malf_picker.remove_verbs(A)
A.laws = new base_law_type
qdel(A.malf_picker)
A.malf_picker = null
A.remove_malf_spells()
A.show_laws()
A.icon_state = "ai"
......@@ -1174,9 +1166,8 @@ proc/clear_memory(var/silent = 1)
if(!(src in ticker.mode.malf_ai))
ticker.mode.malf_ai += src
var/mob/living/silicon/ai/A = current
A.verbs += /mob/living/silicon/ai/proc/choose_modules
A.verbs += /datum/game_mode/malfunction/proc/takeover
A.malf_picker = new /datum/module_picker
A.add_spell(new /spell/aoe_turf/module_picker, "grey_spell_ready",/obj/screen/movable/spell_master/malf)
A.add_spell(new /spell/aoe_turf/takeover, "grey_spell_ready",/obj/screen/movable/spell_master/malf)
var/datum/ai_laws/laws = A.laws
laws.malfunction()
A.show_laws()
......
......@@ -284,16 +284,9 @@
M.special_role = null
var/mob/living/silicon/ai/A = M.current
A.verbs.Remove(/mob/living/silicon/ai/proc/choose_modules,
/datum/game_mode/malfunction/proc/takeover,
/datum/game_mode/malfunction/proc/ai_win)
A.malf_picker.remove_verbs(A)
A.remove_malf_spells()
A.laws = new base_law_type
qdel(A.malf_picker)
A.malf_picker = null
A.show_laws()
A.icon_state = "ai"
......
......@@ -60,21 +60,18 @@ Rebooting world in 5 seconds."})
sleep(50)
world.Reboot()
return
AI_mind.current.verbs += /mob/living/silicon/ai/proc/choose_modules
AI_mind.current.add_spell(new /spell/aoe_turf/module_picker)
AI_mind.current.add_spell(new /spell/aoe_turf/takeover)
//AI_mind.current:laws = new /datum/ai_laws/malfunction
AI_mind.current:laws_sanity_check()
var/datum/ai_laws/laws = AI_mind.current:laws
laws.malfunction()
AI_mind.current:malf_picker = new /datum/module_picker
AI_mind.current:show_laws()
greet_malf(AI_mind)
AI_mind.special_role = "malfunction"
AI_mind.current.verbs += /datum/game_mode/malfunction/proc/takeover
AI_mind.current.verbs += /datum/game_mode/malfunction/proc/ai_win // Fix borrowed from Bay, with added checks avoids "logging in and back out" garbage
/* AI_mind.current.icon_state = "ai-malf"
spawn(10)
if(alert(AI_mind.current,"Do you want to use an alternative sprite for your real core?",,"Yes","No")=="Yes")
......@@ -131,8 +128,8 @@ Once done, you will be able to interface with all systems, notably the onboard n
for(var/datum/mind/AI_mind in malf_ai)
to_chat(AI_mind.current, {"<span class='notice'>Congratulations! The station is now under your exclusive control.<br>
You may decide to blow up the station. You have 60 seconds to choose.<br>
You should now be able to use your Explode verb to interface with the nuclear fission device.</span>"})
AI_mind.current.verbs += /datum/game_mode/malfunction/proc/ai_win
You should now be able to use your Explode spell to interface with the nuclear fission device.</span>"})
AI_mind.current.add_spell(new /spell/aoe_turf/ai_win, "grey_spell_ready",/obj/screen/movable/spell_master/malf)
spawn (600)
to_nuke_or_not_to_nuke = 0
return
......@@ -166,53 +163,73 @@ You should now be able to use your Explode verb to interface with the nuclear fi
return
/datum/game_mode/malfunction/proc/takeover()
set category = "Malfunction"
set name = "System Override"
set desc = "Start the victory timer"
/spell/aoe_turf/takeover
name = "System Override"
panel = MALFUNCTION
desc = "Start the victory timer"
charge_type = Sp_CHARGES
charge_max = 1
hud_state = "systemtakeover"
override_base = "grey"
/spell/aoe_turf/takeover/before_target(mob/user)
if (!istype(ticker.mode,/datum/game_mode/malfunction))
to_chat(usr, "<span class='warning'>You cannot begin a takeover in this round type!</span>")
return
return 1
if (ticker.mode:malf_mode_declared)
to_chat(usr, "<span class='warning'>You've already begun your takeover.</span>")
return
return 1
if (ticker.mode:apcs < 3)
to_chat(usr, "<span class='notice'>You don't have enough hacked APCs to take over the station yet. You need to hack at least 3, however hacking more will make the takeover faster. You have hacked [ticker.mode:apcs] APCs so far.</span>")
return
return 1
if (alert(usr, "Are you sure you wish to initiate the takeover? The station hostile runtime detection software is bound to alert everyone. You have hacked [ticker.mode:apcs] APCs.", "Takeover:", "Yes", "No") != "Yes")
return
return 1
/spell/aoe_turf/takeover/cast(var/list/targets, mob/user)
command_alert(/datum/command_alert/malf_announce)
set_security_level("delta")
ticker.mode:malf_mode_declared = 1
for(var/datum/mind/AI_mind in ticker.mode:malf_ai)
AI_mind.current.verbs -= /datum/game_mode/malfunction/proc/takeover
/datum/game_mode/malfunction/proc/ai_win()
set category = "Malfunction"
set name = "Explode"
set desc = "Station goes boom"
for(var/spell/S in AI_mind.current.spell_list)
if(istype(S,type))
AI_mind.current.remove_spell(S)
/spell/aoe_turf/ai_win
name = "Explode"
panel = MALFUNCTION
desc = "Station goes boom"
charge_type = Sp_CHARGES
charge_max = 1
hud_state = "radiation"
override_base = "grey"
/spell/aoe_turf/ai_win/before_target(mob/user)
if(!ticker.mode:station_captured)
to_chat(usr, "<span class='warning'>You are unable to access the self-destruct system as you don't control the station yet.</span>")
return
return 1
if(ticker.mode:explosion_in_progress || ticker.mode:station_was_nuked)
to_chat(usr, "<span class='notice'>The self-destruct countdown was already triggered!</span>")
return
return 1
if(!ticker.mode:to_nuke_or_not_to_nuke) //Takeover IS completed, but 60s timer passed.
to_chat(usr, "<span class='warning'>Cannot interface, it seems a neutralization signal was sent!</span>")
return
return 1
/spell/aoe_turf/ai_win/cast(var/list/targets, mob/user)
if(istype(ticker.mode, /datum/game_mode/malfunction))
var/datum/game_mode/malfunction/G = ticker.mode
G.ai_win()
/datum/game_mode/malfunction/proc/ai_win()
to_chat(usr, "<span class='danger'>Detonation signal sent!</span>")
ticker.mode:to_nuke_or_not_to_nuke = 0
for(var/datum/mind/AI_mind in ticker.mode:malf_ai)
AI_mind.current.verbs -= /datum/game_mode/malfunction/proc/ai_win
for(var/spell/S in AI_mind.current.spell_list)
if(istype(S,/spell/aoe_turf/ai_win))
AI_mind.current.remove_spell(S)
ticker.mode:explosion_in_progress = 1
for(var/mob/M in player_list)
if(M.client)
......
......@@ -605,7 +605,10 @@ Class Procs:
if(!P.hackloop(src))
return 0
return 1
/obj/machinery/proc/can_overload(mob/user) //used for AI machine overload
return(src in machines)
/obj/machinery/proc/shock(mob/user, prb, var/siemenspassed = -1)
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
return 0
......
......@@ -90,10 +90,6 @@
return ..()
return ..()
/turf/Click()
if(!isAI(usr))
..()
/turf/ex_act(severity)
return 0
......
......@@ -40,9 +40,6 @@ var/list/ai_list = list()
//Hud stuff
//MALFUNCTION
var/datum/module_picker/malf_picker
var/processing_time = 100
var/list/datum/AI_Module/current_modules = list()
var/ai_flags = 0
var/control_disabled = 0 // Set to 1 to stop AI from interacting via Click() -- TLE
......@@ -301,7 +298,11 @@ var/list/ai_list = list()
if (malf.apcs >= 3)
stat(null, "Time until station control secured: [max(malf.AI_win_timeleft/(malf.apcs/3), 0)] seconds")
/mob/proc/remove_malf_spells()
for(var/spell/S in spell_list)
if(S.panel == MALFUNCTION)
remove_spell(S)
/mob/living/silicon/ai/proc/ai_alerts()
......@@ -706,13 +707,6 @@ var/list/ai_list = list()
to_chat(src, "<span class='notice'>Switched to [network] camera network.</span>")
//End of code by Mord_Sith
/mob/living/silicon/ai/proc/choose_modules()
set category = "Malfunction"
set name = "Choose Module"
malf_picker.use(src)
/mob/living/silicon/ai/proc/ai_statuschange()
set category = "AI Commands"
set name = "AI Status"
......@@ -804,14 +798,26 @@ var/list/ai_list = list()
return
/mob/living/silicon/ai/proc/corereturn()
set category = "Malfunction"
set name = "Return to Main Core"
var/obj/machinery/power/apc/apc = src.loc
if(!istype(apc))
to_chat(src, "<span class='notice'>You are already in your Main Core.</span>")
return
/spell/aoe_turf/corereturn
name = "Return to Core"
panel = MALFUNCTION
charge_type = Sp_CHARGES
charge_max = 1
hud_state = "unshunt"
override_base = "grey"
/spell/aoe_turf/corereturn/before_target(mob/user)
if(istype(user.loc, /obj/machinery/power/apc))
return 0
else
to_chat(user, "<span class='notice'>You are already in your Main Core.</span>")
return 1
/spell/aoe_turf/corereturn/choose_targets(mob/user = usr)
return list(user.loc)
/spell/aoe_turf/corereturn/cast(var/list/targets, mob/user)
var/obj/machinery/power/apc/apc = targets[1]
apc.malfvacate()
//Toggles the luminosity and applies it by re-entereing the camera.
......
......@@ -967,8 +967,7 @@
if(malf.parent)
qdel(malf)
malf = null
src.occupant.verbs += /mob/living/silicon/ai/proc/corereturn
src.occupant.verbs += /datum/game_mode/malfunction/proc/takeover
src.occupant.add_spell(new /spell/aoe_turf/corereturn, "grey_spell_ready",/obj/screen/movable/spell_master/malf)
src.occupant.cancel_camera()
if (seclevel2num(get_security_level()) == SEC_LEVEL_DELTA)
for(var/obj/item/weapon/pinpointer/point in world)
......@@ -992,7 +991,6 @@
var/mob/living/silicon/ai/A = AI_mind.current // the current mob the mind owns
if(A.stat != DEAD)
point.target = A //The pinpointer tracks the AI back into its core.
else
to_chat(src.occupant, "<span class='warning'>Primary core damaged, unable to return core processes.</span>")
if(forced)
......
......@@ -173,7 +173,6 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now
var/event/E = user.on_uattack
E.handlers.Remove(user.spell_channeling)
user.spell_channeling = null
charge_counter = charge_max
currently_channeled = 0
connected_button.remove_channeling()
connected_button.name = name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment