Merge pull request #1461 from Fox-McCloud/singulo-equipment

Singulo Equipment Cleanup and Fixes
This commit is contained in:
TheDZD
2015-07-07 19:07:12 -04:00
9 changed files with 59 additions and 65 deletions
+1
View File
@@ -10,6 +10,7 @@ var/global/list/spacepods_list = list() //list of all space pods. Used by hos
var/global/list/joblist = list() //list of all jobstypes, minus borg and AI
var/global/list/flag_list = list() //list of flags during Nations gamemode
var/global/list/airlocks = list() //list of all airlocks
var/global/list/singularities = list() //list of all singularities
var/global/list/aibots = list() // AI controlled bots
var/global/list/table_recipes = list() //list of all table craft recipes
+1 -1
View File
@@ -127,7 +127,7 @@
if(surplus() < 1500)
if(user) user << "<span class='notice'>The connected wire doesn't have enough current.</span>"
return
for(var/obj/singularity/singulo in world)
for(var/obj/singularity/singulo in singularities)
if(singulo.z == z)
singulo.target = src
icon_state = "[icontype]1"
@@ -344,10 +344,10 @@ field_generator power level display
//I want to avoid using global variables.
spawn(1)
var/temp = 1 //stops spam
for(var/obj/singularity/O in machines)
for(var/obj/singularity/O in singularities)
if(O.last_warning && temp)
if((world.time - O.last_warning) > 50) //to stop message-spam
temp = 0
msg_admin_attack("A singulo exists and a containment field has failed.",1)
investigate_log("has <font color='red'>failed</font> whilst a singulo exists.","singulo")
O.last_warning = world.time
O.last_warning = world.time
+1 -1
View File
@@ -27,7 +27,7 @@
investigate_log("[admin_message] at [x],[y],[z]","singulo")
new /obj/singularity/(T, 50)
if(src) del(src)
if(src) qdel(src)
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weapon/wrench))
@@ -8,15 +8,7 @@
anchored = 1
density = 1
var/movement_range = 10
var/energy = 10 //energy in eV
var/mega_energy = 0 //energy in MeV
var/frequency = 1
var/ionizing = 0
var/particle_type
var/additional_particles = 0
var/turf/target
var/turf/source
var/movetotarget = 1
var/energy = 10
/obj/effect/accelerated_particle/weak
movement_range = 8
@@ -26,10 +18,15 @@
movement_range = 15
energy = 15
/obj/effect/accelerated_particle/powerful
movement_range = 20
energy = 50
/obj/effect/accelerated_particle/New(loc, dir = 2)
src.loc = loc
src.dir = dir
if(movement_range > 20)
movement_range = 20
spawn(0)
@@ -43,22 +40,6 @@
toxmob(A)
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/singularity/)))
A:energy += energy
/*
else if( istype(A,/obj/effect/rust_particle_catcher) )
var/obj/effect/rust_particle_catcher/collided_catcher = A
if(particle_type && particle_type != "neutron")
if(collided_catcher.AddParticles(particle_type, 1 + additional_particles))
collided_catcher.parent.AddEnergy(energy,mega_energy)
del (src)
else if( istype(A,/obj/machinery/power/rust_core) )
var/obj/machinery/power/rust_core/collided_core = A
if(particle_type && particle_type != "neutron")
if(collided_core.AddParticles(particle_type, 1 + additional_particles))
var/energy_loss_ratio = abs(collided_core.owned_field.frequency - frequency) / 1e9
collided_core.owned_field.mega_energy += mega_energy - mega_energy * energy_loss_ratio
collided_core.owned_field.energy += energy - energy * energy_loss_ratio
del (src)
*/
return
@@ -75,35 +56,17 @@
/obj/effect/accelerated_particle/proc/toxmob(var/mob/living/M)
/*var/radiation = (energy*2)
if(istype(M,/mob/living/carbon/human))
if(M:wear_suit) //TODO: check for radiation protection
radiation = round(radiation/2,1)
if(istype(M,/mob/living/carbon/monkey))
if(M:wear_suit) //TODO: check for radiation protection
radiation = round(radiation/2,1)*/
M.apply_effect((energy*6),IRRADIATE,0)
M.updatehealth()
//M << "\red You feel odd."
return
/obj/effect/accelerated_particle/proc/move(var/lag)
if(target)
if(movetotarget)
if(!step_towards(src,target))
src.loc = get_step(src, get_dir(src,target))
if(get_dist(src,target) < 1)
movetotarget = 0
else
if(!step(src, get_step_away(src,source)))
src.loc = get_step(src, get_step_away(src,source))
else
if(!step(src,dir))
src.loc = get_step(src,dir)
if(!step(src,dir))
src.loc = get_step(src,dir)
movement_range--
if(movement_range <= 0)
del(src)
qdel(src)
else
sleep(lag)
move(lag)
@@ -71,6 +71,12 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
var/strength = null
var/desc_holder = null
/obj/structure/particle_accelerator/Destroy()
construction_state = 0
if(master)
master.part_scan()
return ..()
/obj/structure/particle_accelerator/end_cap
name = "Alpha Particle Generation Array"
desc_holder = "This is where Alpha particles are generated from \[REDACTED\]"
@@ -87,7 +93,9 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
set category = "Object"
set src in oview(1)
if (src.anchored || usr:stat)
if(usr.stat || !usr.canmove || usr.restrained())
return
if (src.anchored)
usr << "It is fastened to the floor!"
return 0
src.dir = turn(src.dir, 270)
@@ -98,7 +106,9 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
set category = "Object"
set src in oview(1)
if (src.anchored || usr:stat)
if(usr.stat || !usr.canmove || usr.restrained())
return
if (src.anchored)
usr << "It is fastened to the floor!"
return 0
src.dir = turn(src.dir, 90)
@@ -119,7 +129,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
..()
return
/obj/structure/particle_accelerator/attackby(obj/item/W, mob/user, params)
if(istool(W))
if(src.process_tool_hit(W,user))
@@ -134,6 +143,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
master.toggle_power()
investigate_log("was moved whilst active; it <font color='red'>powered down</font>.","singulo")
/obj/structure/particle_accelerator/ex_act(severity)
switch(severity)
if(1.0)
@@ -153,7 +163,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
/obj/structure/particle_accelerator/blob_act()
if(prob(50))
del(src)
qdel(src)
return
@@ -206,7 +216,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
if(iswrench(O))
if(iswrench(O) && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
src.anchored = 1
user.visible_message("[user.name] secures the [src.name] to the floor.", \
@@ -220,10 +230,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
"You remove the external bolts.")
temp_state--
else if(iscoil(O))
if(O:use(1,user))
var/obj/item/stack/cable_coil/C = O
if(C.use(1))
user.visible_message("[user.name] adds wires to the [src.name].", \
"You add some wires.")
temp_state++
else
user << "<span class='warning'>You need one length of cable to wire the [src.name]!</span>"
return
if(2)
if(iswirecutter(O))//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [src.name].", \
@@ -273,7 +287,9 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
set category = "Object"
set src in oview(1)
if (src.anchored || usr:stat)
if(usr.stat || !usr.canmove || usr.restrained())
return
if (src.anchored)
usr << "It is fastened to the floor!"
return 0
src.dir = turn(src.dir, 270)
@@ -284,7 +300,9 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
set category = "Object"
set src in oview(1)
if (src.anchored || usr:stat)
if(usr.stat || !usr.canmove || usr.restrained())
return
if (src.anchored)
usr << "It is fastened to the floor!"
return 0
src.dir = turn(src.dir, 90)
@@ -308,7 +326,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
..()
return
/obj/machinery/particle_accelerator/attackby(obj/item/W, mob/user, params)
if(istool(W))
if(src.process_tool_hit(W,user))
@@ -335,7 +352,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
/obj/machinery/particle_accelerator/blob_act()
if(prob(50))
del(src)
qdel(src)
return
@@ -1,7 +1,7 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
/obj/machinery/particle_accelerator/control_box
name = "Particle Accelerator Control Computer"
name = "Particle Accelerator Control Console"
desc = "This controls the density of the particles."
icon = 'icons/obj/machines/particle_accelerator.dmi'
icon_state = "control_box"
@@ -26,6 +26,10 @@
connected_parts = list()
..()
/obj/machinery/particle_accelerator/control_box/Destroy()
if(active)
toggle_power()
return ..()
/obj/machinery/particle_accelerator/control_box/attack_hand(mob/user as mob)
if(construction_state >= 3)
@@ -87,8 +91,10 @@
if(href_list["togglep"])
if(!wires.IsIndexCut(PARTICLE_TOGGLE_WIRE))
src.toggle_power()
else if(href_list["scan"])
src.part_scan()
else if(href_list["strengthup"])
if(!wires.IsIndexCut(PARTICLE_STRENGTH_WIRE))
add_strength()
@@ -233,9 +239,8 @@
user.set_machine(src)
var/dat = ""
dat += "Particle Accelerator Control Panel<BR>"
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR><BR>"
dat += "Status:<BR>"
dat += "<h3>Status</h3>"
if(!assembled)
dat += "Unable to detect all parts!<BR>"
dat += "<A href='?src=\ref[src];scan=1'>Run Scan</A><BR><BR>"
@@ -250,6 +255,10 @@
dat += "Particle Strength: [src.strength] "
dat += "<A href='?src=\ref[src];strengthdown=1'>--</A>|<A href='?src=\ref[src];strengthup=1'>++</A><BR><BR>"
user << browse(dat, "window=pacontrol;size=420x500")
onclose(user, "pacontrol")
//user << browse(dat, "window=pacontrol;size=420x500")
//onclose(user, "pacontrol")
var/datum/browser/popup = new(user, "pacontrol", name, 420, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
@@ -43,6 +43,8 @@
A = new/obj/effect/accelerated_particle(T, dir)
if(2)
A = new/obj/effect/accelerated_particle/strong(T, dir)
if(3)
A = new/obj/effect/accelerated_particle/powerful(T, dir)
if(A)
A.dir = src.dir
return 1
@@ -30,6 +30,7 @@
/obj/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
//CARN: admin-alert for chuckle-fuckery.
singularities += src
admin_investigate_setup()
src.energy = starting_energy
@@ -43,6 +44,7 @@
/obj/singularity/Destroy()
processing_objects.Remove(src)
singularities -= src
return ..()
/obj/singularity/Move(atom/newloc, direct)