mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-17 05:31:53 +00:00
- Added N20 scrubbing option to scrubbers.
- Implemented gauss distribution for asteroid generation (may come in handy for other things, so made it a global proc). - Exosuit fixes. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@406 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
|
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
|
||||||
var/scrub_CO2 = 1
|
var/scrub_CO2 = 1
|
||||||
var/scrub_Toxins = 0
|
var/scrub_Toxins = 0
|
||||||
|
var/scrub_N2O = 0
|
||||||
|
|
||||||
var/volume_rate = 120
|
var/volume_rate = 120
|
||||||
var/panic = 0 //is this scrubber panicked?
|
var/panic = 0 //is this scrubber panicked?
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
signal.data["panic"] = panic
|
signal.data["panic"] = panic
|
||||||
signal.data["filter_co2"] = scrub_CO2
|
signal.data["filter_co2"] = scrub_CO2
|
||||||
signal.data["filter_toxins"] = scrub_Toxins
|
signal.data["filter_toxins"] = scrub_Toxins
|
||||||
|
signal.data["filter_n2o"] = scrub_N2O
|
||||||
radio_connection.post_signal(src, signal)
|
radio_connection.post_signal(src, signal)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
@@ -92,6 +94,10 @@
|
|||||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||||
removed.trace_gases -= trace_gas
|
removed.trace_gases -= trace_gas
|
||||||
filtered_out.trace_gases += trace_gas
|
filtered_out.trace_gases += trace_gas
|
||||||
|
else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
|
||||||
|
removed.trace_gases -= trace_gas
|
||||||
|
filtered_out.trace_gases += trace_gas
|
||||||
|
|
||||||
|
|
||||||
//Remix the resulting gases
|
//Remix the resulting gases
|
||||||
air_contents.merge(filtered_out)
|
air_contents.merge(filtered_out)
|
||||||
@@ -138,6 +144,8 @@
|
|||||||
scrub_CO2 = !scrub_CO2
|
scrub_CO2 = !scrub_CO2
|
||||||
if("toggle_tox_scrub")
|
if("toggle_tox_scrub")
|
||||||
scrub_Toxins = !scrub_Toxins
|
scrub_Toxins = !scrub_Toxins
|
||||||
|
if("toggle_n2o_scrub")
|
||||||
|
scrub_N2O = !scrub_N2O
|
||||||
if("toggle_panic_siphon")
|
if("toggle_panic_siphon")
|
||||||
panic = !panic
|
panic = !panic
|
||||||
if(panic)
|
if(panic)
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
proc/spawn_asteroid(var/atom/start_loc,var/type,var/size)//type: 0 or null - random, 1 - nothing, 2 - iron, 3 - silicon
|
proc/spawn_asteroid(var/atom/start_loc,var/type,var/size,var/richness)//type: 0 or null - random, 1 - nothing, 2 - iron, 3 - silicon
|
||||||
|
if(start_loc.x - size < 3 || start_loc.x + size >= world.maxx - 3 || start_loc.y - size < 3 || start_loc.y + size > world.maxy -3)
|
||||||
|
return 0
|
||||||
if(!size)
|
if(!size)
|
||||||
size = pick(100;2,50;3,35;4,25;6,10;12)
|
size = pick(100;2,50;3,35;4,25;6,10;12)
|
||||||
if(!type)
|
if(!type)
|
||||||
type = pick(50;1,2,3)
|
type = pick(50;1,2,3)
|
||||||
|
if(!richness)
|
||||||
|
richness = rand(10,40)
|
||||||
// world << "Asteroid size: [size]; Asteroid type: [type]"
|
// world << "Asteroid size: [size]; Asteroid type: [type]"
|
||||||
if(start_loc.x - size < 3 || start_loc.x + size >= world.maxx - 3 || start_loc.y - size < 3 || start_loc.y + size > world.maxy -3)
|
|
||||||
return 0
|
|
||||||
var/list/turfs = circlerange(start_loc,size)
|
var/list/turfs = circlerange(start_loc,size)
|
||||||
|
var/area/asteroid/AstAr = new
|
||||||
for(var/turf/T in turfs)
|
for(var/turf/T in turfs)
|
||||||
var/dist = get_dist(start_loc,T)
|
var/dist = get_dist(start_loc,T)
|
||||||
if(prob(100-(dist*rand(2,4))))//I'm terrible at generating random things.
|
if(abs(GaussRand(dist))<size) //prob(100-(dist*rand(2,4))))//I'm terrible at generating random things.
|
||||||
var/turf/simulated/wall/asteroid/A
|
var/turf/simulated/wall/asteroid/A
|
||||||
if(type > 1 && prob(25))
|
if(type > 1 && prob(richness))
|
||||||
switch(type)
|
switch(type)
|
||||||
if(2)
|
if(2)
|
||||||
A = new /turf/simulated/wall/asteroid/iron(T)
|
A = new /turf/simulated/wall/asteroid/iron(T)
|
||||||
@@ -21,6 +24,7 @@ proc/spawn_asteroid(var/atom/start_loc,var/type,var/size)//type: 0 or null - ran
|
|||||||
A = new /turf/simulated/wall/asteroid(T)
|
A = new /turf/simulated/wall/asteroid(T)
|
||||||
A.opacity = 0
|
A.opacity = 0
|
||||||
A.sd_NewOpacity(1)
|
A.sd_NewOpacity(1)
|
||||||
|
AstAr.contents += A
|
||||||
/*
|
/*
|
||||||
if(max_secret_rooms && size == 12)
|
if(max_secret_rooms && size == 12)
|
||||||
var/x_len = rand(4,12)
|
var/x_len = rand(4,12)
|
||||||
@@ -114,3 +118,13 @@ proc/spawn_room(var/atom/start_loc,var/x_size,var/y_size,var/wall,var/floor)
|
|||||||
var/global/max_secret_rooms = 3
|
var/global/max_secret_rooms = 3
|
||||||
|
|
||||||
|
|
||||||
|
proc/GaussRand(var/sigma)
|
||||||
|
var/x,y,rsq
|
||||||
|
do
|
||||||
|
x=2*rand()-1
|
||||||
|
y=2*rand()-1
|
||||||
|
rsq=x*x+y*y
|
||||||
|
while(rsq>1 || !rsq)
|
||||||
|
return sigma*y*sqrt((-2*log(rsq))/rsq)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
sensor_part += {"<B>Operating:</B> <A href='?src=\ref[src];scr_toggle_power=[id_tag]'>[(data["on"]?"on":"off")]</A><BR>
|
sensor_part += {"<B>Operating:</B> <A href='?src=\ref[src];scr_toggle_power=[id_tag]'>[(data["on"]?"on":"off")]</A><BR>
|
||||||
<B>Type:</B> <A href='?src=\ref[src];scr_toggle_scrubbing=[id_tag]'>[(data["scrubbing"]?"scrubbing":"syphoning")]</A><BR>"}
|
<B>Type:</B> <A href='?src=\ref[src];scr_toggle_scrubbing=[id_tag]'>[(data["scrubbing"]?"scrubbing":"syphoning")]</A><BR>"}
|
||||||
if(data["scrubbing"])
|
if(data["scrubbing"])
|
||||||
sensor_part += "<B>Filtering:</B> Carbon Dioxide <A href='?src=\ref[src];scr_toggle_co2_scrub=[id_tag]'>([(data["filter_co2"]?"on":"off")])</A>; Toxins <A href='?src=\ref[src];scr_toggle_tox_scrub=[id_tag]'>([data["filter_toxins"]?"on":"off"])</A><BR>"
|
sensor_part += "<B>Filtering:</B> Carbon Dioxide <A href='?src=\ref[src];scr_toggle_co2_scrub=[id_tag]'>([(data["filter_co2"]?"on":"off")])</A>; Toxins <A href='?src=\ref[src];scr_toggle_tox_scrub=[id_tag]'>([data["filter_toxins"]?"on":"off"])</A>; Nitrous Oxide <A href='?src=\ref[src];scr_toggle_n2o_scrub=[id_tag]'>([data["filter_n2o"]?"on":"off"])</A><BR>"
|
||||||
sensor_part += "<A href='?src=\ref[src];scr_toggle_panic_siphon=[id_tag]'><font color='[(data["panic"]?"blue'>Dea":"red'>A")]ctivate panic syphon</A></font><BR>"
|
sensor_part += "<A href='?src=\ref[src];scr_toggle_panic_siphon=[id_tag]'><font color='[(data["panic"]?"blue'>Dea":"red'>A")]ctivate panic syphon</A></font><BR>"
|
||||||
if(data["panic"])
|
if(data["panic"])
|
||||||
sensor_part += "<font color='red'><B>PANIC SYPHON ACTIVATED</B></font>"
|
sensor_part += "<font color='red'><B>PANIC SYPHON ACTIVATED</B></font>"
|
||||||
@@ -143,6 +143,9 @@
|
|||||||
if(href_list["scr_toggle_tox_scrub"])
|
if(href_list["scr_toggle_tox_scrub"])
|
||||||
send_signal(href_list["scr_toggle_tox_scrub"], "toggle_tox_scrub")
|
send_signal(href_list["scr_toggle_tox_scrub"], "toggle_tox_scrub")
|
||||||
|
|
||||||
|
if(href_list["scr_toggle_n2o_scrub"])
|
||||||
|
send_signal(href_list["scr_toggle_n2o_scrub"], "toggle_n2o_scrub")
|
||||||
|
|
||||||
if(href_list["scr_toggle_panic_siphon"])
|
if(href_list["scr_toggle_panic_siphon"])
|
||||||
send_signal(href_list["scr_toggle_panic_siphon"], "toggle_panic_siphon")
|
send_signal(href_list["scr_toggle_panic_siphon"], "toggle_panic_siphon")
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
/obj/mecha/combat/click_action(target)
|
/obj/mecha/combat/click_action(target)
|
||||||
if(state || !cell || cell.charge<=0) return
|
if(state || !cell || cell.charge<=0) return
|
||||||
|
if(src == target) return
|
||||||
if(get_dist(src,target)<=1)
|
if(get_dist(src,target)<=1)
|
||||||
src.mega_punch(target)
|
src.mega_punch(target)
|
||||||
|
|
||||||
@@ -94,7 +95,6 @@
|
|||||||
|
|
||||||
playsound(src, 'Laser.ogg', 50, 1)
|
playsound(src, 'Laser.ogg', 50, 1)
|
||||||
if (targloc == curloc)
|
if (targloc == curloc)
|
||||||
src.bullet_act(PROJECTILE_PULSE)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
var/obj/beam/a_laser/A = new weapon_type(src.loc)
|
var/obj/beam/a_laser/A = new weapon_type(src.loc)
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
icon_state = "gygax"
|
icon_state = "gygax"
|
||||||
step_in = 8
|
step_in = 8
|
||||||
|
|
||||||
weapon_1 = /obj/beam/a_laser/pulse_laser
|
weapon_1 = "/obj/beam/a_laser/pulse_laser"
|
||||||
weapon_1_cooldown = 50
|
weapon_1_cooldown = 50
|
||||||
weapon_1_name = "eZ-13 mk2 Heavy pulse rifle"
|
weapon_1_name = "eZ-13 mk2 Heavy pulse rifle"
|
||||||
weapon_1_energy_drain = 50
|
weapon_1_energy_drain = 50
|
||||||
weapon_2 = /obj/beam/a_laser
|
weapon_2 = "/obj/beam/a_laser"
|
||||||
weapon_2_cooldown = 10
|
weapon_2_cooldown = 10
|
||||||
weapon_2_name = "CH-PS \"Immolator\" Laser"
|
weapon_2_name = "CH-PS \"Immolator\" Laser"
|
||||||
weapon_2_energy_drain = 20
|
weapon_2_energy_drain = 20
|
||||||
|
|||||||
@@ -69,21 +69,14 @@
|
|||||||
return 0
|
return 0
|
||||||
if(state || !cell || cell.charge<=0) return 0
|
if(state || !cell || cell.charge<=0) return 0
|
||||||
if(can_move)
|
if(can_move)
|
||||||
if(istype(src.loc, /turf/space))
|
|
||||||
var/new_pos = get_step(src,direction)
|
|
||||||
/* world << "Next pos = [new_pos]"
|
|
||||||
|
|
||||||
var/turf = locate(new_pos)
|
|
||||||
world << "Turf is [turf]"*/
|
|
||||||
if(istype(new_pos, /turf/space))
|
|
||||||
if(!src.check_for_support())
|
|
||||||
src.inertia_dir = direction
|
|
||||||
src.inertial_movement()
|
|
||||||
return 0
|
|
||||||
if(step(src,direction))
|
if(step(src,direction))
|
||||||
can_move = 0
|
can_move = 0
|
||||||
spawn(step_in) can_move = 1
|
spawn(step_in) can_move = 1
|
||||||
cell.use(src.step_energy_drain)
|
cell.use(src.step_energy_drain)
|
||||||
|
if(istype(src.loc, /turf/space))
|
||||||
|
if(!src.check_for_support())
|
||||||
|
src.inertia_dir = direction
|
||||||
|
src.inertial_movement()
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -91,9 +84,11 @@
|
|||||||
if(check_for_support())
|
if(check_for_support())
|
||||||
src.inertia_dir = null
|
src.inertia_dir = null
|
||||||
if(src.inertia_dir)
|
if(src.inertia_dir)
|
||||||
step(src, src.inertia_dir)
|
if(step(src, src.inertia_dir))
|
||||||
spawn(5)
|
spawn(5)
|
||||||
.()
|
.()
|
||||||
|
else
|
||||||
|
src.inertia_dir = null
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/mecha/proc/check_for_support()
|
/obj/mecha/proc/check_for_support()
|
||||||
@@ -103,14 +98,14 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
/obj/mecha/Bump(var/atom/obstacle)
|
/obj/mecha/Bump(var/atom/obstacle)
|
||||||
src.inertia_dir = null
|
// src.inertia_dir = null
|
||||||
if(src.occupant)
|
if(src.occupant)
|
||||||
if(istype(obstacle , /obj/machinery/door))
|
if(istype(obstacle , /obj/machinery/door))
|
||||||
var/obj/machinery/door/D = obstacle
|
var/obj/machinery/door/D = obstacle
|
||||||
D.Bumped(src.occupant)
|
D.Bumped(src.occupant)
|
||||||
return
|
return
|
||||||
else
|
// else
|
||||||
obstacle.Bumped(src)
|
// obstacle.Bumped(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user