mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 20:17:15 +01:00
Merge pull request #14597 from VOREStation/upstream-merge-8941
[MIRROR] Fix various anomaly bugs and oversights.
This commit is contained in:
@@ -4,63 +4,41 @@
|
||||
effect_color = "#ffee06"
|
||||
var/last_message
|
||||
|
||||
|
||||
/datum/artifact_effect/cellcharge/DoEffectTouch(var/mob/living/user)
|
||||
if(user)
|
||||
if (istype(user, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
for (var/obj/item/weapon/cell/D in R.contents)
|
||||
D.charge += rand() * 100 + 50
|
||||
to_chat(R, "<span class='notice'>SYSTEM ALERT: Large energy boost detected!</span>")
|
||||
|
||||
|
||||
/datum/artifact_effect/cellcharge/DoEffectAura()
|
||||
/datum/artifact_effect/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 (apc.z != turf.z)
|
||||
|
||||
var/messaged_robots
|
||||
for(var/atom/movable/AM in range(effectrange, turf))
|
||||
if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
var/obj/item/weapon/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
|
||||
if(get_dist(turf, apc) <= 200)
|
||||
for (var/obj/item/weapon/cell/cell in apc.contents)
|
||||
cell.charge += 25
|
||||
for (var/obj/machinery/power/smes/smes as anything in GLOB.smeses)
|
||||
if (smes.z != turf.z)
|
||||
continue
|
||||
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(turf.z != robot.z)
|
||||
continue
|
||||
if(get_dist(turf, robot) < 50)
|
||||
var/charged_cells
|
||||
for (var/obj/item/weapon/cell/cell in robot.contents)
|
||||
cell.charge += 25
|
||||
charged_cells = TRUE
|
||||
if(charged_cells)
|
||||
if(world.time - last_message > 200)
|
||||
to_chat(robot, "<span class='notice'>SYSTEM ALERT: Energy boost detected!</span>")
|
||||
charged_robots = TRUE
|
||||
if(charged_robots)
|
||||
|
||||
var/obj/item/weapon/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/cellcharge/DoEffectTouch(mob/living/user)
|
||||
if(!user)
|
||||
return
|
||||
charge_cells(100)
|
||||
|
||||
/datum/artifact_effect/cellcharge/DoEffectAura()
|
||||
charge_cells()
|
||||
|
||||
/datum/artifact_effect/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/weapon/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/weapon/cell/D in M.contents)
|
||||
D.charge += rand() * 100
|
||||
if(world.time - last_message > 200)
|
||||
to_chat(M, "<span class='notice'>SYSTEM ALERT: Energy boost detected!</span>")
|
||||
last_message = world.time
|
||||
charge_cells(50)
|
||||
|
||||
@@ -4,74 +4,41 @@
|
||||
effect_type = EFFECT_ELECTRO
|
||||
var/last_message
|
||||
|
||||
effect_state = "pulsing"
|
||||
effect_color = "#fbff02"
|
||||
/datum/artifact_effect/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
|
||||
|
||||
/datum/artifact_effect/celldrain/DoEffectTouch(var/mob/user)
|
||||
if(user)
|
||||
if(istype(user, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
for (var/obj/item/weapon/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>")
|
||||
return 1
|
||||
var/messaged_robots
|
||||
for(var/atom/movable/AM in range(effectrange, turf))
|
||||
if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
var/obj/item/weapon/cell/C = L.get_cell()
|
||||
|
||||
return 1
|
||||
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/weapon/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/celldrain/DoEffectTouch(mob/living/user)
|
||||
if(!user)
|
||||
return
|
||||
drain_cells(100)
|
||||
|
||||
/datum/artifact_effect/celldrain/DoEffectAura()
|
||||
var/atom/holder = get_master_holder()
|
||||
if(holder)
|
||||
var/turf/T = get_turf(holder)
|
||||
for (var/obj/machinery/power/apc/C in GLOB.apcs)
|
||||
if(T.z != C.z)
|
||||
continue
|
||||
if(get_dist(T, C) > 200)
|
||||
continue
|
||||
for (var/obj/item/weapon/cell/B in C.contents)
|
||||
B.charge = max(B.charge - 50,0)
|
||||
for (var/obj/machinery/power/smes/S in GLOB.smeses)
|
||||
if(T.z != S.z)
|
||||
continue
|
||||
if(get_dist(T, S) > src.effectrange)
|
||||
continue
|
||||
S.charge = max(S.charge - 100,0)
|
||||
for (var/mob/living/silicon/robot/M in silicon_mob_list)
|
||||
if(T.z != M.z)
|
||||
continue
|
||||
if(get_dist(T, M) > 50)
|
||||
continue
|
||||
for (var/obj/item/weapon/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
|
||||
return 1
|
||||
drain_cells()
|
||||
|
||||
/datum/artifact_effect/celldrain/DoEffectPulse()
|
||||
var/atom/holder = get_master_holder()
|
||||
if(holder)
|
||||
var/turf/T = get_turf(holder)
|
||||
for (var/obj/machinery/power/apc/C in GLOB.apcs)
|
||||
if(T.z != C.z)
|
||||
continue
|
||||
if(get_dist(T, C) > 200)
|
||||
continue
|
||||
for (var/obj/item/weapon/cell/B in C.contents)
|
||||
B.charge = max(B.charge - rand() * 150,0)
|
||||
for (var/obj/machinery/power/smes/S in GLOB.smeses)
|
||||
if(T.z != S.z)
|
||||
continue
|
||||
if(get_dist(T, S) > src.effectrange)
|
||||
continue
|
||||
S.charge = max(S.charge - 250,0)
|
||||
for (var/mob/living/silicon/robot/M in silicon_mob_list)
|
||||
if(T.z != M.z)
|
||||
continue
|
||||
if(get_dist(T, M) > 100)
|
||||
continue
|
||||
for (var/obj/item/weapon/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
|
||||
return 1
|
||||
drain_cells(50)
|
||||
|
||||
Reference in New Issue
Block a user