mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Tesla map removal to fix merge
This commit is contained in:
@@ -55,13 +55,13 @@
|
||||
return
|
||||
|
||||
playsound(get_turf(user), 'sound/magic/lightningbolt.ogg', 50, 1)
|
||||
user.Beam(target,icon_state="lightning",icon='icons/effects/effects.dmi',time=5)
|
||||
user.Beam(target,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
|
||||
Bolt(user,target,30,5,user)
|
||||
Reset(user)
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/lightning/proc/Bolt(mob/origin,mob/target,bolt_energy,bounces,mob/user = usr)
|
||||
origin.Beam(target,icon_state="lightning",icon='icons/effects/effects.dmi',time=5)
|
||||
origin.Beam(target,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
var/mob/living/carbon/current = target
|
||||
if(bounces < 1)
|
||||
current.electrocute_act(bolt_energy,"Lightning Bolt",safety=1)
|
||||
|
||||
@@ -434,6 +434,22 @@ to destroy them and players will be able to make replacements.
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/tesla_coil
|
||||
name = "circuit board (Tesla Coil)"
|
||||
build_path = /obj/machinery/power/tesla_coil
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/capacitor = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/grounding_rod
|
||||
name = "circuit board (Grounding Rod)"
|
||||
build_path = /obj/machinery/power/grounding_rod
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/capacitor = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/processor
|
||||
name = "circuit board (Food processor)"
|
||||
build_path = /obj/machinery/processor
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var/burn_state = FIRE_PROOF // LAVA_PROOF | FIRE_PROOF | FLAMMABLE | ON_FIRE
|
||||
var/burntime = 10 //How long it takes to burn to ashes, in seconds
|
||||
var/burn_world_time //What world time the object will burn up completely
|
||||
|
||||
var/being_shocked = 0
|
||||
/obj/Destroy()
|
||||
if(!istype(src, /obj/machinery))
|
||||
SSobj.processing.Remove(src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
|
||||
@@ -185,10 +185,15 @@
|
||||
overlays -= fire_overlay
|
||||
SSobj.burning -= src
|
||||
|
||||
|
||||
|
||||
/obj/proc/empty_object_contents(burn = 0, new_loc = src.loc)
|
||||
for(var/obj/item/Item in contents) //Empty out the contents
|
||||
Item.loc = new_loc
|
||||
if(burn)
|
||||
Item.fire_act() //Set them on fire, too
|
||||
Item.fire_act() //Set them on fire, too
|
||||
|
||||
/obj/proc/tesla_act(var/power)
|
||||
being_shocked = 1
|
||||
var/power_bounced = power / 2
|
||||
tesla_zap(src, 5, power_bounced)
|
||||
spawn(10)
|
||||
being_shocked = 0
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
item_state = "eng_hardsuit"
|
||||
armor = list(melee = 10, bullet = 5, laser = 10, energy = 5, bomb = 10, bio = 100, rad = 75)
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals,/obj/item/device/t_scanner, /obj/item/weapon/rcd)
|
||||
siemens_coefficient = 0
|
||||
var/obj/item/clothing/head/helmet/space/hardsuit/helmet
|
||||
action_button_name = "Toggle Helmet"
|
||||
var/helmettype = /obj/item/clothing/head/helmet/space/hardsuit
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
. = ..()
|
||||
|
||||
|
||||
/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, override = 0)
|
||||
/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, override = 0, tesla_shock = 0)
|
||||
shock_damage *= siemens_coeff
|
||||
if(shock_damage<1 && !override)
|
||||
return 0
|
||||
|
||||
@@ -279,8 +279,19 @@
|
||||
spreadFire(AM)
|
||||
|
||||
//Added a safety check in case you want to shock a human mob directly through electrocute_act.
|
||||
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0)
|
||||
if(!safety)
|
||||
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0)
|
||||
if(tesla_shock)
|
||||
var/total_coeff = 1
|
||||
if(gloves)
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
if(G.siemens_coefficient <= 0)
|
||||
total_coeff -= 0.5
|
||||
if(wear_suit)
|
||||
var/obj/item/clothing/suit/S = wear_suit
|
||||
if(S.siemens_coefficient <= 0)
|
||||
total_coeff = 0
|
||||
siemens_coeff = total_coeff
|
||||
else if(!safety)
|
||||
var/gloves_siemens_coeff = 1
|
||||
var/species_siemens_coeff = 1
|
||||
if(gloves)
|
||||
|
||||
@@ -386,7 +386,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0)
|
||||
/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
|
||||
return 0 //only carbon liveforms have this proc
|
||||
|
||||
/mob/living/emp_act(severity)
|
||||
|
||||
@@ -6,30 +6,78 @@
|
||||
anchored = 0
|
||||
density = 1
|
||||
var/power_loss = 2
|
||||
var/being_shocked = 0
|
||||
var/input_power_multiplier = 1
|
||||
|
||||
/obj/machinery/power/tesla_coil/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/tesla_coil(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/power/tesla_coil/RefreshParts()
|
||||
var/power_multiplier = 0
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
power_multiplier += C.rating
|
||||
input_power_multiplier = power_multiplier
|
||||
|
||||
/obj/machinery/power/tesla_coil/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(!anchored && !isinspace())
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
anchored = 1
|
||||
user.visible_message("[user.name] secures the [src.name].", \
|
||||
"<span class='notice'>You secure the external bolts.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
connect_to_network()
|
||||
else if(anchored)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
anchored = 0
|
||||
user.visible_message("[user.name] unsecures the [src.name].", \
|
||||
"<span class='notice'>You unsecure the external bolts.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
disconnect_from_network()
|
||||
if(default_deconstruction_screwdriver(user, "coil", "coil", W))
|
||||
return
|
||||
|
||||
/obj/machinery/power/tesla_coil/proc/tesla_act(var/power)
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
if(default_pry_open(W))
|
||||
return
|
||||
|
||||
if(default_unfasten_wrench(user, W))
|
||||
if(!anchored)
|
||||
disconnect_from_network()
|
||||
else
|
||||
connect_to_network()
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(W)
|
||||
|
||||
/obj/machinery/power/tesla_coil/tesla_act(var/power)
|
||||
being_shocked = 1
|
||||
var/power_produced = power / power_loss
|
||||
add_avail(power_produced)
|
||||
add_avail(power_produced*input_power_multiplier)
|
||||
flick("coilhit", src)
|
||||
tesla_zap(src, 3, power_produced)
|
||||
tesla_zap(src, 5, power_produced)
|
||||
spawn(10)
|
||||
being_shocked = 0
|
||||
being_shocked = 0
|
||||
|
||||
/obj/machinery/power/grounding_rod
|
||||
name = "Grounding Rod"
|
||||
desc = "Keep an area from being fried from Edison's Bane."
|
||||
icon = 'icons/obj/tesla_engine/tesla_coil.dmi'
|
||||
icon_state = "grounding_rod"
|
||||
anchored = 0
|
||||
density = 1
|
||||
|
||||
/obj/machinery/power/grounding_rod/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/grounding_rod(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/power/grounding_rod/attackby(obj/item/W, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, "grounding_rod", "grounding_rod", W))
|
||||
return
|
||||
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
if(default_pry_open(W))
|
||||
return
|
||||
|
||||
if(default_unfasten_wrench(user, W))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(W)
|
||||
|
||||
/obj/machinery/power/grounding_rod/tesla_act(var/power)
|
||||
flick("coil_shock_1", src)
|
||||
@@ -1,3 +1,20 @@
|
||||
#define TESLA_DEFAULT_POWER 3476520
|
||||
#define TESLA_MINI_POWER 1738260
|
||||
|
||||
var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
|
||||
/obj/machinery/power/emitter,
|
||||
/obj/machinery/field/generator,
|
||||
/mob/living/simple_animal,
|
||||
/obj/machinery/particle_accelerator/control_box,
|
||||
/obj/structure/particle_accelerator/fuel_chamber,
|
||||
/obj/structure/particle_accelerator/particle_emitter/center,
|
||||
/obj/structure/particle_accelerator/particle_emitter/left,
|
||||
/obj/structure/particle_accelerator/particle_emitter/right,
|
||||
/obj/structure/particle_accelerator/power_box,
|
||||
/obj/structure/particle_accelerator/end_cap,
|
||||
/obj/machinery/field/containment,
|
||||
/obj/structure/disposalpipe)
|
||||
|
||||
/obj/singularity/energy_ball
|
||||
name = "Energy Ball"
|
||||
icon = 'icons/obj/tesla_engine/energy_ball.dmi'
|
||||
@@ -9,18 +26,54 @@
|
||||
grav_pull = 0
|
||||
contained = 0
|
||||
density = 1
|
||||
var/list/orbiting_balls = list()
|
||||
var/produced_power
|
||||
var/is_orbiting
|
||||
|
||||
/obj/singularity/energy_ball/Destroy()
|
||||
for(var/obj/singularity/energy_ball/EB in orbiting_balls)
|
||||
qdel(EB)
|
||||
..()
|
||||
|
||||
/obj/singularity/energy_ball/process()
|
||||
pixel_x = 0
|
||||
pixel_y = 0 // Lining up the beams properly.
|
||||
tesla_zap(src, 3, 3476520)
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
if(!is_orbiting)
|
||||
handle_energy()
|
||||
var/amount_to_move = 2 + orbiting_balls.len * 2
|
||||
move_the_basket_ball(amount_to_move)
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
tesla_zap(src, 7, TESLA_DEFAULT_POWER)
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
energy += rand(1,3) // ensure it generates energy without needing to be blasted by the PA too much due to its size, and that a tesla engine will always get bigger over time
|
||||
else
|
||||
tesla_zap(src, 7, TESLA_MINI_POWER)
|
||||
energy = 0 // ensure we dont have miniballs of miniballs
|
||||
return
|
||||
|
||||
|
||||
/obj/singularity/energy_ball/proc/move_the_basket_ball(var/move_amount)
|
||||
for(var/i = 0, i < move_amount, i++)
|
||||
var/move_dir = pick(alldirs)
|
||||
var/turf/T = get_step(src,move_dir)
|
||||
if(can_move(T))
|
||||
loc = get_step(src,move_dir)
|
||||
return
|
||||
|
||||
/obj/singularity/energy_ball/proc/handle_energy()
|
||||
if(energy >= 300)
|
||||
energy = 0
|
||||
var/obj/singularity/energy_ball/EB = new(loc)
|
||||
orbiting_balls.Add(EB)
|
||||
EB.transform *= 0.5
|
||||
EB.is_orbiting = 1
|
||||
var/icon/I = icon(icon,icon_state,dir)
|
||||
|
||||
var/orbitsize = (I.Width()+I.Height())*0.5
|
||||
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
|
||||
spawn(1)
|
||||
EB.orbit(src,orbitsize,0)
|
||||
|
||||
|
||||
|
||||
/obj/singularity/energy_ball/Bump(atom/A)
|
||||
if(istype(A, /mob/living/carbon))
|
||||
@@ -54,41 +107,91 @@ proc/tesla_zap(var/atom/source, var/zap_range = 3, var/power)
|
||||
if(power < 1000)
|
||||
return
|
||||
var/list/tesla_coils = list()
|
||||
var/list/grounding_rods = list()
|
||||
var/list/potential_machine_zaps = list()
|
||||
var/list/potential_mob_zaps = list()
|
||||
var/list/potential_structure_zaps = list()
|
||||
var/closest_atom
|
||||
for(var/atom/A in orange(source, zap_range))
|
||||
for(var/atom/A in oview(source, zap_range))
|
||||
if(istype(A, /obj/machinery/power/tesla_coil))
|
||||
var/obj/machinery/power/tesla_coil/C = A
|
||||
if(C.being_shocked)
|
||||
continue
|
||||
tesla_coils.Add(C)
|
||||
continue
|
||||
if(istype(A, /obj/machinery/power/grounding_rod))
|
||||
var/obj/machinery/power/grounding_rod/R = A
|
||||
grounding_rods.Add(R)
|
||||
continue
|
||||
if(istype(A, /obj/machinery))
|
||||
var/obj/machinery/M = A
|
||||
if(is_type_in_list(M, blacklisted_tesla_types))
|
||||
continue
|
||||
if(M.being_shocked)
|
||||
continue
|
||||
potential_machine_zaps.Add(M)
|
||||
continue
|
||||
if(istype(A, /obj/structure))
|
||||
var/obj/structure/M = A
|
||||
if(is_type_in_list(M, blacklisted_tesla_types))
|
||||
continue
|
||||
if(M.being_shocked)
|
||||
continue
|
||||
potential_structure_zaps.Add(M)
|
||||
continue
|
||||
if(istype(A, /mob/living))
|
||||
var/mob/living/L = A
|
||||
if(L.stat == DEAD)
|
||||
continue
|
||||
if(is_type_in_list(L, blacklisted_tesla_types))
|
||||
continue
|
||||
potential_mob_zaps.Add(L)
|
||||
continue
|
||||
closest_atom = get_closest_atom(/obj/machinery/power/tesla_coil, tesla_coils, source)
|
||||
if(closest_atom && istype(closest_atom, /obj/machinery/power/tesla_coil))
|
||||
var/obj/machinery/power/tesla_coil/C = closest_atom
|
||||
source.Beam(C,icon_state="lightning",icon='icons/effects/effects.dmi',time=5)
|
||||
source.Beam(C,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
C.tesla_act(power)
|
||||
return
|
||||
if(!closest_atom)
|
||||
closest_atom = get_closest_atom(/obj/machinery/power/grounding_rod, grounding_rods, source)
|
||||
if(closest_atom && istype(closest_atom, /obj/machinery/power/grounding_rod))
|
||||
var/obj/machinery/power/grounding_rod/R = closest_atom
|
||||
source.Beam(R,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
R.tesla_act(power)
|
||||
return
|
||||
if(!closest_atom)
|
||||
closest_atom = get_closest_atom(/mob/living, potential_mob_zaps, source)
|
||||
if(closest_atom && istype(closest_atom, /mob/living))
|
||||
var/mob/living/L = closest_atom
|
||||
var/shock_damage = Clamp(round(power/400), 10, 200) + rand(-5,5)
|
||||
source.Beam(L,icon_state="lightning",icon='icons/effects/effects.dmi',time=5)
|
||||
L.electrocute_act(shock_damage, source, 1)
|
||||
var/shock_damage = Clamp(round(power/400), 10, 90) + rand(-5,5)
|
||||
source.Beam(L,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
L.electrocute_act(shock_damage, source, 1, tesla_shock = 1)
|
||||
if(istype(L, /mob/living/silicon))
|
||||
var/mob/living/silicon/S = L
|
||||
S.emp_act(2)
|
||||
return
|
||||
if(!closest_atom)
|
||||
closest_atom = get_closest_atom(/obj/machinery, potential_machine_zaps, source)
|
||||
if(closest_atom)
|
||||
source.Beam(closest_atom,icon_state="lightning",icon='icons/effects/effects.dmi',time=5)
|
||||
tesla_zap(closest_atom, 3, power / 4)
|
||||
var/obj/machinery/M = closest_atom
|
||||
source.Beam(M,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
M.tesla_act(power)
|
||||
if(prob(85))
|
||||
M.emp_act(2)
|
||||
else
|
||||
if(prob(50))
|
||||
M.ex_act(3)
|
||||
else
|
||||
if(prob(90))
|
||||
M.ex_act(2)
|
||||
else
|
||||
M.ex_act(1)
|
||||
return
|
||||
if(!closest_atom)
|
||||
closest_atom = get_closest_atom(/obj/structure, potential_structure_zaps, source)
|
||||
if(closest_atom)
|
||||
var/obj/structure/S = closest_atom
|
||||
source.Beam(S,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
S.tesla_act(power)
|
||||
return
|
||||
|
||||
@@ -452,3 +452,23 @@
|
||||
materials = list(MAT_GLASS = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/mining_equipment_vendor
|
||||
category = list ("Misc. Machinery")
|
||||
|
||||
/datum/design/tesla_coil
|
||||
name = "Machine Design (Tesla Coil Board)"
|
||||
desc = "The circuit board for a tesla coil."
|
||||
id = "tesla_coil"
|
||||
req_tech = list("programming" = 1)
|
||||
build_type = IMPRINTER
|
||||
materials = list(MAT_GLASS = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/tesla_coil
|
||||
category = list ("Misc. Machinery")
|
||||
|
||||
/datum/design/grounding_rod
|
||||
name = "Machine Design (Grounding Rod Board)"
|
||||
desc = "The circuit board for a grounding rod."
|
||||
id = "grounding_rod"
|
||||
req_tech = list("programming" = 1)
|
||||
build_type = IMPRINTER
|
||||
materials = list(MAT_GLASS = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/grounding_rod
|
||||
category = list ("Misc. Machinery")
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 315 KiB After Width: | Height: | Size: 344 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 10 KiB |
Reference in New Issue
Block a user