forked from Monkestation/Monkestation2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Monkestation#25 from AcapitalA/engines
Re-adds the singulo, tesla and MRSPACMAN
- Loading branch information
Showing
24 changed files
with
1,328 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/datum/wires/particle_accelerator/control_box | ||
holder_type = /obj/machinery/particle_accelerator/control_box | ||
proper_name = "Particle Accelerator" | ||
|
||
/datum/wires/particle_accelerator/control_box/New(atom/holder) | ||
wires = list( | ||
WIRE_POWER, WIRE_STRENGTH, WIRE_LIMIT, | ||
WIRE_INTERFACE | ||
) | ||
add_duds(2) | ||
..() | ||
|
||
/datum/wires/particle_accelerator/control_box/interactable(mob/user) | ||
. = ..() | ||
var/obj/machinery/particle_accelerator/control_box/C = holder | ||
if(C.construction_state == 2) | ||
return TRUE | ||
|
||
/datum/wires/particle_accelerator/control_box/on_pulse(wire) | ||
var/obj/machinery/particle_accelerator/control_box/C = holder | ||
switch(wire) | ||
if(WIRE_POWER) | ||
C.toggle_power() | ||
if(WIRE_STRENGTH) | ||
C.add_strength() | ||
if(WIRE_INTERFACE) | ||
C.interface_control = !C.interface_control | ||
if(WIRE_LIMIT) | ||
C.visible_message("<span class='notice'>[icon2html(C, viewers(holder))]<b>[C]</b> makes a large whirring noise.</span>") | ||
|
||
/datum/wires/particle_accelerator/control_box/on_cut(wire, mend) | ||
var/obj/machinery/particle_accelerator/control_box/C = holder | ||
switch(wire) | ||
if(WIRE_POWER) | ||
if(C.active == !mend) | ||
C.toggle_power() | ||
if(WIRE_STRENGTH) | ||
for(var/i = 1; i < 3; i++) | ||
C.remove_strength() | ||
if(WIRE_INTERFACE) | ||
if(!mend) | ||
C.interface_control = FALSE | ||
if(WIRE_LIMIT) | ||
C.strength_upper_limit = (mend ? 2 : 3) | ||
if(C.strength_upper_limit < C.strength) | ||
C.remove_strength() | ||
|
||
/datum/wires/particle_accelerator/control_box/emp_pulse() // to prevent singulo from pulsing wires | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
|
||
/obj/machinery/artillerycontrol | ||
var/reload = 120 | ||
var/reload_cooldown = 120 | ||
var/explosiondev = 3 | ||
var/explosionmed = 6 | ||
var/explosionlight = 12 | ||
name = "bluespace artillery control" | ||
icon_state = "control_boxp1" | ||
icon = 'icons/obj/particle_accelerator.dmi' | ||
density = TRUE | ||
|
||
/obj/machinery/artillerycontrol/process(delta_time) | ||
if(reload < reload_cooldown) | ||
reload += delta_time | ||
|
||
/obj/structure/artilleryplaceholder | ||
name = "artillery" | ||
icon = 'icons/obj/machines/artillery.dmi' | ||
anchored = TRUE | ||
density = TRUE | ||
|
||
/obj/structure/artilleryplaceholder/decorative | ||
density = FALSE | ||
|
||
/obj/machinery/artillerycontrol/ui_interact(mob/user) | ||
. = ..() | ||
var/dat = "<B>Bluespace Artillery Control:</B><BR>" | ||
dat += "Locked on<BR>" | ||
dat += "<B>Charge progress: [reload]/[reload_cooldown]:</B><BR>" | ||
dat += "<A href='byond://?src=[REF(src)];fire=1'>Open Fire</A><BR>" | ||
dat += "Deployment of weapon authorized by <br>Nanotrasen Naval Command<br><br>Remember, friendly fire is grounds for termination of your contract and life.<HR>" | ||
user << browse(dat, "window=scroll") | ||
onclose(user, "scroll") | ||
|
||
/obj/machinery/artillerycontrol/Topic(href, href_list) | ||
if(..()) | ||
return | ||
var/A | ||
A = input("Area to bombard", "Open Fire", A) in GLOB.teleportlocs | ||
var/area/thearea = GLOB.teleportlocs[A] | ||
if(usr.stat != CONSCIOUS || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED)) | ||
return | ||
if(reload < reload_cooldown) | ||
return | ||
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr)) | ||
priority_announce("Bluespace artillery fire detected. Brace for impact.") | ||
message_admins("[ADMIN_LOOKUPFLW(usr)] has launched an artillery strike.") | ||
var/list/L = list() | ||
for(var/turf/T in get_area_turfs(thearea.type)) | ||
L+=T | ||
var/loc = pick(L) | ||
explosion(loc, explosiondev, explosionmed, explosionlight) | ||
reload = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/////SINGULARITY SPAWNER | ||
/obj/machinery/the_singularitygen | ||
name = "Gravitational Singularity Generator" | ||
desc = "An odd device which produces a Gravitational Singularity when set up." | ||
icon = 'icons/obj/singularity.dmi' | ||
icon_state = "TheSingGen" | ||
anchored = FALSE | ||
density = TRUE | ||
use_power = NO_POWER_USE | ||
resistance_flags = FIRE_PROOF | ||
|
||
// You can buckle someone to the singularity generator, then start the engine. Fun! | ||
can_buckle = TRUE | ||
buckle_lying = FALSE | ||
buckle_requires_restraints = TRUE | ||
|
||
var/energy = 0 | ||
var/creation_type = /obj/singularity | ||
|
||
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params) | ||
if(W.tool_behaviour == TOOL_WRENCH) | ||
default_unfasten_wrench(user, W, 0) | ||
else | ||
return ..() | ||
|
||
/obj/machinery/the_singularitygen/process() | ||
if(energy > 0) | ||
if(energy >= 200) | ||
var/turf/T = get_turf(src) | ||
SSblackbox.record_feedback("tally", "engine_started", 1, type) | ||
var/obj/singularity/S = new creation_type(T, 50) | ||
transfer_fingerprints_to(S) | ||
qdel(src) | ||
else | ||
energy -= 1 |
63 changes: 63 additions & 0 deletions
63
code/modules/power/singularity/particle_accelerator/particle.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/obj/effect/accelerated_particle | ||
name = "Accelerated Particles" | ||
desc = "Small things moving very fast." | ||
icon = 'icons/obj/particle_accelerator.dmi' | ||
icon_state = "particle" | ||
anchored = TRUE | ||
density = FALSE | ||
var/movement_range = 20 | ||
var/energy = 10 | ||
var/speed = 1 | ||
|
||
/obj/effect/accelerated_particle/weak | ||
movement_range = 15 | ||
energy = 5 | ||
|
||
/obj/effect/accelerated_particle/strong | ||
movement_range = 25 | ||
energy = 15 | ||
|
||
/obj/effect/accelerated_particle/powerful | ||
movement_range = 30 | ||
energy = 50 | ||
|
||
|
||
/obj/effect/accelerated_particle/New(loc) | ||
..() | ||
|
||
addtimer(CALLBACK(src, .proc/move), 1) | ||
|
||
|
||
/obj/effect/accelerated_particle/Bump(atom/A) | ||
if(A) | ||
if(isliving(A)) | ||
toxmob(A) | ||
else if(istype(A, /obj/machinery/the_singularitygen)) | ||
var/obj/machinery/the_singularitygen/S = A | ||
S.energy += energy | ||
else if(istype(A, /obj/singularity)) | ||
var/obj/singularity/S = A | ||
S.energy += energy | ||
else if(istype(A, /obj/structure/blob)) | ||
var/obj/structure/blob/B = A | ||
B.take_damage(energy*0.6) | ||
movement_range = 0 | ||
|
||
/obj/effect/accelerated_particle/ex_act(severity, target) | ||
qdel(src) | ||
|
||
/obj/effect/accelerated_particle/singularity_pull() | ||
return | ||
|
||
/obj/effect/accelerated_particle/proc/toxmob(mob/living/M) | ||
M.rad_act(energy*6) | ||
|
||
/obj/effect/accelerated_particle/proc/move() | ||
if(!step(src,dir)) | ||
forceMove(get_step(src,dir)) | ||
movement_range-- | ||
if(movement_range == 0) | ||
qdel(src) | ||
else | ||
sleep(speed) | ||
move() |
Oops, something went wrong.