[MIRROR] Tesla Corona Analyzers (#5726)
* Tesla Corona Analyzers (#35965) * Tesla Corona Analyzers Generate points to make up for no bomb production on maps like Pubby * Silly me, not Aurora, but Corona * Adds sprites to the new mode * new sprites! credit to... me! * Further sprite tweaks. * Tesla Corona Analyzers
This commit is contained in:
committed by
Poojawa
parent
ef864d109b
commit
a53e395606
@@ -515,10 +515,53 @@
|
||||
def_components = list(/obj/item/stock_parts/cell = /obj/item/stock_parts/cell/high/empty)
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil
|
||||
name = "Tesla Coil (Machine Board)"
|
||||
name = "Tesla Controller (Machine Board)"
|
||||
desc = "You can use a screwdriver to switch between Research and Power Generation"
|
||||
build_path = /obj/machinery/power/tesla_coil
|
||||
req_components = list(/obj/item/stock_parts/capacitor = 1)
|
||||
|
||||
#define PATH_POWERCOIL /obj/item/circuitboard/machine/tesla_coil/power
|
||||
#define PATH_RPCOIL /obj/item/circuitboard/machine/tesla_coil/research
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil/Initialize()
|
||||
. = ..()
|
||||
if(!build_path)
|
||||
if(prob(50))
|
||||
name = "Tesla Coil (Machine Board)"
|
||||
build_path = PATH_POWERCOIL
|
||||
else
|
||||
name = "Tesla Corona Researcher (Machine Board)"
|
||||
build_path = PATH_RPCOIL
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
var/obj/item/circuitboard/new_type
|
||||
var/new_setting
|
||||
switch(build_path)
|
||||
if(PATH_POWERCOIL)
|
||||
new_type = /obj/item/circuitboard/machine/tesla_coil/research
|
||||
new_setting = "Research"
|
||||
if(PATH_RPCOIL)
|
||||
new_type = /obj/item/circuitboard/machine/tesla_coil/power
|
||||
new_setting = "Power"
|
||||
name = initial(new_type.name)
|
||||
build_path = initial(new_type.build_path)
|
||||
I.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You change the circuitboard setting to \"[new_setting]\".</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil/power
|
||||
name = "Tesla Coil (Machine Board)"
|
||||
build_path = PATH_POWERCOIL
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil/research
|
||||
name = "Tesla Corona Researcher (Machine Board)"
|
||||
build_path = PATH_RPCOIL
|
||||
|
||||
#undef PATH_POWERCOIL
|
||||
#undef PATH_RPCOIL
|
||||
|
||||
/obj/item/circuitboard/machine/grounding_rod
|
||||
name = "Grounding Rod (Machine Board)"
|
||||
build_path = /obj/machinery/power/grounding_rod
|
||||
|
||||
@@ -18,9 +18,15 @@
|
||||
var/zap_cooldown = 100
|
||||
var/last_zap = 0
|
||||
|
||||
var/datum/techweb/linked_techweb
|
||||
|
||||
/obj/machinery/power/tesla_coil/power
|
||||
circuit = /obj/item/circuitboard/machine/tesla_coil/power
|
||||
|
||||
/obj/machinery/power/tesla_coil/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/tesla_coil(src)
|
||||
linked_techweb = SSresearch.science_tech
|
||||
|
||||
/obj/machinery/power/tesla_coil/RefreshParts()
|
||||
var/power_multiplier = 0
|
||||
@@ -76,6 +82,8 @@
|
||||
flick("coilhit", src)
|
||||
playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
tesla_zap(src, 5, power_produced)
|
||||
if(istype(linked_techweb))
|
||||
linked_techweb.research_points += min(power_produced, 10)
|
||||
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
|
||||
else
|
||||
..()
|
||||
@@ -91,6 +99,43 @@
|
||||
playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
tesla_zap(src, 10, power/(coeff/2))
|
||||
|
||||
// Tesla R&D researcher
|
||||
/obj/machinery/power/tesla_coil/research
|
||||
name = "Tesla Corona Analyzer"
|
||||
desc = "A modified Tesla Coil used to study the effects of Edison's Bane for research."
|
||||
icon_state = "rpcoil0"
|
||||
circuit = /obj/item/circuitboard/machine/tesla_coil/research
|
||||
power_loss = 20 // something something, high voltage + resistance
|
||||
|
||||
/obj/machinery/power/tesla_coil/research/tesla_act(var/power)
|
||||
if(anchored && !panel_open)
|
||||
obj_flags |= BEING_SHOCKED
|
||||
//don't lose arc power when it's not connected to anything
|
||||
//please place tesla coils all around the station to maximize effectiveness
|
||||
var/power_produced = powernet ? power / power_loss : power
|
||||
add_avail(power_produced*input_power_multiplier)
|
||||
flick("rpcoilhit", src)
|
||||
playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
tesla_zap(src, 5, power_produced)
|
||||
if(istype(linked_techweb))
|
||||
linked_techweb.research_points += min(power_produced, 200)
|
||||
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/power/tesla_coil/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
|
||||
. = ..()
|
||||
if(. == SUCCESSFUL_UNFASTEN)
|
||||
if(panel_open)
|
||||
icon_state = "rpcoil_open[anchored]"
|
||||
else
|
||||
icon_state = "rpcoil[anchored]"
|
||||
|
||||
/obj/machinery/power/tesla_coil/attackby(obj/item/W, mob/user, params)
|
||||
. = ..()
|
||||
if(default_deconstruction_screwdriver(user, "rpcoil_open[anchored]", "rpcoil[anchored]", W))
|
||||
return
|
||||
|
||||
/obj/machinery/power/grounding_rod
|
||||
name = "grounding rod"
|
||||
desc = "Keep an area from being fried from Edison's Bane."
|
||||
|
||||
Reference in New Issue
Block a user