mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-09 00:43:07 +00:00
* Adds "typecache" utility functions. A fast way to filter lists by type. Ported from TG * Ports the "orbit" feature and subsystem from TG * Adds a feature that allows mobs and objs to "orbit" around some atom. They literally are moved around in circles. See the `orbit` proc in orbit.dm. * Adds a subsystem that processes the actual movement of orbiting items. * Adds utility methods for common machinery behavior. * Adds default_unfasten_wrench which handles the standard anchor/unanchor behavior of wrenches being used on machines. Together with the other default_x_tool machinery procs we can eliminate having that code duplicated in dozens of places! * Adds is_wire_tool proc to easily detect when a machine is hit with a tool that should open its wires UI (if it has one). Based on ideas from Paradise, with improvements for us. * Implements the Tesla Engine Ported from a mixture of TG and Paradise code and assets: Edison's Bane Includes the tesla energy ball itself, the generator that makes it, tesla coils, grounding rods, the circuits and frames to build them. * Switch dusting to zapping on impact and spin better Ported /tg SpinAnimation which supports more than triangles.
69 lines
1.6 KiB
Plaintext
69 lines
1.6 KiB
Plaintext
////////////////////////////////////////
|
|
// Vars and Default tesla_act behavior
|
|
////////////////////////////////////////
|
|
|
|
/obj
|
|
var/being_shocked = FALSE
|
|
|
|
/obj/proc/tesla_act(var/power)
|
|
being_shocked = TRUE
|
|
var/power_bounced = power / 2
|
|
tesla_zap(src, 3, power_bounced)
|
|
//addtimer(CALLBACK(src, .proc/reset_shocked), 10)
|
|
//schedule_task_with_source_in(10, src, .proc/reset_shocked)
|
|
spawn(10) reset_shocked()
|
|
|
|
/obj/proc/reset_shocked()
|
|
being_shocked = FALSE
|
|
|
|
// Overrides for behavior on specific types
|
|
|
|
/obj/structure/blob/tesla_act(power)
|
|
..()
|
|
adjust_integrity(-power/400)
|
|
|
|
/obj/machinery/nuclearbomb/tesla_act(power, explosive)
|
|
..()
|
|
if(explosive)
|
|
qdel(src)//like the singulo, tesla deletes it. stops it from exploding over and over
|
|
|
|
/obj/machinery/tesla_act(power, explosive = FALSE)
|
|
..()
|
|
if(prob(85) && explosive)
|
|
explosion(loc, 1, 2, 4, /*flame_range = 2,*/ adminlog = FALSE/*, smoke = FALSE*/)
|
|
else if(prob(50))
|
|
emp_act(2)
|
|
else
|
|
ex_act(2)
|
|
|
|
/obj/machinery/camera/tesla_act(var/power)//EMP proof upgrade also makes it tesla immune
|
|
if(isEmpProof())
|
|
return
|
|
..()
|
|
qdel(src) //to prevent bomb testing camera from exploding over and over forever
|
|
|
|
/obj/machinery/light/tesla_act(power, explosive = FALSE)
|
|
if(explosive)
|
|
explosion(loc, 0, 0, 0/*, flame_range = 5*/, adminlog = FALSE)
|
|
qdel(src)
|
|
|
|
/obj/structure/closet/tesla_act(var/power)
|
|
..() //extend the zap
|
|
visible_message("<span class='danger'>[src] is blown apart by the bolt of electricity!</span>", "<span class='danger'>You hear a metallic screeching sound.</span>")
|
|
dump_contents()
|
|
qdel(src)
|
|
|
|
/obj/structure/reagent_dispensers/fueltank/tesla_act()
|
|
..() //extend the zap
|
|
explode()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|