AI Malfunction Update (#2193)

Incorporates many of the things from: https://forums.aurorastation.org/viewtopic.php?f=18&t=7845.
Added several new features to the Malf AI gamemode based on the thread above.
This commit is contained in:
Ron
2017-05-15 22:20:40 +03:00
committed by skull132
parent fd990dd06b
commit fa64b7cf7b
16 changed files with 731 additions and 131 deletions
+1
View File
@@ -75,6 +75,7 @@ var/list/ai_verbs_default = list(
var/APU_power = 0 // If set to 1 AI runs on APU power
var/hacking = 0 // Set to 1 if AI is hacking APC, cyborg, other AI, or running system override.
var/system_override = 0 // Set to 1 if system override is initiated, 2 if succeeded.
var/synthetic_takeover = 0 // 1 is started, 2 is complete.
var/hack_can_fail = 1 // If 0, all abilities have zero chance of failing.
var/hack_fails = 0 // This increments with each failed hack, and determines the warning message text.
var/errored = 0 // Set to 1 if runtime error occurs. Only way of this happening i can think of is admin fucking up with varedit.
+67 -1
View File
@@ -22,8 +22,11 @@
var/custom_sprite = 0 //Due to all the sprites involved, a var for our custom borgs may be best
var/crisis //Admin-settable for combat module use.
var/crisis_override = 0
var/malfAImodule = 0
var/integrated_light_power = 4
var/datum/wires/robot/wires
var/overclocked = 0 // cyborg controls if they enable the overclock
var/overclockavailable = 0 // if the overclock is available for use
//Icon stuff
@@ -49,6 +52,7 @@
var/module_state_2 = null
var/module_state_3 = null
var/obj/item/device/radio/borg/radio = null
var/mob/living/silicon/ai/connected_ai = null
var/obj/item/weapon/cell/cell = null
@@ -378,6 +382,61 @@
return dat
/mob/living/silicon/robot/proc/toggle_overclock()
set category = "Robot Commands"
set name = "Toggle Overclock"
set desc = "Enable an overclocking of your systems, greatly increasing the power available to your modules."
if(overclockavailable == 1)
if(overclocked == 0)
overclocked = 1
ToggleOverClock(src)
usr << "You enable the overclock mode enhancing and unlocking several modules but increasing power usage greatly."
else
overclocked = 0
ToggleOverClock(src)
usr << "You disable the overclock mode."
/mob/living/silicon/robot/proc/ToggleOverClock(var/mob/living/silicon/robot/R)
if(!R)
return
if(overclocked == 0)
//Give them some taser speed if they have a taser.
var/obj/item/weapon/gun/energy/taser/mounted/cyborg/T = locate() in R.module
if(!T)
T = locate() in module.contents
if(!T)
T = locate() in module.modules
if(T)
T.recharge_time = max(2 , T.recharge_time - 4)
//Give them the hacked item if they don't have it.
if(emagged == 0)
R.emagged = 1
R.fakeemagged = 1
//Hide them from the robotics console.
if(scrambledcodes == 0)
scrambledcodes = 1
//Increase EMP protection.
if(!cell_emp_mult < 2)
cell_emp_mult = 1
if(overclocked == 1)
//Reduce their free taser speed.
var/obj/item/weapon/gun/energy/taser/mounted/cyborg/T = locate() in R.module
if(!T)
T = locate() in module.contents
if(!T)
T = locate() in module.modules
if(T)
T.recharge_time = max(2 , T.recharge_time + 4)
//Show them on the robotics console.
if(scrambledcodes == 1)
scrambledcodes = 0
//Reduce EMP protection
if(cell_emp_mult == 1)
cell_emp_mult = 2
/mob/living/silicon/robot/verb/toggle_lights()
set category = "Robot Commands"
set name = "Toggle Lights"
@@ -819,6 +878,11 @@
dat += text("[module.emag]: <B>Activated</B><BR>")
else
dat += text("[module.emag]: <A HREF=?src=\ref[src];act=\ref[module.emag]>Activate</A><BR>")
if(malfAImodule)
if(activated(module.malfAImodule))
dat += text("[module.malfAImodule]: <B>Activated</B><BR>")
else
dat += text("[module.malfAImodule]: <A HREF=?src=\ref[src];act=\ref[module.malfAImodule]>Activate</A><BR>")
/*
if(activated(obj))
dat += text("[obj]: \[<B>Activated</B> | <A HREF=?src=\ref[src];deact=\ref[obj]>Deactivate</A>\]<BR>")
@@ -849,7 +913,7 @@
if (!istype(O))
return 1
if(!((O in src.module.modules) || (O == src.module.emag)))
if(!((O in src.module.modules) || (O == src.module.emag) || (O == src.module.malfAImodule)))
return 1
if(activated(O))
@@ -1066,6 +1130,8 @@
return 0
var/power_use = amount * CYBORG_POWER_USAGE_MULTIPLIER
if(overclocked == 1)
power_use = power_use + 200
if(cell.checked_use(CELLRATE * power_use))
used_power_this_tick += power_use
return 1
@@ -29,6 +29,7 @@ var/global/list/robot_modules = list(
var/list/modules = list()
var/list/datum/matter_synth/synths = list()
var/obj/item/emag = null
var/obj/item/malfAImodule = null
var/obj/item/borg/upgrade/jetpack = null
var/list/subsystems = list()
var/list/obj/item/borg/upgrade/supported_upgrades = list()
@@ -363,6 +364,7 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/device/pipe_painter(src)
src.modules += new /obj/item/weapon/gripper/no_use/loader(src)
src.modules += new /obj/item/weapon/gripper(src)
src.malfAImodule += new /obj/item/weapon/rtf(src)
var/datum/matter_synth/metal = new /datum/matter_synth/metal()
var/datum/matter_synth/plasteel = new /datum/matter_synth/plasteel()
@@ -19,6 +19,9 @@
if(module_active && istype(module_active,/obj/item/borg/combat/mobility))
tally-=3
if(overclocked == 1)
tally-=1
return tally+config.robot_delay
// NEW: Different power usage depending on whether driving or jetpacking. space movement is easier