Fix various anomaly bugs and oversights. (#8941)

* Fix various anomaly bugs and oversights. Cellcharge and Celldrain have been blasted into compliance.

* Cleanup
Move back to Cynosure.
This commit is contained in:
Mechoid
2023-03-04 11:27:34 -08:00
committed by GitHub
parent 06a5496246
commit 318bc4daa5
5 changed files with 63 additions and 82 deletions
@@ -4,56 +4,41 @@
effect_color = "#ffee06"
var/last_message
/datum/artifact_effect/uncommon/cellcharge/DoEffectTouch(mob/living/user)
if (user)
if (istype(user, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = user
for (var/obj/item/cell/D in R.contents)
D.charge += rand() * 100 + 50
to_chat(R, "<font color='blue'>SYSTEM ALERT: Large energy boost detected!</font>")
/datum/artifact_effect/uncommon/cellcharge/DoEffectAura()
/datum/artifact_effect/uncommon/cellcharge/proc/charge_cells(var/amount = 25)
var/atom/holder = get_master_holder()
if (!holder)
return
var/turf/turf = get_turf(holder)
if (!turf)
return
for (var/obj/machinery/power/apc/apc as anything in GLOB.apcs)
if (get_dist(turf, apc) <= 200)
for (var/obj/item/cell/cell in apc.contents)
cell.charge += 25
for (var/obj/machinery/power/smes/smes as anything in GLOB.smeses)
if (get_dist(turf, smes) <= effectrange)
smes.charge += 25
var/charged_robots
for (var/mob/living/silicon/robot/robot as anything in global.silicon_mob_list)
if (get_dist(turf, robot) < 50)
var/charged_cells
for (var/obj/item/cell/cell in robot.contents)
cell.charge += 25
charged_cells = TRUE
if (charged_cells)
to_chat(robot, "<font color='blue'>SYSTEM ALERT: Energy boost detected!</font>")
charged_robots = TRUE
if (charged_robots)
var/messaged_robots
for(var/atom/movable/AM in range(effectrange, turf))
if(isliving(AM))
var/mob/living/L = AM
var/obj/item/cell/C = L.get_cell()
if(C)
if(issilicon(L) && ((last_message + (1 MINUTE)) < world.time))
messaged_robots = TRUE
to_chat(L, SPAN_NOTICE("SYSTEM ALERT: Energy boost detected!"))
C.charge = min(C.maxcharge, C.charge + amount)
continue
var/obj/item/cell/C = AM.get_cell()
if(C)
C.charge = min(C.maxcharge, C.charge + amount)
if(messaged_robots)
last_message = world.time
/datum/artifact_effect/uncommon/cellcharge/DoEffectTouch(mob/living/user)
if(!user)
return
charge_cells(100)
/datum/artifact_effect/uncommon/cellcharge/DoEffectAura()
charge_cells()
/datum/artifact_effect/uncommon/cellcharge/DoEffectPulse()
var/atom/holder = get_master_holder()
if (holder)
var/turf/T = get_turf(holder)
for (var/obj/machinery/power/apc/C in range(200, T))
for (var/obj/item/cell/B in C.contents)
B.charge += rand() * 100
for (var/obj/machinery/power/smes/S in range (src.effectrange,src))
S.charge += 250
for (var/mob/living/silicon/robot/M in range(100, T))
for (var/obj/item/cell/D in M.contents)
D.charge += rand() * 100
if (world.time - last_message > 200)
to_chat(M, "<font color='blue'>SYSTEM ALERT: Energy boost detected!</font>")
last_message = world.time
charge_cells(50)
@@ -5,45 +5,41 @@
effect_color = "#fbff02"
var/last_message
/datum/artifact_effect/uncommon/celldrain/proc/drain_cells(var/amount = 25)
var/atom/holder = get_master_holder()
if (!holder)
return
var/turf/turf = get_turf(holder)
if (!turf)
return
var/messaged_robots
for(var/atom/movable/AM in range(effectrange, turf))
if(isliving(AM))
var/mob/living/L = AM
var/obj/item/cell/C = L.get_cell()
if(C)
if(issilicon(L) && ((last_message + (1 MINUTE)) < world.time))
messaged_robots = TRUE
to_chat(L, SPAN_WARNING("SYSTEM ALERT: Energy drain detected!"))
C.charge = min(C.maxcharge, C.charge - amount)
continue
var/obj/item/cell/C = AM.get_cell()
if(C)
C.charge = min(C.maxcharge, C.charge - amount)
if(messaged_robots)
last_message = world.time
/datum/artifact_effect/uncommon/celldrain/DoEffectTouch(mob/living/user)
if (user)
if (istype(user, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = user
for (var/obj/item/cell/D in R.contents)
D.charge = max(D.charge - rand() * 100, 0)
to_chat(R, "<font color='blue'>SYSTEM ALERT: Energy drain detected!</font>")
if(!user)
return
drain_cells(100)
/datum/artifact_effect/uncommon/celldrain/DoEffectAura()
var/atom/holder = get_master_holder()
if (holder)
var/turf/T = get_turf(holder)
for (var/obj/machinery/power/apc/C in range(200, T))
for (var/obj/item/cell/B in C.contents)
B.charge = max(B.charge - 50,0)
for (var/obj/machinery/power/smes/S in range (src.effectrange,src))
S.charge = max(S.charge - 100,0)
for (var/mob/living/silicon/robot/M in range(50, T))
for (var/obj/item/cell/D in M.contents)
D.charge = max(D.charge - 50,0)
if (world.time - last_message > 200)
to_chat(M, "<font color='red'>SYSTEM ALERT: Energy drain detected!</font>")
last_message = world.time
drain_cells()
/datum/artifact_effect/uncommon/celldrain/DoEffectPulse()
var/atom/holder = get_master_holder()
if (holder)
var/turf/T = get_turf(holder)
for (var/obj/machinery/power/apc/C in range(200, T))
for (var/obj/item/cell/B in C.contents)
B.charge = max(B.charge - rand() * 150,0)
for (var/obj/machinery/power/smes/S in range (src.effectrange,src))
S.charge = max(S.charge - 250,0)
for (var/mob/living/silicon/robot/M in range(100, T))
for (var/obj/item/cell/D in M.contents)
D.charge = max(D.charge - rand() * 150,0)
if (world.time - last_message > 200)
to_chat(M, "<font color='red'>SYSTEM ALERT: Energy drain detected!</font>")
last_message = world.time
drain_cells(50)
@@ -9,7 +9,7 @@
effect_type = pick(EFFECT_ELECTRO, EFFECT_PARTICLE)
/datum/artifact_effect/robohurt/DoEffectTouch(mob/living/user)
/datum/artifact_effect/uncommon/robohurt/DoEffectTouch(mob/living/user)
if (user)
if (istype(user, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = user
@@ -4,7 +4,7 @@
effect_color = "#a36fa1"
/datum/artifact_effect/sleepy/New()
/datum/artifact_effect/uncommon/sleepy/New()
..()
effect_type = pick(EFFECT_PSIONIC, EFFECT_ORGANIC)
@@ -38,7 +38,7 @@
if(!istype(blood))
blood = new(T)
for(var/list/chem in reagents)
blood.reagents.add_reagent(chem[0], chem[1] * chargelevel, LAZYLEN(chem) > 2 ? chem[2] : null)
blood.reagents.add_reagent(chem[1], chem[2] * chargelevel, LAZYLEN(chem) > 2 ? chem[3] : null)
blood.update_icon()
chargelevel = round(0.8 * chargelevel)