Added Willox’s explosion code. It should make explosions faster than they have been lately.

Moved an unchecked file into unused, please put any unchecked files out of WIP or FEA into unused that way if you see an unchecked file you know it should be checked.  DM loves to uncheck files when you are messing around with folders in the editor.
Moved the old TEG defines into the proper files.
Commented out some old nonfunctioning FEA debug code.
Removed some commented out codechunks from FEA and attempted to clean up a few of the files a bit. 


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3852 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
mport2004@gmail.com
2012-06-18 01:56:24 +00:00
parent b1394e315f
commit b6f8b3fb77
11 changed files with 1632 additions and 1498 deletions

View File

@@ -116,7 +116,7 @@ obj/machinery/portable_atmospherics/canister
valve_open = 1
release_pressure = 1000
/*
obj/machinery/atmospherics
unary
heat_reservoir
@@ -352,6 +352,7 @@ obj/machinery/atmospherics
usr << "[x],[y] is in a pipeline with [parent.members.len] members ([parent.edges.len] edges)! Volume: [parent.air.volume]"
usr << "Pressure: [parent.air.return_pressure()], Temperature: [parent.air.temperature]"
usr << "[parent.air.oxygen], [parent.air.toxins], [parent.air.nitrogen], [parent.air.carbon_dioxide] .. [parent.alert_pressure]"
*/
mob
verb
flag_all_pipe_networks()

View File

@@ -1,38 +1,21 @@
datum
air_group
var/tmp/group_processing = 1 //Processing all tiles as one large tile if 1
datum/air_group
var/group_processing = 1 //Processing all tiles as one large tile if 1
var/tmp/datum/gas_mixture/air = new
var/datum/gas_mixture/air = new
var/tmp/current_cycle = 0 //cycle that oxygen value represents
var/tmp/archived_cycle = 0 //cycle that oxygen_archived value represents
var/current_cycle = 0 //cycle that oxygen value represents
var/archived_cycle = 0 //cycle that oxygen_archived value represents
//The use of archived cycle saves processing power by permitting the archiving step of FET
// to be rolled into the updating step
//optimization vars
var/tmp/next_check = 0 //number of ticks before this group updates
var/tmp/check_delay = 10 //number of ticks between updates, starts fairly high to get boring groups out of the way
var/next_check = 0 //number of ticks before this group updates
var/check_delay = 10 //number of ticks between updates, starts fairly high to get boring groups out of the way
proc
archive()
members()
proc/members()
//Returns the members of the group
proc/process_group()
check_regroup()
//If individually processing tiles, checks all member tiles to see if they are close enough
// that the group may resume group processing
//Warning: Do not call, called by air_master.process()
process_group()
suspend_group_processing()
update_group_from_tiles()
//Copy group air information to individual tile air
//Used right before turning on group processing
update_tiles_from_group()
//Copy group air information to individual tile air
//Used right before turning off group processing
var/list/borders //Tiles that connect this group to other groups/individual tiles
var/list/members //All tiles in this group
@@ -40,38 +23,47 @@ datum
var/list/space_borders
var/length_space_border = 0
suspend_group_processing()
proc/suspend_group_processing()
group_processing = 0
update_tiles_from_group()
check_delay=0
next_check=0
update_group_from_tiles()
//Copy group air information to individual tile air
//Used right before turning on group processing
proc/update_group_from_tiles()
var/sample_member = pick(members)
var/datum/gas_mixture/sample_air = sample_member:air
air.copy_from(sample_air)
air.group_multiplier = members.len
return 1
update_tiles_from_group()
//Copy group air information to individual tile air
//Used right before turning off group processing
proc/update_tiles_from_group()
for(var/member in members)
member:air.copy_from(air)
if (istype(member,/turf/simulated))
var/turf/simulated/turfmem=member
turfmem.reset_delay()
archive()
proc/archive()
air.archive()
archived_cycle = air_master.current_cycle
check_regroup()
//If individually processing tiles, checks all member tiles to see if they are close enough that the group may resume group processing
//Warning: Do not call, called by air_master.process()
proc/check_regroup()
//Purpose: Checks to see if group processing should be turned back on
//Returns: group_processing
if(group_processing) return 1
var/turf/simulated/sample = pick(members)
for(var/member in members)
if(member:active_hotspot)
@@ -82,12 +74,17 @@ datum
update_group_from_tiles()
group_processing = 1
return 1
//Look into this
turf/process_group()
current_cycle = air_master.current_cycle
if(group_processing) //See if processing this group as a group
if(!group_processing) //Revert to individual processing then end
for(var/turf/simulated/member in members)
member.process_cell()
return
//check if we're skipping this tick
if (next_check > 0)
next_check--
@@ -108,22 +105,9 @@ datum
//But only if another group didn't store it for us
for(var/turf/simulated/border_tile in src.borders)
//var/obj/movable/floor/movable_on_me = locate(/obj/movable/floor) in border_tile
for(var/direction in cardinal) //Go through all border tiles and get bordering groups and individuals
if(border_tile.group_border&direction)
var/turf/simulated/enemy_tile = get_step(border_tile, direction) //Add found tile to appropriate category
//var/obj/movable/floor/movable_on_enemy
//if(!movable_on_me)
// movable_on_enemy = locate(/obj/movable/floor) in enemy_tile
/*if(movable_on_enemy) //guaranteed !movable_on_me if this is set
if(movable_on_enemy.parent && movable_on_enemy.parent.group_processing)
border_group += movable_on_enemy.parent
enemies += movable_on_enemy
self_group_borders += border_tile
else
border_individual += movable_on_enemy
self_tile_borders += border_tile
else*/
if(istype(enemy_tile) && enemy_tile.parent && enemy_tile.parent.group_processing)
border_group += enemy_tile.parent
enemies += enemy_tile
@@ -224,21 +208,20 @@ datum
member.update_visuals(air)
if(!group_processing) //Revert to individual processing
for(var/turf/simulated/member in members)
member.process_cell()
else
if(air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
for(var/turf/simulated/member in members)
member.hotspot_expose(air.temperature, CELL_VOLUME)
member.consider_superconductivity(starting=1)
air.react()
return
object/process_group()
current_cycle = air_master.current_cycle
if(group_processing) //See if processing this group as a group
if(!group_processing) return //See if processing this group as a group
var/turf/simulated/list/border_individual = list()
var/datum/air_group/list/border_group = list()
@@ -250,28 +233,7 @@ datum
archive()
//Archive air data for use in calculations
//But only if another group didn't store it for us
/*
for(var/obj/movable/floor/border_tile in src.borders)
for(var/direction in list(NORTH,SOUTH,EAST,WEST)) //Go through all border tiles and get bordering groups and individuals
if(border_tile.group_border&direction)
var/turf/simulated/enemy_tile = get_step(border_tile, direction) //Add found tile to appropriate category
var/obj/movable/floor/movable_on_enemy = locate(/obj/movable/floor) in enemy_tile
if(movable_on_enemy)
if(movable_on_enemy.parent && movable_on_enemy.parent.group_processing)
border_group += movable_on_enemy.parent
enemies += movable_on_enemy
enemy_index++
else
border_individual += movable_on_enemy
else
if(istype(enemy_tile) && enemy_tile.parent && enemy_tile.parent.group_processing)
border_group += enemy_tile.parent
enemies += enemy_tile
enemy_index++
else
border_individual += enemy_tile
*/
enemy_index = 1
var/abort_group = 0
for(var/datum/air_group/AG in border_group)
@@ -313,3 +275,5 @@ datum
if(abort_group)
suspend_group_processing()
return

View File

@@ -1,15 +1,14 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
atom
proc
temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
/atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return null
turf
proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
simulated
hotspot_expose(exposed_temperature, exposed_volume, soh)
/turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
/turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
var/datum/gas_mixture/air_contents = return_air()
if(!air_contents)
return 0
@@ -46,35 +45,27 @@ turf
return igniting
obj
effect/hotspot
//Icon for fire on turfs, also helps for nurturing small fires until they are full tile
//This is the icon for fire on turfs, also helps for nurturing small fires until they are full tile
/obj/effect/hotspot
anchored = 1
mouse_opacity = 0
unacidable = 1//So you can't melt fire with acid.
//luminosity = 3
icon = 'fire.dmi'
icon_state = "1"
layer = TURF_LAYER
var/volume = 125
var/temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
var/just_spawned = 1
var/bypassing = 0
proc/perform_exposure()
var/turf/simulated/floor/location = loc
if(!istype(location))
return 0
if(!istype(location)) return 0
if(volume > CELL_VOLUME*0.95)
bypassing = 1
if(volume > CELL_VOLUME*0.95) bypassing = 1
else bypassing = 0
if(bypassing)
@@ -83,18 +74,16 @@ obj
temperature = location.air.temperature
else
var/datum/gas_mixture/affected = location.air.remove_ratio(volume/location.air.volume)
affected.temperature = temperature
affected.react()
temperature = affected.temperature
volume = affected.fuel_burnt*FIRE_GROWTH_RATE
location.assume_air(affected)
for(var/atom/item in loc)
item.temperature_expose(null, temperature, volume)
return 0
process(turf/simulated/list/possible_spread)
if(just_spawned)
@@ -111,7 +100,6 @@ obj
if(location.air.toxins < 0.5 || location.air.oxygen < 0.5)
del(src)
perform_exposure()
if(location.wet) location.wet = 0
@@ -142,13 +130,15 @@ obj
/*if(prob(25))
location.ReplaceWithSpace()
return 0*/
return 1
New()
..()
dir = pick(cardinal)
sd_SetLuminosity(3)
return
Del()
if (istype(loc, /turf/simulated))
@@ -156,8 +146,6 @@ obj
loc:active_hotspot = null
src.sd_SetLuminosity(0)
if(T.to_be_destroyed)
var/chance_of_deletion
if (T.heat_capacity) //beware of division by zero
@@ -171,5 +159,5 @@ obj
T.max_fire_temperature_sustained = 0
loc = null
..()
return

View File

@@ -13,8 +13,7 @@ What are the archived variables for?
#define MINIMUM_HEAT_CAPACITY 0.0003
#define QUANTIZE(variable) (round(variable,0.0001))
datum
gas
/datum/gas
sleeping_agent
specific_heat = 40
@@ -30,80 +29,84 @@ datum
moles_archived = 0
gas_mixture
var
oxygen = 0
carbon_dioxide = 0
nitrogen = 0
toxins = 0
volume = CELL_VOLUME
/datum/gas_mixture
var/oxygen = 0
var/carbon_dioxide = 0
var/nitrogen = 0
var/toxins = 0
temperature = 0 //in Kelvin, use calculate_temperature() to modify
var/volume = CELL_VOLUME
var/temperature = 0 //in Kelvin, use calculate_temperature() to modify
var/group_multiplier = 1
//Size of the group this gas_mixture is representing.
//=1 for singletons
graphic
var/graphic
var/list/datum/gas/trace_gases = list()
tmp
oxygen_archived
carbon_dioxide_archived
nitrogen_archived
toxins_archived
temperature_archived
var/tmp/oxygen_archived
var/tmp/carbon_dioxide_archived
var/tmp/nitrogen_archived
var/tmp/toxins_archived
graphic_archived
fuel_burnt = 0
var/tmp/temperature_archived
proc //PV=nRT - related procedures
heat_capacity()
var/tmp/graphic_archived
var/tmp/fuel_burnt = 0
//PV=nRT - related procedures
proc/heat_capacity()
var/heat_capacity = HEAT_CAPACITY_CALCULATION(oxygen,carbon_dioxide,nitrogen,toxins)
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
heat_capacity += trace_gas.moles*trace_gas.specific_heat
return heat_capacity
heat_capacity_archived()
proc/heat_capacity_archived()
var/heat_capacity_archived = HEAT_CAPACITY_CALCULATION(oxygen_archived,carbon_dioxide_archived,nitrogen_archived,toxins_archived)
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
heat_capacity_archived += trace_gas.moles_archived*trace_gas.specific_heat
return heat_capacity_archived
total_moles()
proc/total_moles()
var/moles = oxygen + carbon_dioxide + nitrogen + toxins
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
moles += trace_gas.moles
return moles
return_pressure()
proc/return_pressure()
if(volume>0)
return total_moles()*R_IDEAL_GAS_EQUATION*temperature/volume
return 0
return_temperature()
proc/return_temperature()
return temperature
return_volume()
proc/return_volume()
return max(0, volume)
thermal_energy()
proc/thermal_energy()
return temperature*heat_capacity()
proc //Procedures used for very specific events
check_tile_graphic()
//Procedures used for very specific events
proc/check_tile_graphic()
//returns 1 if graphic changed
graphic = null
if(toxins > MOLES_PLASMA_VISIBLE)
@@ -117,7 +120,7 @@ datum
return graphic != graphic_archived
react(atom/dump_location)
proc/react(atom/dump_location)
var/reacting = 0 //set to 1 if a notable reaction occured (used by pipe_network)
if(trace_gases.len > 0)
@@ -145,7 +148,7 @@ datum
return reacting
fire()
proc/fire()
var/energy_released = 0
var/old_heat_capacity = heat_capacity()
@@ -198,51 +201,50 @@ datum
return fuel_burnt
proc
archive()
proc/archive()
//Update archived versions of variables
//Returns: 1 in all cases
merge(datum/gas_mixture/giver)
proc/merge(datum/gas_mixture/giver)
//Merges all air from giver into self. Deletes giver.
//Returns: 1 on success (no failure cases yet)
check_then_merge(datum/gas_mixture/giver)
proc/check_then_merge(datum/gas_mixture/giver)
//Similar to merge(...) but first checks to see if the amount of air assumed is small enough
// that group processing is still accurate for source (aborts if not)
//Returns: 1 on successful merge, 0 if the check failed
remove(amount)
proc/remove(amount)
//Proportionally removes amount of gas from the gas_mixture
//Returns: gas_mixture with the gases removed
remove_ratio(ratio)
proc/remove_ratio(ratio)
//Proportionally removes amount of gas from the gas_mixture
//Returns: gas_mixture with the gases removed
subtract(datum/gas_mixture/right_side)
proc/subtract(datum/gas_mixture/right_side)
//Subtracts right_side from air_mixture. Used to help turfs mingle
check_then_remove(amount)
proc/check_then_remove(amount)
//Similar to remove(...) but first checks to see if the amount of air removed is small enough
// that group processing is still accurate for source (aborts if not)
//Returns: gas_mixture with the gases removed or null
copy_from(datum/gas_mixture/sample)
proc/copy_from(datum/gas_mixture/sample)
//Copies variables from sample
share(datum/gas_mixture/sharer)
proc/share(datum/gas_mixture/sharer)
//Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length
//Return: amount of gas exchanged (+ if sharer received)
mimic(turf/model)
proc/mimic(turf/model)
//Similar to share(...), except the model is not modified
//Return: amount of gas exchanged
check_gas_mixture(datum/gas_mixture/sharer)
proc/check_gas_mixture(datum/gas_mixture/sharer)
//Returns: 0 if the self-check failed then -1 if sharer-check failed then 1 if both checks pass
check_turf(turf/model)
proc/check_turf(turf/model)
//Returns: 0 if self-check failed or 1 if check passes
// check_me_then_share(datum/gas_mixture/sharer)
@@ -261,22 +263,22 @@ datum
//Returns: 0 if the self-check failed then -1 if sharer-check failed then 1 if successful share
temperature_mimic(turf/model, conduction_coefficient)
proc/temperature_mimic(turf/model, conduction_coefficient)
temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
proc/temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
proc/temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
check_me_then_temperature_mimic(turf/model, conduction_coefficient)
proc/check_me_then_temperature_mimic(turf/model, conduction_coefficient)
check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
proc/check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
proc/check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
proc/check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
compare(datum/gas_mixture/sample)
proc/compare(datum/gas_mixture/sample)
//Compares sample to self to see if within acceptable ranges that group processing may be enabled
archive()
@@ -456,24 +458,6 @@ datum
return 1
/* check_me_then_share(datum/gas_mixture/sharer)
var/delta_oxygen = (oxygen_archived - sharer.oxygen_archived)/5
var/delta_carbon_dioxide = (carbon_dioxide_archived - sharer.carbon_dioxide_archived)/5
var/delta_nitrogen = (nitrogen_archived - sharer.nitrogen_archived)/5
var/delta_toxins = (toxins_archived - sharer.toxins_archived)/5
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
if(((abs(delta_oxygen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_oxygen) >= oxygen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_carbon_dioxide) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_carbon_dioxide) >= carbon_dioxide_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_nitrogen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_nitrogen) >= nitrogen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_toxins) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_toxins) >= toxins_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)))
return 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
return 0
return share(sharer)*/
check_gas_mixture(datum/gas_mixture/sharer)
if(!sharer) return 0
var/delta_oxygen = (oxygen_archived - sharer.oxygen_archived)/5

View File

@@ -334,31 +334,6 @@
directwired = 0 // must have a cable on same turf connecting to terminal
layer = 2.6 // a bit above wires
/obj/machinery/power/generator
name = "thermoelectric generator"
desc = "It's a high efficiency thermoelectric generator."
icon_state = "teg"
anchored = 1
density = 1
var/obj/machinery/atmospherics/binary/circulator/circ1
var/obj/machinery/atmospherics/binary/circulator/circ2
var/lastgen = 0
var/lastgenlev = -1
/obj/machinery/power/generator_type2
name = "thermoelectric generator"
desc = "It's a high efficiency thermoelectric generator."
icon_state = "teg"
anchored = 1
density = 1
var/obj/machinery/atmospherics/unary/generator_input/input1
var/obj/machinery/atmospherics/unary/generator_input/input2
var/lastgen = 0
var/lastgenlev = -1
/obj/machinery/power/monitor
name = "power monitoring computer"

View File

@@ -33,6 +33,15 @@
return 0 //not in range and not telekinetic
/proc/circledistance(center=usr, T) // T is just the second atom to check distance to center with
var/turf/centerturf = get_turf(center)
var/turf/targetturf = get_turf(T)
var/dx2 = (targetturf.x - centerturf.x)**2
var/dy2 = (targetturf.y - centerturf.y)**2
return sqrt(dx2 + dy2)
/proc/circlerange(center=usr,radius=3)
var/turf/centerturf = get_turf(center)
@@ -98,6 +107,7 @@
return turfs
/proc/get_mobs_in_view(var/R, var/atom/source)
// Returns a list of mobs in range of R from source. Used in radio and say code.

View File

@@ -1,14 +1,20 @@
var/roundExplosions = 1
var/roundExplosions = 1 // If anyone else gets confused this means round as in circle, not the game round
//TODO: Flash range does nothing currently
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
if(!epicenter) return
spawn(0)
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1
if (!istype(epicenter, /turf))
epicenter = get_turf(epicenter.loc)
playsound(epicenter.loc, 'explosionfar.ogg', 100, 1, round(devastation_range*2,1) )
playsound(epicenter.loc, "explosion", 100, 1, round(devastation_range,1) )
if (adminlog)
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
@@ -20,62 +26,52 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
E.set_up(epicenter)
E.start()
var/list/dTurfs = list() //Holds the turfs in devestation range.
var/list/hTurfs = list() //Holds the turfs in heavy impact range, minus turfs in devestation range.
var/list/lTurfs = list() //Holds the turfs in light impact range, minus turfs in devestation range and heavy impact range.
var/list/fTurfs = list() //Holds turfs to loop through for mobs to flash. (Hehehe, dirty)
var/list/expTurfs = list() // All turfs being affected by the explosion (not flash range)
if(roundExplosions)
fTurfs = circlerangeturfs(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range))
dTurfs = circlerangeturfs(epicenter,devastation_range)
hTurfs = circlerangeturfs(epicenter,heavy_impact_range) - dTurfs
lTurfs = circlerangeturfs(epicenter,light_impact_range) - dTurfs - hTurfs
expTurfs = circlerangeturfs(epicenter, max(devastation_range, heavy_impact_range, light_impact_range))
else
fTurfs = range(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range))
dTurfs = range(epicenter,devastation_range)
hTurfs = range(epicenter,heavy_impact_range) - dTurfs
lTurfs = range(epicenter,light_impact_range) - dTurfs - hTurfs
expTurfs = range(epicenter, max(devastation_range, heavy_impact_range, light_impact_range))
// Hello future editors, please note that 1000 calls to spawn will not speed this up, but this exact amount has been tested
// Now, tonnes of calls to spawn will allow other stuff to happen, but I believe we may as well let explosions
// Get over with and blow up like an explosion would
var/list/dTurfs = list()
var/list/hTurfs = list()
var/list/lTurfs = list()
for(var/turf/T in expTurfs) // This doesn't slow it down at all, even 100,100,100 bombs
var/dist = circledistance(epicenter, T)
if(dist < devastation_range)
dTurfs.Add(T)
else if(dist < heavy_impact_range)
hTurfs.Add(T)
else // The expTurfs list only has turfs that are in it's range, so no if here for light_impact
lTurfs.Add(T)
spawn()
for(var/mob/living/carbon/mob in fTurfs)
flick("flash", mob:flash)
for(var/turf/T in dTurfs) //Loop through the turfs in devestation range.
spawn() //Try to pop each turf into it's own thread, speed things along.
if(T) //Sanity checking.
//Now, the actual explosion stuff happens.
if(prob(5))
for(var/turf/T in dTurfs)
if(prob(10))
T.ex_act(2)
else
T.ex_act(1)
for(var/atom/object in T.contents)
spawn()
if(object)
object.ex_act(1)
for(var/turf/T in hTurfs)
spawn()
if(T)
if(prob(15) && devastation_range > 2 && heavy_impact_range > 2)
secondaryexplosion(T, 1)
else
for(var/turf/T in hTurfs)
T.ex_act(2)
for(var/atom/object in T.contents)
spawn()
if(object)
object.ex_act(2)
for(var/turf/T in lTurfs)
spawn()
if(T)
for(var/turf/T in lTurfs)
T.ex_act(3)
for(var/atom/object in T.contents)
spawn()
if(object)
object.ex_act(3)
sleep(-1)
sleep(20)
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0
return 1

View File

@@ -6,8 +6,21 @@
gen_amount = g
*/
/obj/machinery/power/generator
name = "thermoelectric generator"
desc = "It's a high efficiency thermoelectric generator."
icon_state = "teg"
anchored = 1
density = 1
/obj/machinery/power/generator/New()
var/obj/machinery/atmospherics/binary/circulator/circ1
var/obj/machinery/atmospherics/binary/circulator/circ2
var/lastgen = 0
var/lastgenlev = -1
New()
..()
spawn(5)
@@ -26,7 +39,7 @@
updateicon()
/obj/machinery/power/generator/proc/updateicon()
proc/updateicon()
if(stat & (NOPOWER|BROKEN))
overlays = null
@@ -38,7 +51,7 @@
#define GENRATE 800 // generator output coefficient from Q
/obj/machinery/power/generator/process()
process()
//world << "Generator process ran"
@@ -97,20 +110,18 @@
src.updateDialog()
/obj/machinery/power/generator/attack_ai(mob/user)
attack_ai(mob/user)
if(stat & (BROKEN|NOPOWER)) return
interact(user)
/obj/machinery/power/generator/attack_hand(mob/user)
attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER)) return
interact(user)
/obj/machinery/power/generator/proc/interact(mob/user)
proc/interact(mob/user)
if ( (get_dist(src, user) > 1 ) && (!istype(user, /mob/living/silicon/ai)))
user.machine = null
user << browse(null, "window=teg")
@@ -137,17 +148,17 @@
onclose(user, "teg")
return 1
/obj/machinery/power/generator/Topic(href, href_list)
..()
Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=teg")
usr.machine = null
return 0
return 1
/obj/machinery/power/generator/power_change()
power_change()
..()
updateicon()

View File

@@ -1,15 +1,28 @@
/obj/machinery/power/generator_type2/New()
..()
/obj/machinery/power/generator_type2
name = "thermoelectric generator"
desc = "It's a high efficiency thermoelectric generator."
icon_state = "teg"
anchored = 1
density = 1
var/obj/machinery/atmospherics/unary/generator_input/input1
var/obj/machinery/atmospherics/unary/generator_input/input2
var/lastgen = 0
var/lastgenlev = -1
New()
..()
spawn(5)
input1 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,WEST)
input2 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,EAST)
if(!input1 || !input2)
stat |= BROKEN
updateicon()
/obj/machinery/power/generator_type2/proc/updateicon()
proc/updateicon()
if(stat & (NOPOWER|BROKEN))
overlays = null
@@ -21,8 +34,8 @@
#define GENRATE 800 // generator output coefficient from Q
/obj/machinery/power/generator_type2/process()
process()
if(!input1 || !input2)
return
@@ -73,20 +86,19 @@
src.updateDialog()
/obj/machinery/power/generator_type2/attack_ai(mob/user)
if(stat & (BROKEN|NOPOWER)) return
attack_ai(mob/user)
if(stat & (BROKEN|NOPOWER)) return
interact(user)
/obj/machinery/power/generator_type2/attack_hand(mob/user)
attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER)) return
interact(user)
/obj/machinery/power/generator_type2/proc/interact(mob/user)
proc/interact(mob/user)
if ( (get_dist(src, user) > 1 ) && (!istype(user, /mob/living/silicon/ai)))
user.machine = null
user << browse(null, "window=teg")
@@ -113,7 +125,8 @@
onclose(user, "teg")
return 1
/obj/machinery/power/generator_type2/Topic(href, href_list)
Topic(href, href_list)
..()
if( href_list["close"] )
@@ -123,6 +136,7 @@
return 1
/obj/machinery/power/generator_type2/power_change()
power_change()
..()
updateicon()

View File

@@ -5,6 +5,197 @@
// END_INTERNALS
// BEGIN_FILE_DIR
#define FILE_DIR .
#define FILE_DIR "code"
#define FILE_DIR "code/ATMOSPHERICS"
#define FILE_DIR "code/ATMOSPHERICS/components"
#define FILE_DIR "code/ATMOSPHERICS/components/binary_devices"
#define FILE_DIR "code/ATMOSPHERICS/components/trinary_devices"
#define FILE_DIR "code/ATMOSPHERICS/components/unary"
#define FILE_DIR "code/datums"
#define FILE_DIR "code/datums/diseases"
#define FILE_DIR "code/datums/helper_datums"
#define FILE_DIR "code/datums/spells"
#define FILE_DIR "code/defines"
#define FILE_DIR "code/defines/area"
#define FILE_DIR "code/defines/mob"
#define FILE_DIR "code/defines/mob/dead"
#define FILE_DIR "code/defines/mob/living"
#define FILE_DIR "code/defines/mob/living/carbon"
#define FILE_DIR "code/defines/mob/living/silicon"
#define FILE_DIR "code/defines/obj"
#define FILE_DIR "code/defines/obj/clothing"
#define FILE_DIR "code/defines/procs"
#define FILE_DIR "code/defines/tanning"
#define FILE_DIR "code/FEA"
#define FILE_DIR "code/game"
#define FILE_DIR "code/game/area"
#define FILE_DIR "code/game/asteroid"
#define FILE_DIR "code/game/gamemodes"
#define FILE_DIR "code/game/gamemodes/blob"
#define FILE_DIR "code/game/gamemodes/changeling"
#define FILE_DIR "code/game/gamemodes/cult"
#define FILE_DIR "code/game/gamemodes/events"
#define FILE_DIR "code/game/gamemodes/events/holidays"
#define FILE_DIR "code/game/gamemodes/extended"
#define FILE_DIR "code/game/gamemodes/malfunction"
#define FILE_DIR "code/game/gamemodes/meteor"
#define FILE_DIR "code/game/gamemodes/nuclear"
#define FILE_DIR "code/game/gamemodes/revolution"
#define FILE_DIR "code/game/gamemodes/sandbox"
#define FILE_DIR "code/game/gamemodes/traitor"
#define FILE_DIR "code/game/gamemodes/wizard"
#define FILE_DIR "code/game/jobs"
#define FILE_DIR "code/game/jobs/job"
#define FILE_DIR "code/game/machinery"
#define FILE_DIR "code/game/machinery/atmoalter"
#define FILE_DIR "code/game/machinery/bots"
#define FILE_DIR "code/game/machinery/computer"
#define FILE_DIR "code/game/machinery/doors"
#define FILE_DIR "code/game/machinery/embedded_controller"
#define FILE_DIR "code/game/machinery/kitchen"
#define FILE_DIR "code/game/machinery/pipe"
#define FILE_DIR "code/game/machinery/telecomms"
#define FILE_DIR "code/game/magic"
#define FILE_DIR "code/game/magic/cultist"
#define FILE_DIR "code/game/mecha"
#define FILE_DIR "code/game/mecha/combat"
#define FILE_DIR "code/game/mecha/equipment"
#define FILE_DIR "code/game/mecha/equipment/tools"
#define FILE_DIR "code/game/mecha/equipment/weapons"
#define FILE_DIR "code/game/mecha/medical"
#define FILE_DIR "code/game/mecha/working"
#define FILE_DIR "code/game/objects"
#define FILE_DIR "code/game/objects/alien"
#define FILE_DIR "code/game/objects/closets"
#define FILE_DIR "code/game/objects/closets/secure"
#define FILE_DIR "code/game/objects/devices"
#define FILE_DIR "code/game/objects/devices/PDA"
#define FILE_DIR "code/game/objects/items"
#define FILE_DIR "code/game/objects/items/weapons"
#define FILE_DIR "code/game/objects/items/weapons/implants"
#define FILE_DIR "code/game/objects/radio"
#define FILE_DIR "code/game/objects/secstorage"
#define FILE_DIR "code/game/objects/stacks"
#define FILE_DIR "code/game/objects/storage"
#define FILE_DIR "code/game/objects/tanks"
#define FILE_DIR "code/game/vehicles"
#define FILE_DIR "code/game/vehicles/airtight"
#define FILE_DIR "code/game/verbs"
#define FILE_DIR "code/js"
#define FILE_DIR "code/modules"
#define FILE_DIR "code/modules/admin"
#define FILE_DIR "code/modules/admin/verbs"
#define FILE_DIR "code/modules/assembly"
#define FILE_DIR "code/modules/chemical"
#define FILE_DIR "code/modules/client"
#define FILE_DIR "code/modules/clothing"
#define FILE_DIR "code/modules/clothing/glasses"
#define FILE_DIR "code/modules/clothing/spacesuits"
#define FILE_DIR "code/modules/clothing/suits"
#define FILE_DIR "code/modules/clothing/uniforms"
#define FILE_DIR "code/modules/critters"
#define FILE_DIR "code/modules/critters/hivebots"
#define FILE_DIR "code/modules/detectivework"
#define FILE_DIR "code/modules/flufftext"
#define FILE_DIR "code/modules/food"
#define FILE_DIR "code/modules/maps"
#define FILE_DIR "code/modules/mining"
#define FILE_DIR "code/modules/mob"
#define FILE_DIR "code/modules/mob/dead"
#define FILE_DIR "code/modules/mob/dead/observer"
#define FILE_DIR "code/modules/mob/living"
#define FILE_DIR "code/modules/mob/living/blob"
#define FILE_DIR "code/modules/mob/living/carbon"
#define FILE_DIR "code/modules/mob/living/carbon/alien"
#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid"
#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid/caste"
#define FILE_DIR "code/modules/mob/living/carbon/alien/larva"
#define FILE_DIR "code/modules/mob/living/carbon/brain"
#define FILE_DIR "code/modules/mob/living/carbon/human"
#define FILE_DIR "code/modules/mob/living/carbon/human/Tajara"
#define FILE_DIR "code/modules/mob/living/carbon/metroid"
#define FILE_DIR "code/modules/mob/living/carbon/monkey"
#define FILE_DIR "code/modules/mob/living/silicon"
#define FILE_DIR "code/modules/mob/living/silicon/ai"
#define FILE_DIR "code/modules/mob/living/silicon/decoy"
#define FILE_DIR "code/modules/mob/living/silicon/pai"
#define FILE_DIR "code/modules/mob/living/silicon/robot"
#define FILE_DIR "code/modules/mob/new_player"
#define FILE_DIR "code/modules/mob/organ"
#define FILE_DIR "code/modules/mob/simple_animal"
#define FILE_DIR "code/modules/paperwork"
#define FILE_DIR "code/modules/power"
#define FILE_DIR "code/modules/power/antimatter"
#define FILE_DIR "code/modules/power/singularity"
#define FILE_DIR "code/modules/power/singularity/particle_accelerator"
#define FILE_DIR "code/modules/projectiles"
#define FILE_DIR "code/modules/projectiles/ammunition"
#define FILE_DIR "code/modules/projectiles/guns"
#define FILE_DIR "code/modules/projectiles/guns/energy"
#define FILE_DIR "code/modules/projectiles/guns/projectile"
#define FILE_DIR "code/modules/projectiles/projectile"
#define FILE_DIR "code/modules/recycling"
#define FILE_DIR "code/modules/research"
#define FILE_DIR "code/modules/scripting"
#define FILE_DIR "code/modules/scripting/AST"
#define FILE_DIR "code/modules/scripting/AST/Operators"
#define FILE_DIR "code/modules/scripting/Implementations"
#define FILE_DIR "code/modules/scripting/Interpreter"
#define FILE_DIR "code/modules/scripting/Parser"
#define FILE_DIR "code/modules/scripting/Scanner"
#define FILE_DIR "code/modules/security levels"
#define FILE_DIR "code/unused"
#define FILE_DIR "code/unused/beast"
#define FILE_DIR "code/unused/computer2"
#define FILE_DIR "code/unused/disease2"
#define FILE_DIR "code/unused/gamemodes"
#define FILE_DIR "code/unused/hivebot"
#define FILE_DIR "code/unused/mining"
#define FILE_DIR "code/unused/optics"
#define FILE_DIR "code/unused/pda2"
#define FILE_DIR "code/unused/powerarmor"
#define FILE_DIR "code/unused/spacecraft"
#define FILE_DIR "code/WorkInProgress"
#define FILE_DIR "code/WorkInProgress/BS12"
#define FILE_DIR "code/WorkInProgress/mapload"
#define FILE_DIR "code/WorkInProgress/organs"
#define FILE_DIR "code/WorkInProgress/virus2"
#define FILE_DIR "html"
#define FILE_DIR "icons"
#define FILE_DIR "icons/48x48"
#define FILE_DIR "icons/effects"
#define FILE_DIR "icons/mecha"
#define FILE_DIR "icons/misc"
#define FILE_DIR "icons/mob"
#define FILE_DIR "icons/obj"
#define FILE_DIR "icons/obj/assemblies"
#define FILE_DIR "icons/obj/atmospherics"
#define FILE_DIR "icons/obj/clothing"
#define FILE_DIR "icons/obj/doors"
#define FILE_DIR "icons/obj/machines"
#define FILE_DIR "icons/obj/pipes"
#define FILE_DIR "icons/pda_icons"
#define FILE_DIR "icons/spideros_icons"
#define FILE_DIR "icons/Testing"
#define FILE_DIR "icons/turf"
#define FILE_DIR "icons/unused"
#define FILE_DIR "icons/vehicles"
#define FILE_DIR "icons/vending_icons"
#define FILE_DIR "interface"
#define FILE_DIR "maps"
#define FILE_DIR "maps/RandomZLevels"
#define FILE_DIR "sound"
#define FILE_DIR "sound/AI"
#define FILE_DIR "sound/ambience"
#define FILE_DIR "sound/effects"
#define FILE_DIR "sound/hallucinations"
#define FILE_DIR "sound/items"
#define FILE_DIR "sound/machines"
#define FILE_DIR "sound/mecha"
#define FILE_DIR "sound/misc"
#define FILE_DIR "sound/piano"
#define FILE_DIR "sound/voice"
#define FILE_DIR "sound/weapons"
// END_FILE_DIR
// BEGIN_PREFERENCES