diff --git a/.gitignore b/.gitignore index aa2528a7fe..f2ce0fe4b8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ *.lk *.backup data/ +cfg/ diff --git a/.travis.yml b/.travis.yml index 9d86d85229..02174a8297 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,4 +19,5 @@ install: script: - shopt -s globstar - (! grep 'step_[xy]' maps/**/*.dmm) + - (! find nano/templates/ -type f -exec md5sum {} + | sort | uniq -D -w 32 | grep nano) - DreamMaker baystation12.dme diff --git a/baystation12.dme b/baystation12.dme index 1c47249d9b..2d7b5948f0 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -33,6 +33,7 @@ #include "code\__HELPERS\type2type.dm" #include "code\__HELPERS\unsorted.dm" #include "code\__HELPERS\vector.dm" +#include "code\_defines\chemical_effects.dm" #include "code\_onclick\adjacent.dm" #include "code\_onclick\ai.dm" #include "code\_onclick\click.dm" @@ -85,15 +86,12 @@ #include "code\ATMOSPHERICS\components\unary\unary_base.dm" #include "code\ATMOSPHERICS\components\unary\vent_pump.dm" #include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm" -#include "code\controllers\_DynamicAreaLighting_TG.dm" #include "code\controllers\autotransfer.dm" #include "code\controllers\communications.dm" #include "code\controllers\configuration.dm" #include "code\controllers\emergency_shuttle_controller.dm" -#include "code\controllers\failsafe.dm" #include "code\controllers\hooks-defs.dm" #include "code\controllers\hooks.dm" -#include "code\controllers\lighting_controller.dm" #include "code\controllers\master_controller.dm" #include "code\controllers\shuttle_controller.dm" #include "code\controllers\subsystems.dm" @@ -106,13 +104,11 @@ #include "code\controllers\Processes\event.dm" #include "code\controllers\Processes\garbage.dm" #include "code\controllers\Processes\inactivity.dm" -#include "code\controllers\Processes\lighting.dm" #include "code\controllers\Processes\machinery.dm" #include "code\controllers\Processes\mob.dm" #include "code\controllers\Processes\nanoui.dm" #include "code\controllers\Processes\obj.dm" #include "code\controllers\Processes\pipenet.dm" -#include "code\controllers\Processes\powernet.dm" #include "code\controllers\Processes\Shuttle.dm" #include "code\controllers\Processes\sun.dm" #include "code\controllers\Processes\supply.dm" @@ -214,7 +210,6 @@ #include "code\game\response_team.dm" #include "code\game\shuttle_engines.dm" #include "code\game\skincmd.dm" -#include "code\game\smoothwall.dm" #include "code\game\sound.dm" #include "code\game\supplyshuttle.dm" #include "code\game\antagonist\antagonist.dm" @@ -372,6 +367,7 @@ #include "code\game\machinery\turret_control.dm" #include "code\game\machinery\turrets.dm" #include "code\game\machinery\vending.dm" +#include "code\game\machinery\wall_frames.dm" #include "code\game\machinery\washing_machine.dm" #include "code\game\machinery\wishgranter.dm" #include "code\game\machinery\atmoalter\area_atmos_computer.dm" @@ -514,7 +510,6 @@ #include "code\game\objects\weapons.dm" #include "code\game\objects\effects\aliens.dm" #include "code\game\objects\effects\bump_teleporter.dm" -#include "code\game\objects\effects\chemsmoke.dm" #include "code\game\objects\effects\effect_system.dm" #include "code\game\objects\effects\explosion_particles.dm" #include "code\game\objects\effects\gibs.dm" @@ -527,6 +522,9 @@ #include "code\game\objects\effects\portals.dm" #include "code\game\objects\effects\spiders.dm" #include "code\game\objects\effects\step_triggers.dm" +#include "code\game\objects\effects\chem\chemsmoke.dm" +#include "code\game\objects\effects\chem\foam.dm" +#include "code\game\objects\effects\chem\water.dm" #include "code\game\objects\effects\decals\cleanable.dm" #include "code\game\objects\effects\decals\contraband.dm" #include "code\game\objects\effects\decals\crayon.dm" @@ -551,6 +549,7 @@ #include "code\game\objects\items\crayons.dm" #include "code\game\objects\items\glassjar.dm" #include "code\game\objects\items\latexballoon.dm" +#include "code\game\objects\items\paintkit.dm" #include "code\game\objects\items\shooting_range.dm" #include "code\game\objects\items\toys.dm" #include "code\game\objects\items\trash.dm" @@ -633,7 +632,6 @@ #include "code\game\objects\items\weapons\stunbaton.dm" #include "code\game\objects\items\weapons\surgery_tools.dm" #include "code\game\objects\items\weapons\swords_axes_etc.dm" -#include "code\game\objects\items\weapons\table_rack_parts.dm" #include "code\game\objects\items\weapons\tape.dm" #include "code\game\objects\items\weapons\teleportation.dm" #include "code\game\objects\items\weapons\tools.dm" @@ -705,7 +703,6 @@ #include "code\game\objects\structures\door_assembly.dm" #include "code\game\objects\structures\electricchair.dm" #include "code\game\objects\structures\extinguisher.dm" -#include "code\game\objects\structures\false_walls.dm" #include "code\game\objects\structures\flora.dm" #include "code\game\objects\structures\girders.dm" #include "code\game\objects\structures\grille.dm" @@ -723,7 +720,6 @@ #include "code\game\objects\structures\noticeboard.dm" #include "code\game\objects\structures\safe.dm" #include "code\game\objects\structures\signs.dm" -#include "code\game\objects\structures\tables_racks.dm" #include "code\game\objects\structures\tank_dispenser.dm" #include "code\game\objects\structures\target_stake.dm" #include "code\game\objects\structures\transit_tubes.dm" @@ -769,10 +765,10 @@ #include "code\game\turfs\unsimulated.dm" #include "code\game\turfs\simulated\floor.dm" #include "code\game\turfs\simulated\floor_types.dm" +#include "code\game\turfs\simulated\wall_attacks.dm" +#include "code\game\turfs\simulated\wall_icon.dm" +#include "code\game\turfs\simulated\wall_types.dm" #include "code\game\turfs\simulated\walls.dm" -#include "code\game\turfs\simulated\walls_mineral.dm" -#include "code\game\turfs\simulated\walls_misc.dm" -#include "code\game\turfs\simulated\walls_reinforced.dm" #include "code\game\turfs\space\space.dm" #include "code\game\turfs\space\transit.dm" #include "code\game\turfs\unsimulated\beach.dm" @@ -815,6 +811,7 @@ #include "code\modules\admin\verbs\deadsay.dm" #include "code\modules\admin\verbs\debug.dm" #include "code\modules\admin\verbs\diagnostics.dm" +#include "code\modules\admin\verbs\dice.dm" #include "code\modules\admin\verbs\getlogs.dm" #include "code\modules\admin\verbs\icarus.dm" #include "code\modules\admin\verbs\mapping.dm" @@ -930,13 +927,14 @@ #include "code\modules\clothing\under\syndicate.dm" #include "code\modules\clothing\under\accessories\accessory.dm" #include "code\modules\clothing\under\accessories\armband.dm" +#include "code\modules\clothing\under\accessories\badges.dm" #include "code\modules\clothing\under\accessories\holster.dm" +#include "code\modules\clothing\under\accessories\lockets.dm" #include "code\modules\clothing\under\accessories\storage.dm" #include "code\modules\clothing\under\jobs\civilian.dm" #include "code\modules\clothing\under\jobs\engineering.dm" #include "code\modules\clothing\under\jobs\medsci.dm" #include "code\modules\clothing\under\jobs\security.dm" -#include "code\modules\customitems\item_defines.dm" #include "code\modules\customitems\item_spawning.dm" #include "code\modules\detectivework\evidence.dm" #include "code\modules\detectivework\footprints_and_rag.dm" @@ -989,6 +987,7 @@ #include "code\modules\examine\descriptions\engineering.dm" #include "code\modules\examine\descriptions\medical.dm" #include "code\modules\examine\descriptions\mobs.dm" +#include "code\modules\examine\descriptions\paperwork.dm" #include "code\modules\examine\descriptions\stacks.dm" #include "code\modules\examine\descriptions\structures.dm" #include "code\modules\examine\descriptions\turfs.dm" @@ -1028,11 +1027,20 @@ #include "code\modules\library\lib_items.dm" #include "code\modules\library\lib_machines.dm" #include "code\modules\library\lib_readme.dm" +#include "code\modules\lighting\_lighting_defs.dm" +#include "code\modules\lighting\light_source.dm" +#include "code\modules\lighting\lighting_atom.dm" +#include "code\modules\lighting\lighting_overlay.dm" +#include "code\modules\lighting\lighting_process.dm" +#include "code\modules\lighting\lighting_system.dm" +#include "code\modules\lighting\lighting_turf.dm" +#include "code\modules\lighting\~lighting_undefs.dm" #include "code\modules\liquid\splash_simulation.dm" #include "code\modules\maps\dmm_suite.dm" #include "code\modules\maps\reader.dm" #include "code\modules\maps\swapmaps.dm" #include "code\modules\maps\writer.dm" +#include "code\modules\materials\materials.dm" #include "code\modules\mining\abandonedcrates.dm" #include "code\modules\mining\alloys.dm" #include "code\modules\mining\coins.dm" @@ -1042,7 +1050,7 @@ #include "code\modules\mining\machine_unloading.dm" #include "code\modules\mining\mine_items.dm" #include "code\modules\mining\mine_turfs.dm" -#include "code\modules\mining\minerals.dm" +#include "code\modules\mining\mineral_effect.dm" #include "code\modules\mining\mint.dm" #include "code\modules\mining\money_bag.dm" #include "code\modules\mining\ore.dm" @@ -1115,6 +1123,7 @@ #include "code\modules\mob\living\carbon\carbon_defines.dm" #include "code\modules\mob\living\carbon\carbon_powers.dm" #include "code\modules\mob\living\carbon\give.dm" +#include "code\modules\mob\living\carbon\resist.dm" #include "code\modules\mob\living\carbon\shock.dm" #include "code\modules\mob\living\carbon\viruses.dm" #include "code\modules\mob\living\carbon\alien\alien.dm" @@ -1166,6 +1175,7 @@ #include "code\modules\mob\living\carbon\human\MedicalSideEffects.dm" #include "code\modules\mob\living\carbon\human\npcs.dm" #include "code\modules\mob\living\carbon\human\say.dm" +#include "code\modules\mob\living\carbon\human\stripping.dm" #include "code\modules\mob\living\carbon\human\unarmed_attack.dm" #include "code\modules\mob\living\carbon\human\update_icons.dm" #include "code\modules\mob\living\carbon\human\whisper.dm" @@ -1443,11 +1453,16 @@ #include "code\modules\reagents\Chemistry-Holder.dm" #include "code\modules\reagents\Chemistry-Machinery.dm" #include "code\modules\reagents\Chemistry-Readme.dm" -#include "code\modules\reagents\Chemistry-Reagents-Antidepressants.dm" #include "code\modules\reagents\Chemistry-Reagents.dm" #include "code\modules\reagents\Chemistry-Recipes.dm" #include "code\modules\reagents\reagent_containers.dm" #include "code\modules\reagents\reagent_dispenser.dm" +#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Core.dm" +#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Dispenser.dm" +#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Food-Drinks.dm" +#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Medicine.dm" +#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Other.dm" +#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Toxins.dm" #include "code\modules\reagents\dispenser\_defines.dm" #include "code\modules\reagents\dispenser\cartridge.dm" #include "code\modules\reagents\dispenser\cartridge_presets.dm" @@ -1461,7 +1476,6 @@ #include "code\modules\reagents\reagent_containers\glass.dm" #include "code\modules\reagents\reagent_containers\hypospray.dm" #include "code\modules\reagents\reagent_containers\pill.dm" -#include "code\modules\reagents\reagent_containers\robodropper.dm" #include "code\modules\reagents\reagent_containers\spray.dm" #include "code\modules\reagents\reagent_containers\syringes.dm" #include "code\modules\reagents\reagent_containers\food\cans.dm" @@ -1531,8 +1545,6 @@ #include "code\modules\research\xenoarchaeology\finds\finds_misc.dm" #include "code\modules\research\xenoarchaeology\finds\finds_special.dm" #include "code\modules\research\xenoarchaeology\finds\finds_talkingitem.dm" -#include "code\modules\research\xenoarchaeology\genetics\prehistoric_animals.dm" -#include "code\modules\research\xenoarchaeology\genetics\reconstitutor.dm" #include "code\modules\research\xenoarchaeology\machinery\artifact_analyser.dm" #include "code\modules\research\xenoarchaeology\machinery\artifact_harvester.dm" #include "code\modules\research\xenoarchaeology\machinery\artifact_scanner.dm" @@ -1634,6 +1646,12 @@ #include "code\modules\surgery\robolimbs.dm" #include "code\modules\surgery\slimes.dm" #include "code\modules\surgery\surgery.dm" +#include "code\modules\tables\flipping.dm" +#include "code\modules\tables\interactions.dm" +#include "code\modules\tables\presets.dm" +#include "code\modules\tables\rack.dm" +#include "code\modules\tables\tables.dm" +#include "code\modules\tables\update_triggers.dm" #include "code\modules\vehicles\cargo_train.dm" #include "code\modules\vehicles\train.dm" #include "code\modules\vehicles\vehicle.dm" diff --git a/code/ATMOSPHERICS/_atmospherics_helpers.dm b/code/ATMOSPHERICS/_atmospherics_helpers.dm index 5ea54e7a56..f85fa84b93 100644 --- a/code/ATMOSPHERICS/_atmospherics_helpers.dm +++ b/code/ATMOSPHERICS/_atmospherics_helpers.dm @@ -427,10 +427,19 @@ //If set, sink_volume_mod adjusts the effective output volume used in the calculation. This is useful when the output gas_mixture is //part of a pipenetwork, and so it's volume isn't representative of the actual volume since the gas will be shared across the pipenetwork when it processes. /proc/calculate_transfer_moles(datum/gas_mixture/source, datum/gas_mixture/sink, var/pressure_delta, var/sink_volume_mod=0) - //Make the approximation that the sink temperature is unchanged after transferring gas - var/air_temperature = (sink.temperature > 0)? sink.temperature : source.temperature - var/output_volume = (sink.volume * sink.group_multiplier) + sink_volume_mod + if(source.temperature == 0 || source.total_moles == 0) return 0 + var/output_volume = (sink.volume * sink.group_multiplier) + sink_volume_mod + var/source_total_moles = source.total_moles * source.group_multiplier + + var/air_temperature = source.temperature + if(sink.total_moles > 0 && sink.temperature > 0) + //estimate the final temperature of the sink after transfer + var/estimate_moles = pressure_delta*output_volume/(sink.temperature * R_IDEAL_GAS_EQUATION) + var/sink_heat_capacity = sink.heat_capacity() + var/transfer_heat_capacity = source.heat_capacity()*estimate_moles/source_total_moles + air_temperature = (sink.temperature*sink_heat_capacity + source.temperature*transfer_heat_capacity) / (sink_heat_capacity + transfer_heat_capacity) + //get the number of moles that would have to be transfered to bring sink to the target pressure return pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 1920b8c6af..4674d52251 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -61,19 +61,31 @@ use_power = 1 icon_state = "map_vent_in" +/obj/machinery/atmospherics/unary/vent_pump/siphon/on/atmos + use_power = 1 + icon_state = "map_vent_in" + external_pressure_bound = 0 + external_pressure_bound_default = 0 + internal_pressure_bound = 2000 + internal_pressure_bound_default = 2000 + pressure_checks = 2 + pressure_checks_default = 2 + /obj/machinery/atmospherics/unary/vent_pump/New() ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP icon = null initial_loc = get_area(loc) - if (initial_loc.master) - initial_loc = initial_loc.master area_uid = initial_loc.uid if (!id_tag) assign_uid() id_tag = num2text(uid) +/obj/machinery/atmospherics/unary/vent_pump/Destroy() + unregister_radio(src, frequency) + ..() + /obj/machinery/atmospherics/unary/vent_pump/high_volume name = "Large Air Vent" power_channel = EQUIP @@ -211,14 +223,6 @@ return pressure_delta -//Radio remote control - -/obj/machinery/atmospherics/unary/vent_pump/proc/set_frequency(new_frequency) - radio_controller.remove_object(src, frequency) - frequency = new_frequency - if(frequency) - radio_connection = radio_controller.add_object(src, frequency,radio_filter_in) - /obj/machinery/atmospherics/unary/vent_pump/proc/broadcast_status() if(!radio_connection) return 0 @@ -260,7 +264,7 @@ radio_filter_in = frequency==1439?(RADIO_FROM_AIRALARM):null radio_filter_out = frequency==1439?(RADIO_TO_AIRALARM):null if(frequency) - set_frequency(frequency) + radio_connection = register_radio(src, frequency, frequency, radio_filter_in) src.broadcast_status() /obj/machinery/atmospherics/unary/vent_pump/receive_signal(datum/signal/signal) diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index e5b6d3a8dc..43874a64d9 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -36,13 +36,16 @@ icon = null initial_loc = get_area(loc) - if (initial_loc.master) - initial_loc = initial_loc.master area_uid = initial_loc.uid if (!id_tag) assign_uid() id_tag = num2text(uid) +/obj/machinery/atmospherics/unary/vent_scrubber/Destroy() + unregister_radio(src, frequency) + ..() + + /obj/machinery/atmospherics/unary/vent_scrubber/update_icon(var/safety = 0) if(!check_icon_cache()) return diff --git a/code/TriDimension/Structures.dm b/code/TriDimension/Structures.dm index e9f0f9e82f..9224facba2 100644 --- a/code/TriDimension/Structures.dm +++ b/code/TriDimension/Structures.dm @@ -97,7 +97,7 @@ src.d_state = 1 if(target) - var/obj/item/stack/rods/R = new /obj/item/stack/rods(target.loc) + var/obj/item/stack/rods/R = PoolOrNew(/obj/item/stack/rods, target.loc) R.amount = 2 qdel(Target) diff --git a/code/ZAS/Atom.dm b/code/ZAS/Atom.dm index 6f75f4ea29..e655295f78 100644 --- a/code/ZAS/Atom.dm +++ b/code/ZAS/Atom.dm @@ -50,7 +50,7 @@ atom/proc/c_airblock(turf/other) #ifdef ZASDBG ASSERT(isturf(other)) #endif - return !CanPass(null, other, 0, 0) + 2*!CanPass(null, other, 1.5, 1) + return (AIR_BLOCKED*!CanPass(null, other, 0, 0))|(ZONE_BLOCKED*!CanPass(null, other, 1.5, 1)) turf/c_airblock(turf/other) diff --git a/code/ZAS/Controller.dm b/code/ZAS/Controller.dm index 4614b3a183..83d2a54ec3 100644 --- a/code/ZAS/Controller.dm +++ b/code/ZAS/Controller.dm @@ -154,7 +154,18 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun #ifdef ZASDBG var/updated = 0 #endif + + //defer updating of self-zone-blocked turfs until after all other turfs have been updated. + //this hopefully ensures that non-self-zone-blocked turfs adjacent to self-zone-blocked ones + //have valid zones when the self-zone-blocked turfs update. + var/list/deferred = list() + for(var/turf/T in updating) + //check if the turf is self-zone-blocked + if(T.c_airblock(T) & ZONE_BLOCKED) + deferred += T + continue + T.update_air_properties() T.post_update_air_properties() T.needs_air_update = 0 @@ -164,6 +175,15 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun #endif //sleep(1) + for(var/turf/T in deferred) + T.update_air_properties() + T.post_update_air_properties() + T.needs_air_update = 0 + #ifdef ZASDBG + T.overlays -= mark + updated++ + #endif + #ifdef ZASDBG if(updated != updating.len) tick_progress = "[updating.len - updated] tiles left unupdated." @@ -307,7 +327,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun /datum/controller/air_system/proc/mark_edge_sleeping(connection_edge/E) #ifdef ZASDBG - ASSERT(istype(E) + ASSERT(istype(E)) #endif if(E.sleeping) return active_edges.Remove(E) @@ -315,7 +335,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun /datum/controller/air_system/proc/mark_edge_active(connection_edge/E) #ifdef ZASDBG - ASSERT(istype(E) + ASSERT(istype(E)) #endif if(!E.sleeping) return active_edges.Add(E) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 688f71985d..ebfd029228 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -91,11 +91,11 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) anchored = 1 mouse_opacity = 0 - //luminosity = 3 + blend_mode = BLEND_ADD icon = 'icons/effects/fire.dmi' icon_state = "1" - l_color = "#ED9200" + light_color = "#ED9200" layer = TURF_LAYER var/firelevel = 10000 //Calculated by gas_mixture.calculate_firelevel() @@ -114,13 +114,13 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) if(firelevel > 6) icon_state = "3" - SetLuminosity(7) + set_light(7, 3) else if(firelevel > 2.5) icon_state = "2" - SetLuminosity(5) + set_light(5, 2) else icon_state = "1" - SetLuminosity(3) + set_light(3, 1) //im not sure how to implement a version that works for every creature so for now monkeys are firesafe for(var/mob/living/L in loc) @@ -158,6 +158,9 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) else enemy_tile.adjacent_fire_act(loc, air_contents, air_contents.temperature, air_contents.volume) + animate(src, color = heat2color(air_contents.temperature), 5) + set_light(l_color = color) + /obj/fire/New(newLoc,fl) ..() @@ -165,7 +168,11 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) qdel(src) set_dir(pick(cardinal)) - SetLuminosity(3) + + var/datum/gas_mixture/air_contents = loc.return_air() + color = heat2color(air_contents.temperature) + set_light(3, 1, color) + firelevel = fl air_master.active_hotspots.Add(src) @@ -178,7 +185,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) /obj/fire/proc/RemoveFire() if (istype(loc, /turf)) - SetLuminosity(0) + set_light(0) loc = null air_master.active_hotspots.Remove(src) diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm index 85d47d9f6f..331c00dd37 100644 --- a/code/ZAS/Turf.dm +++ b/code/ZAS/Turf.dm @@ -1,255 +1,259 @@ -/turf/simulated/var/zone/zone -/turf/simulated/var/open_directions - -/turf/var/needs_air_update = 0 -/turf/var/datum/gas_mixture/air - -/turf/simulated/proc/update_graphic(list/graphic_add = null, list/graphic_remove = null) - if(graphic_add && graphic_add.len) - overlays += graphic_add - if(graphic_remove && graphic_remove.len) - overlays -= graphic_remove - -/turf/proc/update_air_properties() - var/block = c_airblock(src) - if(block & AIR_BLOCKED) - //dbg(blocked) - return 1 - - #ifdef ZLEVELS - for(var/d = 1, d < 64, d *= 2) - #else - for(var/d = 1, d < 16, d *= 2) - #endif - - var/turf/unsim = get_step(src, d) - - if(!unsim) - continue - - block = unsim.c_airblock(src) - - if(block & AIR_BLOCKED) - //unsim.dbg(air_blocked, turn(180,d)) - continue - - var/r_block = c_airblock(unsim) - - if(r_block & AIR_BLOCKED) - continue - - if(istype(unsim, /turf/simulated)) - - var/turf/simulated/sim = unsim - if(air_master.has_valid_zone(sim)) - - air_master.connect(sim, src) - -/turf/simulated/update_air_properties() - if(zone && zone.invalid) - c_copy_air() - zone = null //Easier than iterating through the list at the zone. - - var/s_block = c_airblock(src) - if(s_block & AIR_BLOCKED) - #ifdef ZASDBG - if(verbose) world << "Self-blocked." - //dbg(blocked) - #endif - if(zone) - var/zone/z = zone - if(locate(/obj/machinery/door/airlock) in src) //Hacky, but prevents normal airlocks from rebuilding zones all the time - z.remove(src) - else - z.rebuild() - - return 1 - - var/previously_open = open_directions - open_directions = 0 - - var/list/postponed - #ifdef ZLEVELS - for(var/d = 1, d < 64, d *= 2) - #else - for(var/d = 1, d < 16, d *= 2) - #endif - - var/turf/unsim = get_step(src, d) - - if(!unsim) //edge of map - continue - - var/block = unsim.c_airblock(src) - if(block & AIR_BLOCKED) - - #ifdef ZASDBG - if(verbose) world << "[d] is blocked." - //unsim.dbg(air_blocked, turn(180,d)) - #endif - - continue - - var/r_block = c_airblock(unsim) - if(r_block & AIR_BLOCKED) - - #ifdef ZASDBG - if(verbose) world << "[d] is blocked." - //dbg(air_blocked, d) - #endif - - //Check that our zone hasn't been cut off recently. - //This happens when windows move or are constructed. We need to rebuild. - if((previously_open & d) && istype(unsim, /turf/simulated)) - var/turf/simulated/sim = unsim - if(zone && sim.zone == zone) - zone.rebuild() - return - - continue - - open_directions |= d - - if(istype(unsim, /turf/simulated)) - - var/turf/simulated/sim = unsim - sim.open_directions |= reverse_dir[d] - - if(air_master.has_valid_zone(sim)) - - //Might have assigned a zone, since this happens for each direction. - if(!zone) - - //if((block & ZONE_BLOCKED) || (r_block & ZONE_BLOCKED && !(s_block & ZONE_BLOCKED))) - if(((block & ZONE_BLOCKED) && !(r_block & ZONE_BLOCKED)) || (r_block & ZONE_BLOCKED && !(s_block & ZONE_BLOCKED))) - #ifdef ZASDBG - if(verbose) world << "[d] is zone blocked." - //dbg(zone_blocked, d) - #endif - - //Postpone this tile rather than exit, since a connection can still be made. - if(!postponed) postponed = list() - postponed.Add(sim) - - else - - sim.zone.add(src) - - #ifdef ZASDBG - dbg(assigned) - if(verbose) world << "Added to [zone]" - #endif - - else if(sim.zone != zone) - - #ifdef ZASDBG - if(verbose) world << "Connecting to [sim.zone]" - #endif - - air_master.connect(src, sim) - - - #ifdef ZASDBG - else if(verbose) world << "[d] has same zone." - - else if(verbose) world << "[d] has invalid zone." - #endif - - else - - //Postponing connections to tiles until a zone is assured. - if(!postponed) postponed = list() - postponed.Add(unsim) - - if(!air_master.has_valid_zone(src)) //Still no zone, make a new one. - var/zone/newzone = new/zone() - newzone.add(src) - - #ifdef ZASDBG - dbg(created) - - ASSERT(zone) - #endif - - //At this point, a zone should have happened. If it hasn't, don't add more checks, fix the bug. - - for(var/turf/T in postponed) - air_master.connect(src, T) - -/turf/proc/post_update_air_properties() - if(connections) connections.update_all() - -/turf/assume_air(datum/gas_mixture/giver) //use this for machines to adjust air - return 0 - -/turf/proc/assume_gas(gasid, moles, temp = 0) - return 0 - -/turf/return_air() - //Create gas mixture to hold data for passing - var/datum/gas_mixture/GM = new - - GM.adjust_multi("oxygen", oxygen, "carbon_dioxide", carbon_dioxide, "nitrogen", nitrogen, "phoron", phoron) - GM.temperature = temperature - - return GM - -/turf/remove_air(amount as num) - var/datum/gas_mixture/GM = new - - var/sum = oxygen + carbon_dioxide + nitrogen + phoron - if(sum>0) - GM.gas["oxygen"] = (oxygen/sum)*amount - GM.gas["carbon_dioxide"] = (carbon_dioxide/sum)*amount - GM.gas["nitrogen"] = (nitrogen/sum)*amount - GM.gas["phoron"] = (phoron/sum)*amount - - GM.temperature = temperature - GM.update_values() - - return GM - -/turf/simulated/assume_air(datum/gas_mixture/giver) - var/datum/gas_mixture/my_air = return_air() - my_air.merge(giver) - -/turf/simulated/assume_gas(gasid, moles, temp = null) - var/datum/gas_mixture/my_air = return_air() - - if(isnull(temp)) - my_air.adjust_gas(gasid, moles) - else - my_air.adjust_gas_temp(gasid, moles, temp) - - return 1 - -/turf/simulated/remove_air(amount as num) - var/datum/gas_mixture/my_air = return_air() - return my_air.remove(amount) - -/turf/simulated/return_air() - if(zone) - if(!zone.invalid) - air_master.mark_zone_update(zone) - return zone.air - else - if(!air) - make_air() - c_copy_air() - return air - else - if(!air) - make_air() - return air - -/turf/proc/make_air() - air = new/datum/gas_mixture - air.temperature = temperature - air.adjust_multi("oxygen", oxygen, "carbon_dioxide", carbon_dioxide, "nitrogen", nitrogen, "phoron", phoron) - air.group_multiplier = 1 - air.volume = CELL_VOLUME - -/turf/simulated/proc/c_copy_air() - if(!air) air = new/datum/gas_mixture - air.copy_from(zone.air) - air.group_multiplier = 1 +/turf/simulated/var/zone/zone +/turf/simulated/var/open_directions + +/turf/var/needs_air_update = 0 +/turf/var/datum/gas_mixture/air + +/turf/simulated/proc/update_graphic(list/graphic_add = null, list/graphic_remove = null) + if(graphic_add && graphic_add.len) + overlays += graphic_add + if(graphic_remove && graphic_remove.len) + overlays -= graphic_remove + +/turf/proc/update_air_properties() + var/block = c_airblock(src) + if(block & AIR_BLOCKED) + //dbg(blocked) + return 1 + + #ifdef ZLEVELS + for(var/d = 1, d < 64, d *= 2) + #else + for(var/d = 1, d < 16, d *= 2) + #endif + + var/turf/unsim = get_step(src, d) + + if(!unsim) + continue + + block = unsim.c_airblock(src) + + if(block & AIR_BLOCKED) + //unsim.dbg(air_blocked, turn(180,d)) + continue + + var/r_block = c_airblock(unsim) + + if(r_block & AIR_BLOCKED) + continue + + if(istype(unsim, /turf/simulated)) + + var/turf/simulated/sim = unsim + if(air_master.has_valid_zone(sim)) + + air_master.connect(sim, src) + +/turf/simulated/update_air_properties() + + if(zone && zone.invalid) + c_copy_air() + zone = null //Easier than iterating through the list at the zone. + + var/s_block = c_airblock(src) + if(s_block & AIR_BLOCKED) + #ifdef ZASDBG + if(verbose) world << "Self-blocked." + //dbg(blocked) + #endif + if(zone) + var/zone/z = zone + + if(s_block & ZONE_BLOCKED) //Hacky, but prevents normal airlocks from rebuilding zones all the time + z.remove(src) + else + z.rebuild() + + return 1 + + var/previously_open = open_directions + open_directions = 0 + + var/list/postponed + #ifdef ZLEVELS + for(var/d = 1, d < 64, d *= 2) + #else + for(var/d = 1, d < 16, d *= 2) + #endif + + var/turf/unsim = get_step(src, d) + + if(!unsim) //edge of map + continue + + var/block = unsim.c_airblock(src) + if(block & AIR_BLOCKED) + + #ifdef ZASDBG + if(verbose) world << "[d] is blocked." + //unsim.dbg(air_blocked, turn(180,d)) + #endif + + continue + + var/r_block = c_airblock(unsim) + if(r_block & AIR_BLOCKED) + + #ifdef ZASDBG + if(verbose) world << "[d] is blocked." + //dbg(air_blocked, d) + #endif + + //Check that our zone hasn't been cut off recently. + //This happens when windows move or are constructed. We need to rebuild. + if((previously_open & d) && istype(unsim, /turf/simulated)) + var/turf/simulated/sim = unsim + if(zone && sim.zone == zone) + zone.rebuild() + return + + continue + + open_directions |= d + + if(istype(unsim, /turf/simulated)) + + var/turf/simulated/sim = unsim + sim.open_directions |= reverse_dir[d] + + if(air_master.has_valid_zone(sim)) + + //Might have assigned a zone, since this happens for each direction. + if(!zone) + + //We do not merge if + // they are blocking us and we are not blocking them, or if + // we are blocking them and not blocking ourselves - this prevents tiny zones from forming on doorways. + if(((block & ZONE_BLOCKED) && !(r_block & ZONE_BLOCKED)) || ((r_block & ZONE_BLOCKED) && !(s_block & ZONE_BLOCKED))) + #ifdef ZASDBG + if(verbose) world << "[d] is zone blocked." + //dbg(zone_blocked, d) + #endif + + //Postpone this tile rather than exit, since a connection can still be made. + if(!postponed) postponed = list() + postponed.Add(sim) + + else + + sim.zone.add(src) + + #ifdef ZASDBG + dbg(assigned) + if(verbose) world << "Added to [zone]" + #endif + + else if(sim.zone != zone) + + #ifdef ZASDBG + if(verbose) world << "Connecting to [sim.zone]" + #endif + + air_master.connect(src, sim) + + + #ifdef ZASDBG + else if(verbose) world << "[d] has same zone." + + else if(verbose) world << "[d] has invalid zone." + #endif + + else + + //Postponing connections to tiles until a zone is assured. + if(!postponed) postponed = list() + postponed.Add(unsim) + + if(!air_master.has_valid_zone(src)) //Still no zone, make a new one. + var/zone/newzone = new/zone() + newzone.add(src) + + #ifdef ZASDBG + dbg(created) + + ASSERT(zone) + #endif + + //At this point, a zone should have happened. If it hasn't, don't add more checks, fix the bug. + + for(var/turf/T in postponed) + air_master.connect(src, T) + +/turf/proc/post_update_air_properties() + if(connections) connections.update_all() + +/turf/assume_air(datum/gas_mixture/giver) //use this for machines to adjust air + return 0 + +/turf/proc/assume_gas(gasid, moles, temp = 0) + return 0 + +/turf/return_air() + //Create gas mixture to hold data for passing + var/datum/gas_mixture/GM = new + + GM.adjust_multi("oxygen", oxygen, "carbon_dioxide", carbon_dioxide, "nitrogen", nitrogen, "phoron", phoron) + GM.temperature = temperature + + return GM + +/turf/remove_air(amount as num) + var/datum/gas_mixture/GM = new + + var/sum = oxygen + carbon_dioxide + nitrogen + phoron + if(sum>0) + GM.gas["oxygen"] = (oxygen/sum)*amount + GM.gas["carbon_dioxide"] = (carbon_dioxide/sum)*amount + GM.gas["nitrogen"] = (nitrogen/sum)*amount + GM.gas["phoron"] = (phoron/sum)*amount + + GM.temperature = temperature + GM.update_values() + + return GM + +/turf/simulated/assume_air(datum/gas_mixture/giver) + var/datum/gas_mixture/my_air = return_air() + my_air.merge(giver) + +/turf/simulated/assume_gas(gasid, moles, temp = null) + var/datum/gas_mixture/my_air = return_air() + + if(isnull(temp)) + my_air.adjust_gas(gasid, moles) + else + my_air.adjust_gas_temp(gasid, moles, temp) + + return 1 + +/turf/simulated/remove_air(amount as num) + var/datum/gas_mixture/my_air = return_air() + return my_air.remove(amount) + +/turf/simulated/return_air() + if(zone) + if(!zone.invalid) + air_master.mark_zone_update(zone) + return zone.air + else + if(!air) + make_air() + c_copy_air() + return air + else + if(!air) + make_air() + return air + +/turf/proc/make_air() + air = new/datum/gas_mixture + air.temperature = temperature + air.adjust_multi("oxygen", oxygen, "carbon_dioxide", carbon_dioxide, "nitrogen", nitrogen, "phoron", phoron) + air.group_multiplier = 1 + air.volume = CELL_VOLUME + +/turf/simulated/proc/c_copy_air() + if(!air) air = new/datum/gas_mixture + air.copy_from(zone.air) + air.group_multiplier = 1 diff --git a/code/ZAS/Zone.dm b/code/ZAS/Zone.dm index b7042191fc..9fcddc9246 100644 --- a/code/ZAS/Zone.dm +++ b/code/ZAS/Zone.dm @@ -111,6 +111,13 @@ Class Procs: #ifdef ZASDBG T.dbg(merged) #endif + + //rebuild the old zone's edges so that the will be possesed by the new zone + for(var/connection_edge/E in edges) + if(E.contains_zone(into)) + continue //don't need to rebuild this edge + for(var/turf/T in E.connecting_turfs) + air_master.mark_for_update(T) /zone/proc/c_invalidate() invalid = 1 diff --git a/code/__HELPERS/datum_pool.dm b/code/__HELPERS/datum_pool.dm index 16594ed048..79970faf7b 100644 --- a/code/__HELPERS/datum_pool.dm +++ b/code/__HELPERS/datum_pool.dm @@ -23,24 +23,20 @@ var/global/list/GlobalPool = list() //Either way it gets passed to new /proc/PoolOrNew(var/get_type,var/second_arg) - if(!get_type) - return - var/datum/D D = GetFromPool(get_type,second_arg) if(!D) - if(ispath(get_type)) - if(islist(second_arg)) - return new get_type (arglist(second_arg)) - else - return new get_type (second_arg) + // So the GC knows we're pooling this type. + if(!GlobalPool[get_type]) + GlobalPool[get_type] = list(new get_type) + if(islist(second_arg)) + return new get_type (arglist(second_arg)) + else + return new get_type (second_arg) return D /proc/GetFromPool(var/get_type,var/second_arg) - if(!get_type) - return 0 - if(isnull(GlobalPool[get_type])) return 0 @@ -75,9 +71,10 @@ var/global/list/GlobalPool = list() D.Destroy() D.ResetVars() + D.disposed = 1 //Set to stop processing while pooled /proc/IsPooled(var/datum/D) - if(isnull(GlobalPool[D.type]) || length(GlobalPool[D.type]) == 0) + if(isnull(GlobalPool[D.type])) return 0 return 1 @@ -86,10 +83,13 @@ var/global/list/GlobalPool = list() New(arglist(args)) else New(args) + disposed = null /atom/movable/Prepare(args) - if(islist(args)) + var/list/args_list = args + if(istype(args_list) && args_list.len) loc = args[1] + else loc = args ..() diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 10889abf2e..60e46d4ca6 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -16,22 +16,32 @@ return 1 return 0 +/proc/max_default_z_level() + var/max_z = 0 + for(var/z in config.station_levels) + max_z = max(z, max_z) + for(var/z in config.admin_levels) + max_z = max(z, max_z) + for(var/z in config.player_levels) + max_z = max(z, max_z) + return max_z + /proc/get_area(O) var/turf/loc = get_turf(O) if(loc) var/area/res = loc.loc - .= res.master + .= res /proc/get_area_name(N) //get area by its name for(var/area/A in world) if(A.name == N) return A return 0 - + /proc/get_area_master(const/O) var/area/A = get_area(O) if (isarea(A)) - return A.master + return A /proc/in_range(source, user) if(get_dist(source, user) <= 1) @@ -66,18 +76,6 @@ /proc/isNotAdminLevel(var/level) return !isAdminLevel(level) -//Magic constants obtained by using linear regression on right-angled triangles of sides 0=dy) return (k1*dx) + (k2*dy) //No sqrt or powers :) - else return (k2*dx) + (k1*dy) -#undef k1 -#undef k2 - /proc/circlerange(center=usr,radius=3) var/turf/centerturf = get_turf(center) diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index a1f13c18ab..ed0f0c9780 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -182,11 +182,9 @@ proc/listclearnulls(list/list) //Return a list with no duplicate entries /proc/uniquelist(var/list/L) - var/list/K = list() - for(var/item in L) - if(!(item in K)) - K += item - return K + . = list() + for(var/i in L) + . |= i //Mergesort: divides up the list into halves to begin the sort /proc/sortKey(var/list/client/L, var/order = 1) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 32838765e8..89b96aa24b 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -125,3 +125,10 @@ Proc for attack log creation, because really why not target.attack_log += text("\[[time_stamp()]\] Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]") if(admin) log_attack("[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(ismob(target) && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]") + +//checks whether this item is a module of the robot it is located in. +/proc/is_robot_module(var/obj/item/thing) + if (!thing || !istype(thing.loc, /mob/living/silicon/robot)) + return 0 + var/mob/living/silicon/robot/R = thing.loc + return (thing in R.module.modules) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 8895e67c2a..3564c5e15f 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -927,30 +927,6 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl refined_trg -= B continue moving - var/list/doors = new/list() - - if(toupdate.len) - for(var/turf/simulated/T1 in toupdate) - for(var/obj/machinery/door/D2 in T1) - doors += D2 - /*if(T1.parent) - air_master.groups_to_rebuild += T1.parent - else - air_master.tiles_to_update += T1*/ - - if(fromupdate.len) - for(var/turf/simulated/T2 in fromupdate) - for(var/obj/machinery/door/D2 in T2) - doors += D2 - /*if(T2.parent) - air_master.groups_to_rebuild += T2.parent - else - air_master.tiles_to_update += T2*/ - - for(var/obj/O in doors) - O:update_nearby_tiles(1) - - proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) if(!original) diff --git a/code/_defines/chemical_effects.dm b/code/_defines/chemical_effects.dm new file mode 100644 index 0000000000..6119d80cb5 --- /dev/null +++ b/code/_defines/chemical_effects.dm @@ -0,0 +1,7 @@ +#define CE_STABLE "stable" // Inaprovaline +#define CE_ANTIBIOTIC "antibiotic" // Spaceacilin +#define CE_BLOODRESTORE "bloodrestore" // Iron/nutriment +#define CE_PAINKILLER "painkiller" +#define CE_ALCOHOL "alcohol" // Liver filtering +#define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage +#define CE_SPEEDBOOST "gofast" // Hyperzine \ No newline at end of file diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 466a9e2875..f39499f3dc 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -341,6 +341,7 @@ datum/hud/New(mob/owner) if(src.hud_used.item_action_list) src.client.screen -= src.hud_used.item_action_list src.client.screen -= src.internals + src.client.screen += src.hud_used.action_intent //we want the intent swticher visible else hud_used.hud_shown = 1 if(src.hud_used.adding) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 1d68fb54e8..7bb85445d4 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -25,13 +25,31 @@ if(!istype(M) || (can_operate(M) && do_surgery(M,user,src))) return 0 + // Knifing + if(edge) + for(var/obj/item/weapon/grab/G in M.grabbed_by) + if(G.assailant == user && G.state >= GRAB_NECK && world.time >= (G.last_action + 20)) + //TODO: better alternative for applying damage multiple times? Nice knifing sound? + M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge) + M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge) + M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge) + M.adjustOxyLoss(60) // Brain lacks oxygen immediately, pass out + flick(G.hud.icon_state, G.hud) + G.last_action = world.time + user.visible_message("[user] slit [M]'s throat open with \the [name]!") + user.attack_log += "\[[time_stamp()]\] Knifed [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" + M.attack_log += "\[[time_stamp()]\] Got knifed by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" + msg_admin_attack("[key_name(user)] knifed [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" ) + return + ///////////////////////// user.lastattacked = M M.lastattacker = user - user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" - M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" - msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" ) + if(!no_attack_log) + user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" + M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" + msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" ) ///////////////////////// var/power = force diff --git a/code/controllers/Processes/garbage.dm b/code/controllers/Processes/garbage.dm index 7180008ddb..757729dfa6 100644 --- a/code/controllers/Processes/garbage.dm +++ b/code/controllers/Processes/garbage.dm @@ -18,7 +18,7 @@ var/list/delayed_garbage = list() /datum/controller/process/garbage_collector/setup() name = "garbage" - schedule_interval = 6 SECONDS + schedule_interval = 2 SECONDS if(!garbage_collector) garbage_collector = src @@ -78,7 +78,7 @@ var/list/delayed_garbage = list() destroyed["\ref[A]"] = world.time /datum/controller/process/garbage_collector/getStatName() - return ..()+"([garbage_collector.dels]/[garbage_collector.hard_dels])" + return ..()+"([garbage_collector.destroyed.len]/[garbage_collector.dels]/[garbage_collector.hard_dels])" // Should be treated as a replacement for the 'del' keyword. // Datums passed to this will be given a chance to clean up references to allow the GC to collect them. @@ -94,8 +94,9 @@ var/list/delayed_garbage = list() if(!istype(A)) //warning("qdel() passed object of type [A.type]. qdel() can only handle /datum types.") del(A) - garbage_collector.dels++ - garbage_collector.hard_dels++ + if(garbage_collector) + garbage_collector.dels++ + garbage_collector.hard_dels++ else if(isnull(A.gcDestroyed)) // Let our friend know they're about to get collected . = !A.Destroy() @@ -120,7 +121,7 @@ var/list/delayed_garbage = list() /icon/finalize_qdel() del(src) -/imagine/finalize_qdel() +/image/finalize_qdel() del(src) /mob/finalize_qdel() diff --git a/code/controllers/Processes/machinery.dm b/code/controllers/Processes/machinery.dm index 232ef91973..b84dfaf943 100644 --- a/code/controllers/Processes/machinery.dm +++ b/code/controllers/Processes/machinery.dm @@ -6,18 +6,16 @@ /datum/controller/process/machinery/doWork() internal_sort() - internal_process() + internal_process_machinery() + internal_process_power() + internal_process_power_drain() /datum/controller/process/machinery/proc/internal_sort() if(machinery_sort_required) machinery_sort_required = 0 machines = dd_sortedObjectList(machines) -/datum/controller/process/machinery/proc/internal_process() -//#ifdef PROFILE_MACHINES - //machine_profiling.len = 0 - //#endif - +/datum/controller/process/machinery/proc/internal_process_machinery() for(var/obj/machinery/M in machines) if(M && !M.gcDestroyed) #ifdef PROFILE_MACHINES @@ -43,6 +41,22 @@ scheck() +/datum/controller/process/machinery/proc/internal_process_power() + for(var/datum/powernet/powerNetwork in powernets) + if(istype(powerNetwork) && !powerNetwork.disposed) + powerNetwork.reset() + scheck() + continue + + powernets.Remove(powerNetwork) + +/datum/controller/process/machinery/proc/internal_process_power_drain() + // Currently only used by powersinks. These items get priority processed before machinery + for(var/obj/item/I in processing_power_items) + if(!I.pwr_drain()) // 0 = Process Kill, remove from processing list. + processing_power_items.Remove(I) + scheck() + /datum/controller/process/machinery/getStatName() - return ..()+"([machines.len])" \ No newline at end of file + return ..()+"([machines.len])" diff --git a/code/controllers/Processes/powernet.dm b/code/controllers/Processes/powernet.dm deleted file mode 100644 index f2a9822816..0000000000 --- a/code/controllers/Processes/powernet.dm +++ /dev/null @@ -1,15 +0,0 @@ -/datum/controller/process/powernet/setup() - name = "powernet" - schedule_interval = 20 // every 2 seconds - -/datum/controller/process/powernet/doWork() - for(var/datum/powernet/powerNetwork in powernets) - if(istype(powerNetwork) && !powerNetwork.disposed) - powerNetwork.reset() - scheck() - continue - - powernets.Remove(powerNetwork) - -/datum/controller/process/powernet/getStatName() - return ..()+"([powernets.len])" \ No newline at end of file diff --git a/code/controllers/Processes/turf.dm b/code/controllers/Processes/turf.dm index c1efac52f9..2ac33f48ba 100644 --- a/code/controllers/Processes/turf.dm +++ b/code/controllers/Processes/turf.dm @@ -1,9 +1,14 @@ -var/global/list/processing_turfs = list() +var/global/list/turf/processing_turfs = list() /datum/controller/process/turf/setup() name = "turf" schedule_interval = 20 // every 2 seconds /datum/controller/process/turf/doWork() - for(var/turf/unsimulated/wall/supermatter/SM in processing_turfs) - SM.process() + for(var/turf/T in processing_turfs) + if(T.process() == PROCESS_KILL) + processing_turfs.Remove(T) + scheck() + +/datum/controller/process/turf/getStatName() + return ..()+"([processing_turfs.len])" diff --git a/code/controllers/_DynamicAreaLighting_TG.dm b/code/controllers/_DynamicAreaLighting_TG.dm deleted file mode 100644 index 6d3fd406dd..0000000000 --- a/code/controllers/_DynamicAreaLighting_TG.dm +++ /dev/null @@ -1,450 +0,0 @@ -/* - Modified DynamicAreaLighting for TGstation - Coded by Carnwennan - - This is TG's 'new' lighting system. It's basically a heavily modified combination of Forum_Account's and - ShadowDarke's respective lighting libraries. Credits, where due, to them. - - Like sd_DAL (what we used to use), it changes the shading overlays of areas by splitting each type of area into sub-areas - by using the var/tag variable and moving turfs into the contents list of the correct sub-area. This method is - much less costly than using overlays or objects. - - Unlike sd_DAL however it uses a queueing system. Everytime we call a change to opacity or luminosity - (through SetOpacity() or SetLuminosity()) we are simply updating variables and scheduling certain lights/turfs for an - update. Actual updates are handled periodically by the lighting_controller. This carries additional overheads, however it - means that each thing is changed only once per lighting_controller.processing_interval ticks. Allowing for greater control - over how much priority we'd like lighting updates to have. It also makes it possible for us to simply delay updates by - setting lighting_controller.processing = 0 at say, the start of a large explosion, waiting for it to finish, and then - turning it back on with lighting_controller.processing = 1. - - Unlike our old system there are hardcoded maximum luminositys (different for certain atoms). - This is to cap the cost of creating lighting effects. - (without this, an atom with luminosity of 20 would have to update 41^2 turfs!) :s - - Also, in order for the queueing system to work, each light remembers the effect it casts on each turf. This is going to - have larger memory requirements than our previous system but it's easily worth the hassle for the greater control we - gain. It also reduces cost of removing lighting effects by a lot! - - Known Issues/TODO: - Shuttles still do not have support for dynamic lighting (I hope to fix this at some point) - No directional lighting support. (prototype looked ugly) -*/ - -#define LIGHTING_CIRCULAR 1 //comment this out to use old square lighting effects. -#define LIGHTING_LAYER 10 //Drawing layer for lighting overlays -#define LIGHTING_ICON 'icons/effects/ss13_dark_alpha6.dmi' //Icon used for lighting shading effects - -datum/light_source - var/atom/owner - var/changed = 1 - var/list/effect = list() - var/__x = 0 //x coordinate at last update - var/__y = 0 //y coordinate at last update - var/__z = 0 //z coordinate at last update - - var/_l_color //do not use directly, only used as reference for updating - var/col_r - var/col_g - var/col_b - - - New(atom/A) - if(!istype(A)) - CRASH("The first argument to the light object's constructor must be the atom that is the light source. Expected atom, received '[A]' instead.") - ..() - owner = A - readrgb(owner.l_color) - __x = owner.x - __y = owner.y - __z = owner.z - // the lighting object maintains a list of all light sources - lighting_controller.lights += src - - - //Check a light to see if its effect needs reprocessing. If it does, remove any old effect and create a new one - proc/check() - if(!owner) - remove_effect() - return 1 //causes it to be removed from our list of lights. The garbage collector will then destroy it. - - // check to see if we've moved since last update - if(owner.x != __x || owner.y != __y || owner.z != __z) - __x = owner.x - __y = owner.y - __z = owner.z - changed = 1 - - if (owner.l_color != _l_color) - readrgb(owner.l_color) - changed = 1 - - if(changed) - changed = 0 - remove_effect() - return add_effect() - return 0 - - - proc/remove_effect() - // before we apply the effect we remove the light's current effect. - for(var/turf/T in effect) // negate the effect of this light source - T.update_lumcount(-effect[T], col_r, col_g, col_b, 1) - effect.Cut() // clear the effect list - - proc/add_effect() - // only do this if the light is turned on and is on the map - if(owner.loc && owner.luminosity > 0) - readrgb(owner.l_color) - effect = list() - for(var/turf/T in view(owner.get_light_range(),get_turf(owner))) - var/delta_lumen = lum(T) - if(delta_lumen > 0) - effect[T] = delta_lumen - T.update_lumcount(delta_lumen, col_r, col_g, col_b, 0) - - return 0 - else - owner.light = null - return 1 //cause the light to be removed from the lights list and garbage collected once it's no - //longer referenced by the queue - - proc/lum(turf/A) - if (owner.trueLuminosity < 1) - return 0 - var/dist - if(!A) - dist = 0 - else -#ifdef LIGHTING_CIRCULAR - dist = cheap_hypotenuse(A.x, A.y, __x, __y) -#else - dist = max(abs(A.x - __x), abs(A.y - __y)) -#endif - if (owner.trueLuminosity > 100) // This will never happen... right? - return sqrt(owner.trueLuminosity) - dist - else - return sqrtTable[owner.trueLuminosity] - dist - - proc/readrgb(col) - _l_color = col - if(col) - col_r = GetRedPart(col) - col_g = GetGreenPart(col) - col_b = GetBluePart(col) - else - col_r = null - -atom - var/datum/light_source/light - var/trueLuminosity = 0 // Typically 'luminosity' squared. The builtin luminosity must remain linear. - // We may read it, but NEVER set it directly. - var/l_color - -//Turfs with opacity when they are constructed will trigger nearby lights to update -//Turfs and atoms with luminosity when they are constructed will create a light_source automatically -turf/New() - ..() - if(luminosity) - if(light) WARNING("[type] - Don't set lights up manually during New(), We do it automatically.") - trueLuminosity = luminosity * luminosity - light = new(src) - -//Movable atoms with opacity when they are constructed will trigger nearby lights to update -//Movable atoms with luminosity when they are constructed will create a light_source automatically -atom/movable/New() - ..() - if(opacity) - if(isturf(loc)) - if(loc:lighting_lumcount > 1) - UpdateAffectingLights() - if(luminosity) - if(light) WARNING("[type] - Don't set lights up manually during New(), We do it automatically.") - trueLuminosity = luminosity * luminosity - light = new(src) - -//Sets our luminosity. -//If we have no light it will create one. -//If we are setting luminosity to 0 the light will be cleaned up by the controller and garbage collected once all its -//queues are complete. -//if we have a light already it is merely updated, rather than making a new one. -atom/proc/SetLuminosity(new_luminosity, trueLum = FALSE) - if(new_luminosity < 0) - new_luminosity = 0 - if(!trueLum) - new_luminosity *= new_luminosity - if(light) - if(trueLuminosity != new_luminosity) //non-luminous lights are removed from the lights list in add_effect() - light.changed = 1 - else - if(new_luminosity) - light = new(src) - trueLuminosity = new_luminosity - if (trueLuminosity < 1) - luminosity = 0 - else if (trueLuminosity <= 100) - luminosity = sqrtTable[trueLuminosity] - else - luminosity = sqrt(trueLuminosity) - -atom/proc/AddLuminosity(delta_luminosity) - if(delta_luminosity > 0) - SetLuminosity(trueLuminosity + delta_luminosity*delta_luminosity, TRUE) - else if(delta_luminosity < 0) - SetLuminosity(trueLuminosity - delta_luminosity*delta_luminosity, TRUE) - -area/SetLuminosity(new_luminosity) //we don't want dynamic lighting for areas - luminosity = !!new_luminosity - trueLuminosity = luminosity - - -//change our opacity (defaults to toggle), and then update all lights that affect us. -atom/proc/SetOpacity(new_opacity) - if(new_opacity == null) - new_opacity = !opacity //default = toggle opacity - else if(opacity == new_opacity) - return 0 //opacity hasn't changed! don't bother doing anything - opacity = new_opacity //update opacity, the below procs now call light updates. - return 1 - -turf/SetOpacity(new_opacity) - if(..()==1) //only bother if opacity changed - if(lighting_lumcount) //only bother with an update if our turf is currently affected by a light - UpdateAffectingLights() - -/atom/movable/SetOpacity(new_opacity) - if(..()==1) //only bother if opacity changed - if(isturf(loc)) //only bother with an update if we're on a turf - var/turf/T = loc - if(T.lighting_lumcount) //only bother with an update if our turf is currently affected by a light - UpdateAffectingLights() - - -turf - var/lighting_lumcount = 0 - var/lighting_changed = 0 - var/color_lighting_lumcount = 0 - - var/lumcount_r = 0 - var/lumcount_g = 0 - var/lumcount_b = 0 - var/light_col_sources = 0 - -turf/space - lighting_lumcount = 4 //starlight - -turf/proc/update_lumcount(amount, col_r, col_g, col_b, removing = 0) - lighting_lumcount += amount - - if(!isnull(col_r)) //col_r is the "key" var, if it's null so will the rest - if(removing) - light_col_sources-- - lumcount_r -= col_r - lumcount_g -= col_g - lumcount_b -= col_b - else - light_col_sources++ - lumcount_r += col_r - lumcount_g += col_g - lumcount_b += col_b - - if(light_col_sources) - var/r_avg = max(0, min(255, round(lumcount_r / light_col_sources, 16) + 15)) - var/g_avg = max(0, min(255, round(lumcount_g / light_col_sources, 16) + 15)) - var/b_avg = max(0, min(255, round(lumcount_b / light_col_sources, 16) + 15)) - l_color = rgb(r_avg, g_avg, b_avg) - else - l_color = null - - color_lighting_lumcount = max(color_lighting_lumcount + amount, 0) // Minimum of 0. - - if(!lighting_changed) - lighting_controller.changed_turfs += src - lighting_changed = 1 - -turf/proc/lighting_tag(const/level) - var/area/A = loc - return A.tagbase + "sd_L[level]" - -turf/proc/build_lighting_area(const/tag, const/level, const/color_light) - var/area/Area = loc - var/area/A = new Area.type() // create area if it wasn't found - // replicate vars - for(var/V in Area.vars) - switch(V) - if ("contents","lighting_overlay", "color_overlay", "overlays") - continue - else - if(issaved(Area.vars[V])) A.vars[V] = Area.vars[V] - - A.tag = tag - A.lighting_subarea = 1 - A.lighting_space = 0 // in case it was copied from a space subarea - - if (l_color != A.l_color) - A.l_color = l_color - //color_light = min(max(round(color_lighting_lumcount, 1), 0), lighting_controller.lighting_states) - //world << "[color_light] [color_lighting_lumcount]" - - A.SetLightLevel(level, color_light) - Area.related += A - return A - -turf/proc/shift_to_subarea() - lighting_changed = 0 - var/area/Area = loc - - if(!istype(Area) || !Area.lighting_use_dynamic) return - - var/level = min(max(round(lighting_lumcount,1),0),lighting_controller.lighting_states) - var/new_tag = lighting_tag(level) - - // pomf - If we have a lighting color that is not null, apply the new tag to seperate the areas. - if (l_color) - // pomf - We append the (rounded!) color lighting lumcount so we can have colored lights. - new_tag += "[l_color][min(max(round(color_lighting_lumcount,1),0),lighting_controller.lighting_states)]" - - if(Area.tag!=new_tag) //skip if already in this area - var/area/A = locate(new_tag) // find an appropriate area - var/color_light = min(max(round(color_lighting_lumcount,1),0),lighting_controller.lighting_states) - - if (!A) - A = build_lighting_area(new_tag, level, color_light) - else if (l_color != A.l_color) - A.l_color = l_color - //color_light = min(max(round(color_lighting_lumcount, 1), 0), lighting_controller.lighting_states) - A.SetLightLevel(level, color_light) - - A.contents += src // move the turf into the area - universe.OnTurfTick(src) - -// Dedicated lighting sublevel for space turfs -// helps us depower things in space, remove space fire alarms, -// and evens out space lighting -turf/space/lighting_tag(var/level) - var/area/A = loc - return A.tagbase + "sd_L_space" -turf/space/build_lighting_area(var/tag,var/level) - var/area/A = ..(tag,4) - A.lighting_space = 1 - A.SetLightLevel(4) - A.icon_state = null - return A - - -area - var/lighting_use_dynamic = 1 //Turn this flag off to prevent sd_DynamicAreaLighting from affecting this area - var/image/lighting_overlay //tracks the darkness image of the area for easy removal - var/lighting_subarea = 0 //tracks whether we're a lighting sub-area - var/lighting_space = 0 // true for space-only lighting subareas - var/tagbase - var/image/color_overlay //Tracks the color image. - - proc/SetLightLevel(light, color_light = 0) - if(!src) return - if(light <= 0) - light = 0 - luminosity = 0 - else - if(light > lighting_controller.lighting_states) - light = lighting_controller.lighting_states - luminosity = 1 - - if(lighting_overlay) - overlays -= lighting_overlay - lighting_overlay.icon_state = "[light]" - else - lighting_overlay = image(LIGHTING_ICON,,num2text(light),LIGHTING_LAYER) - - if (color_overlay) - overlays.Remove(color_overlay) - color_overlay.icon_state = "5" - else - if (l_color) - color_overlay = image('icons/effects/effects.dmi', ,"5", 10.1) - //color_overlay = image('icons/effects/effects.dmi', ,"white", 10.1) - - if (istype(color_overlay)) - color_overlay.color = l_color - - - switch (color_light) - if (6) - color_overlay.icon_state = "5" - //color_overlay.alpha = 180 - if (5) - color_overlay.icon_state = "4" - //color_overlay.alpha = 150 - if (4) - color_overlay.icon_state = "3" - //color_overlay.alpha = 120 - if (3) - color_overlay.icon_state = "2" - //color_overlay.alpha = 90 - if (2) - color_overlay.icon_state = "1" - //color_overlay.alpha = 60 - if (1) - color_overlay.icon_state = "1" - color_overlay.alpha = 200 - //color_overlay.alpha = 30 - if (-INFINITY to 0) - //world << "Zero or below, [color_light]." - color_overlay.alpha = 0 - else - //world << "Setting the alpha to max... color_light [color_light]." - color_overlay.alpha = 180 - - color_overlay.blend_mode = BLEND_ADD - if (color_overlay.color) - overlays.Add(color_overlay) - - if (isnull(color_overlay)) - overlays.Add(lighting_overlay) - else if (light < 6) - overlays.Add(lighting_overlay) - - proc/SetDynamicLighting() - - src.lighting_use_dynamic = 1 - for(var/turf/T in src.contents) - T.update_lumcount(0) - - proc/InitializeLighting() //TODO: could probably improve this bit ~Carn - tagbase = "[type]" - if(!tag) tag = tagbase - if(!lighting_use_dynamic) - if(!lighting_subarea) // see if this is a lighting subarea already - //show the dark overlay so areas, not yet in a lighting subarea, won't be bright as day and look silly. - SetLightLevel(4) - -//#undef LIGHTING_LAYER -#undef LIGHTING_CIRCULAR -//#undef LIGHTING_ICON - -#define LIGHTING_MAX_LUMINOSITY_STATIC 8 //Maximum luminosity to reduce lag. -#define LIGHTING_MAX_LUMINOSITY_MOBILE 5 //Moving objects have a lower max luminosity since these update more often. (lag reduction) -#define LIGHTING_MAX_LUMINOSITY_TURF 1 //turfs have a severely shortened range to protect from inevitable floor-lighttile spam. - -//set the changed status of all lights which could have possibly lit this atom. -//We don't need to worry about lights which lit us but moved away, since they will have change status set already -//This proc can cause lots of lights to be updated. :( -atom/proc/UpdateAffectingLights() - for(var/atom/A in oview(LIGHTING_MAX_LUMINOSITY_STATIC-1,src)) - if(A.light) - A.light.changed = 1 //force it to update at next process() - -//caps luminosity effects max-range based on what type the light's owner is. -atom/proc/get_light_range() - return min(luminosity, LIGHTING_MAX_LUMINOSITY_STATIC) - -atom/movable/get_light_range() - return min(luminosity, LIGHTING_MAX_LUMINOSITY_MOBILE) - -obj/machinery/light/get_light_range() - return min(luminosity, LIGHTING_MAX_LUMINOSITY_STATIC) - -turf/get_light_range() - return min(luminosity, LIGHTING_MAX_LUMINOSITY_TURF) - -#undef LIGHTING_MAX_LUMINOSITY_STATIC -#undef LIGHTING_MAX_LUMINOSITY_MOBILE -#undef LIGHTING_MAX_LUMINOSITY_TURF \ No newline at end of file diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index 9e82c55d05..723d2e001a 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -72,7 +72,7 @@ Radio: 1355 - Medical 1357 - Engineering 1359 - Security -1341 - death squad +1341 - deathsquad 1443 - Confession Intercom 1347 - Cargo techs 1349 - Service people diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index e92d323062..98d56d3d23 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -114,6 +114,10 @@ var/list/gamemode_cache = list() var/organ_health_multiplier = 1 var/organ_regeneration_multiplier = 1 + + //Paincrit knocks someone down once they hit 60 shock_stage, so by default make it so that close to 100 additional damage needs to be dealt, + //so that it's similar to HALLOSS. Lowered it a bit since hitting paincrit takes much longer to wear off than a halloss stun. + var/organ_damage_spillover_multiplier = 0.5 var/bones_can_break = 0 var/limbs_can_break = 0 @@ -185,6 +189,7 @@ var/list/gamemode_cache = list() var/ninjas_allowed = 0 var/abandon_allowed = 1 var/ooc_allowed = 1 + var/looc_allowed = 1 var/dooc_allowed = 1 var/dsay_allowed = 1 @@ -398,6 +403,7 @@ var/list/gamemode_cache = list() if ("disable_ooc") config.ooc_allowed = 0 + config.looc_allowed = 0 if ("disable_entry") config.enter_allowed = 0 @@ -668,6 +674,8 @@ var/list/gamemode_cache = list() config.organ_health_multiplier = value / 100 if("organ_regeneration_multiplier") config.organ_regeneration_multiplier = value / 100 + if("organ_damage_spillover_multiplier") + config.organ_damage_spillover_multiplier = value / 100 if("bones_can_break") config.bones_can_break = value if("limbs_can_break") diff --git a/code/controllers/failsafe.dm b/code/controllers/failsafe.dm index ee506c0d27..6e37954087 100644 --- a/code/controllers/failsafe.dm +++ b/code/controllers/failsafe.dm @@ -25,7 +25,6 @@ var/datum/controller/failsafe/Failsafe set background = 1 while(1) //more efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop if(!master_controller) new /datum/controller/game_controller() //replace the missing master_controller! This should never happen. - if(!lighting_controller) new /datum/controller/lighting() //replace the missing lighting_controller if(processing) if(lighting_controller.processing) diff --git a/code/controllers/lighting_controller.dm b/code/controllers/lighting_controller.dm deleted file mode 100644 index 8510af6714..0000000000 --- a/code/controllers/lighting_controller.dm +++ /dev/null @@ -1,130 +0,0 @@ -var/datum/controller/lighting/lighting_controller = new () - -datum/controller/lighting - var/processing = 0 - var/processing_interval = 5 //setting this too low will probably kill the server. Don't be silly with it! - var/process_cost = 0 - var/iteration = 0 - - var/lighting_states = 7 - - var/list/lights = list() - var/lights_workload_max = 0 - -// var/list/changed_lights() //TODO: possibly implement this to reduce on overheads? - - var/list/changed_turfs = list() - var/changed_turfs_workload_max = 0 - - -datum/controller/lighting/New() - lighting_states = max( 0, length(icon_states(LIGHTING_ICON))-1 ) - if(lighting_controller != src) - if(istype(lighting_controller,/datum/controller/lighting)) - Recover() //if we are replacing an existing lighting_controller (due to a crash) we attempt to preserve as much as we can - qdel(lighting_controller) - lighting_controller = src - - -//Workhorse of lighting. It cycles through each light to see which ones need their effects updating. It updates their -//effects and then processes every turf in the queue, moving the turfs to the corresponing lighting sub-area. -//All queue lists prune themselves, which will cause lights with no luminosity to be garbage collected (cheaper and safer -//than deleting them). Processing interval should be roughly half a second for best results. -//By using queues we are ensuring we don't perform more updates than are necessary -datum/controller/lighting/proc/process() - processing = 1 - spawn(0) - set background = 1 - while(1) - if(processing) - iteration++ - var/started = world.timeofday - - lights_workload_max = max(lights_workload_max,lights.len) - for(var/i=1, i<=lights.len, i++) - var/datum/light_source/L = lights[i] - if(L && !L.check()) - continue - lights.Cut(i,i+1) - i-- - - sleep(-1) - - changed_turfs_workload_max = max(changed_turfs_workload_max,changed_turfs.len) - for(var/i=1, i<=changed_turfs.len, i++) - var/turf/T = changed_turfs[i] - if(T && T.lighting_changed) - T.shift_to_subarea() - changed_turfs.Cut() // reset the changed list - - process_cost = (world.timeofday - started) - - sleep(processing_interval) - -//same as above except it attempts to shift ALL turfs in the world regardless of lighting_changed status -//Does not loop. Should be run prior to process() being called for the first time. -//Note: if we get additional z-levels at runtime (e.g. if the gateway thin ever gets finished) we can initialize specific -//z-levels with the z_level argument -datum/controller/lighting/proc/initializeLighting(var/z_level) - processing = 0 - spawn(-1) - set background = 1 - for(var/i=1, i<=lights.len, i++) - var/datum/light_source/L = lights[i] - if(L.check()) - lights.Cut(i,i+1) - i-- - - var/z_start = 1 - var/z_finish = world.maxz - if(z_level) - z_level = round(z_level,1) - if(z_level > 0 && z_level <= world.maxz) - z_start = z_level - z_finish = z_level - - for(var/k=z_start,k<=z_finish,k++) - for(var/i=1,i<=world.maxx,i++) - for(var/j=1,j<=world.maxy,j++) - var/turf/T = locate(i,j,k) - if(T) T.shift_to_subarea() - - changed_turfs.Cut() // reset the changed list - - -//Used to strip valid information from an existing controller and transfer it to a replacement -//It works by using spawn(-1) to transfer the data, if there is a runtime the data does not get transfered but the loop -//does not crash -datum/controller/lighting/proc/Recover() - if(!istype(lighting_controller.changed_turfs,/list)) - lighting_controller.changed_turfs = list() - if(!istype(lighting_controller.lights,/list)) - lighting_controller.lights = list() - - for(var/i=1, i<=lighting_controller.lights.len, i++) - var/datum/light_source/L = lighting_controller.lights[i] - if(istype(L)) - spawn(-1) //so we don't crash the loop (inefficient) - L.check() - lights += L //If we didn't runtime then this will get transferred over - - for(var/i=1, i<=lighting_controller.changed_turfs.len, i++) - var/turf/T = lighting_controller.changed_turfs[i] - if(istype(T) && T.lighting_changed) - spawn(-1) - T.shift_to_subarea() - - var/msg = "## DEBUG: [time2text(world.timeofday)] lighting_controller restarted. Reports:\n" - for(var/varname in lighting_controller.vars) - switch(varname) - if("tag","bestF","type","parent_type","vars") continue - else - var/varval1 = lighting_controller.vars[varname] - var/varval2 = vars[varname] - if(istype(varval1,/list)) - varval1 = "/list([length(varval1)])" - varval2 = "/list([length(varval2)])" - msg += "\t [varname] = [varval1] -> [varval2]\n" - world.log << msg - -#undef LIGHTING_ICON diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index d698454cab..0152af8b13 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -39,7 +39,6 @@ datum/controller/game_controller/proc/setup() setup_objects() setupgenetics() - setup_economy() SetupXenoarch() transfer_controller = new diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index d827a3a65e..ddfd99f5d6 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -30,7 +30,7 @@ var/tz = input("Z? (default 1)") as text|null new map_datum(seed,tx,ty,tz) -/client/proc/restart_controller(controller in list("Master","Failsafe","Lighting","Supply")) +/client/proc/restart_controller(controller in list("Supply")) set category = "Debug" set name = "Restart Controller" set desc = "Restart one of the various periodic loop controllers for the game (be careful!)" @@ -39,13 +39,6 @@ usr = null src = null switch(controller) - if("Failsafe") - new /datum/controller/failsafe() - feedback_add_details("admin_verb","RFailsafe") - if("Lighting") - new /datum/controller/lighting() - lighting_controller.process() - feedback_add_details("admin_verb","RLighting") if("Supply") supply_controller.process() feedback_add_details("admin_verb","RSupply") @@ -62,7 +55,7 @@ usr.client.debug_variables(antag) message_admins("Admin [key_name_admin(usr)] is debugging the [antag.role_text] template.") -/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Ticker Process","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm","Nano")) +/client/proc/debug_controller(controller in list("Master","Ticker","Ticker Process","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm","Nano")) set category = "Debug" set name = "Debug Controller" set desc = "Debug the various periodic loop controllers for the game (be careful!)" @@ -72,18 +65,12 @@ if("Master") debug_variables(master_controller) feedback_add_details("admin_verb","DMC") - if("Failsafe") - debug_variables(Failsafe) - feedback_add_details("admin_verb","DFailsafe") if("Ticker") debug_variables(ticker) feedback_add_details("admin_verb","DTicker") if("Ticker Process") debug_variables(tickerProcess) feedback_add_details("admin_verb","DTickerProcess") - if("Lighting") - debug_variables(lighting_controller) - feedback_add_details("admin_verb","DLighting") if("Air") debug_variables(air_master) feedback_add_details("admin_verb","DAir") diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm index 7db31c6fa6..68bfdab74b 100644 --- a/code/controllers/voting.dm +++ b/code/controllers/voting.dm @@ -257,7 +257,7 @@ datum/controller/vote text += "\n[question]" log_vote(text) - world << "[text]\nType vote to place your votes.\nYou have [config.vote_period/10] seconds to vote." + world << "[text]\nType vote or click here to place your votes.\nYou have [config.vote_period/10] seconds to vote." switch(vote_type) if("crew_transfer") world << sound('sound/ambience/alarm4.ogg', repeat = 0, wait = 0, volume = 50, channel = 3) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 351ec9a845..8bc6cc0580 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -2,10 +2,8 @@ data_core = new /obj/effect/datacore() return 1 -/obj/effect/datacore/proc/manifest(var/nosleep = 0) +/obj/effect/datacore/proc/manifest() spawn() - if(!nosleep) - sleep(40) for(var/mob/living/carbon/human/H in player_list) manifest_inject(H) return @@ -140,160 +138,9 @@ proc/get_id_photo(var/mob/living/carbon/human/H) - var/icon/preview_icon = null - - var/g = "m" - if (H.gender == FEMALE) - g = "f" - - var/icon/icobase = H.species.icobase - - preview_icon = new /icon(icobase, "torso_[g]") - var/icon/temp - temp = new /icon(icobase, "groin_[g]") - preview_icon.Blend(temp, ICON_OVERLAY) - temp = new /icon(icobase, "head_[g]") - preview_icon.Blend(temp, ICON_OVERLAY) - - for(var/obj/item/organ/external/E in H.organs) - preview_icon.Blend(E.get_icon(), ICON_OVERLAY) - - //Tail - if(H.species.tail) - temp = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[H.species.tail]_s") - preview_icon.Blend(temp, ICON_OVERLAY) - - // Skin tone - if(H.species.flags & HAS_SKIN_TONE) - if (H.s_tone >= 0) - preview_icon.Blend(rgb(H.s_tone, H.s_tone, H.s_tone), ICON_ADD) - else - preview_icon.Blend(rgb(-H.s_tone, -H.s_tone, -H.s_tone), ICON_SUBTRACT) - - // Skin color - if(H.species.flags & HAS_SKIN_TONE) - if(!H.species || H.species.flags & HAS_SKIN_COLOR) - preview_icon.Blend(rgb(H.r_skin, H.g_skin, H.b_skin), ICON_ADD) - - var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = H.species ? H.species.eyes : "eyes_s") - - if (H.species.flags & HAS_EYE_COLOR) - eyes_s.Blend(rgb(H.r_eyes, H.g_eyes, H.b_eyes), ICON_ADD) - - var/datum/sprite_accessory/hair_style = hair_styles_list[H.h_style] - if(hair_style) - var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s") - hair_s.Blend(rgb(H.r_hair, H.g_hair, H.b_hair), ICON_ADD) - eyes_s.Blend(hair_s, ICON_OVERLAY) - - var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[H.f_style] - if(facial_hair_style) - var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s") - facial_s.Blend(rgb(H.r_facial, H.g_facial, H.b_facial), ICON_ADD) - eyes_s.Blend(facial_s, ICON_OVERLAY) - - var/icon/clothes_s = null - switch(H.mind.assigned_role) - if("Head of Personnel") - clothes_s = new /icon('icons/mob/uniform.dmi', "hop_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - if("Bartender") - clothes_s = new /icon('icons/mob/uniform.dmi', "ba_suit_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if("Gardener") - clothes_s = new /icon('icons/mob/uniform.dmi', "hydroponics_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if("Chef") - clothes_s = new /icon('icons/mob/uniform.dmi', "chef_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if("Janitor") - clothes_s = new /icon('icons/mob/uniform.dmi', "janitor_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if("Librarian") - clothes_s = new /icon('icons/mob/uniform.dmi', "red_suit_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if("Quartermaster") - clothes_s = new /icon('icons/mob/uniform.dmi', "qm_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - if("Cargo Technician") - clothes_s = new /icon('icons/mob/uniform.dmi', "cargotech_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if("Shaft Miner") - clothes_s = new /icon('icons/mob/uniform.dmi', "miner_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if("Lawyer") - clothes_s = new /icon('icons/mob/uniform.dmi', "internalaffairs_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - if("Chaplain") - clothes_s = new /icon('icons/mob/uniform.dmi', "chapblack_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if("Research Director") - clothes_s = new /icon('icons/mob/uniform.dmi', "director_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) - if("Scientist") - clothes_s = new /icon('icons/mob/uniform.dmi', "sciencewhite_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_tox_open"), ICON_OVERLAY) - if("Chemist") - clothes_s = new /icon('icons/mob/uniform.dmi', "chemistrywhite_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_chem_open"), ICON_OVERLAY) - if("Chief Medical Officer") - clothes_s = new /icon('icons/mob/uniform.dmi', "cmo_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_cmo_open"), ICON_OVERLAY) - if("Medical Doctor") - clothes_s = new /icon('icons/mob/uniform.dmi', "medical_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) - if("Geneticist") - clothes_s = new /icon('icons/mob/uniform.dmi', "geneticswhite_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_gen_open"), ICON_OVERLAY) - if("Virologist") - clothes_s = new /icon('icons/mob/uniform.dmi', "virologywhite_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_vir_open"), ICON_OVERLAY) - if("Captain") - clothes_s = new /icon('icons/mob/uniform.dmi', "captain_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - if("Head of Security") - clothes_s = new /icon('icons/mob/uniform.dmi', "hosred_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) - if("Warden") - clothes_s = new /icon('icons/mob/uniform.dmi', "warden_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) - if("Detective") - clothes_s = new /icon('icons/mob/uniform.dmi', "detective_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "detective"), ICON_OVERLAY) - if("Security Officer") - clothes_s = new /icon('icons/mob/uniform.dmi', "secred_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) - if("Chief Engineer") - clothes_s = new /icon('icons/mob/uniform.dmi', "chief_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) - if("Station Engineer") - clothes_s = new /icon('icons/mob/uniform.dmi', "engine_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "orange"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) - if("Atmospheric Technician") - clothes_s = new /icon('icons/mob/uniform.dmi', "atmos_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) - if("Roboticist") - clothes_s = new /icon('icons/mob/uniform.dmi', "robotics_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) - else - clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - preview_icon.Blend(eyes_s, ICON_OVERLAY) - if(clothes_s) - preview_icon.Blend(clothes_s, ICON_OVERLAY) - qdel(eyes_s) - qdel(clothes_s) - + H.regenerate_icons() + var/icon/preview_icon = icon(H.icon) + for(var/image/I in H.overlays_standing) + if(I && I.icon) + preview_icon.Blend(icon(I.icon, I.icon_state), ICON_OVERLAY) return preview_icon diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index 1f6c2abd74..b562780aea 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -14,179 +14,177 @@ var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation) - New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null) - ..() - if(!initTeleport(arglist(args))) - return 0 - return 1 - - proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout) - if(!setTeleatom(ateleatom)) - return 0 - if(!setDestination(adestination)) - return 0 - if(!setPrecision(aprecision)) - return 0 - setEffects(aeffectin,aeffectout) - setForceTeleport(afteleport) - setSounds(asoundin,asoundout) - return 1 - - //must succeed - proc/setPrecision(aprecision) - if(isnum(aprecision)) - precision = aprecision - return 1 +/datum/teleport/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null) + ..() + if(!initTeleport(arglist(args))) return 0 + return 1 - //must succeed - proc/setDestination(atom/adestination) - if(istype(adestination)) - destination = adestination - return 1 +/datum/teleport/proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout) + if(!setTeleatom(ateleatom)) return 0 - - //must succeed in most cases - proc/setTeleatom(atom/movable/ateleatom) - if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon)) - qdel(ateleatom) - return 0 - if(istype(ateleatom)) - teleatom = ateleatom - return 1 + if(!setDestination(adestination)) return 0 + if(!setPrecision(aprecision)) + return 0 + setEffects(aeffectin,aeffectout) + setForceTeleport(afteleport) + setSounds(asoundin,asoundout) + return 1 - //custom effects must be properly set up first for instant-type teleports - //optional - proc/setEffects(datum/effect/effect/system/aeffectin=null,datum/effect/effect/system/aeffectout=null) - effectin = istype(aeffectin) ? aeffectin : null - effectout = istype(aeffectout) ? aeffectout : null +//must succeed +/datum/teleport/proc/setPrecision(aprecision) + if(isnum(aprecision)) + precision = aprecision return 1 + return 0 - //optional - proc/setForceTeleport(afteleport) +//must succeed +/datum/teleport/proc/setDestination(atom/adestination) + if(istype(adestination)) + destination = adestination + return 1 + return 0 + +//must succeed in most cases +/datum/teleport/proc/setTeleatom(atom/movable/ateleatom) + if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon)) + qdel(ateleatom) + return 0 + if(istype(ateleatom)) + teleatom = ateleatom + return 1 + return 0 + +//custom effects must be properly set up first for instant-type teleports +//optional +/datum/teleport/proc/setEffects(datum/effect/effect/system/aeffectin=null,datum/effect/effect/system/aeffectout=null) + effectin = istype(aeffectin) ? aeffectin : null + effectout = istype(aeffectout) ? aeffectout : null + return 1 + +//optional +/datum/teleport/proc/setForceTeleport(afteleport) force_teleport = afteleport return 1 - //optional - proc/setSounds(asoundin=null,asoundout=null) +//optional +/datum/teleport/proc/setSounds(asoundin=null,asoundout=null) soundin = isfile(asoundin) ? asoundin : null soundout = isfile(asoundout) ? asoundout : null return 1 - //placeholder - proc/teleportChecks() +//placeholder +/datum/teleport/proc/teleportChecks() return 1 - proc/playSpecials(atom/location,datum/effect/effect/system/effect,sound) - if(location) - if(effect) - spawn(-1) - src = null - effect.attach(location) - effect.start() - if(sound) - spawn(-1) - src = null - playsound(location,sound,60,1) - return +/datum/teleport/proc/playSpecials(atom/location,datum/effect/effect/system/effect,sound) + if(location) + if(effect) + spawn(-1) + src = null + effect.attach(location) + effect.start() + if(sound) + spawn(-1) + src = null + playsound(location,sound,60,1) + return - //do the monkey dance - proc/doTeleport() +//do the monkey dance +/datum/teleport/proc/doTeleport() - var/turf/destturf - var/turf/curturf = get_turf(teleatom) - var/area/destarea = get_area(destination) - if(precision) - var/list/posturfs = circlerangeturfs(destination,precision) - destturf = safepick(posturfs) - else - destturf = get_turf(destination) + var/turf/destturf + var/turf/curturf = get_turf(teleatom) + var/area/destarea = get_area(destination) + if(precision) + var/list/posturfs = circlerangeturfs(destination,precision) + destturf = safepick(posturfs) + else + destturf = get_turf(destination) - if(!destturf || !curturf) - return 0 - - playSpecials(curturf,effectin,soundin) - - var/obj/structure/bed/chair/C = null - if(isliving(teleatom)) - var/mob/living/L = teleatom - if(L.buckled) - C = L.buckled - if(force_teleport) - teleatom.forceMove(destturf) - playSpecials(destturf,effectout,soundout) - else - if(teleatom.Move(destturf)) - playSpecials(destturf,effectout,soundout) - if(C) - C.forceMove(destturf) - - destarea.Entered(teleatom) - - return 1 - - proc/teleport() - if(teleportChecks()) - return doTeleport() + if(!destturf || !curturf) return 0 + playSpecials(curturf,effectin,soundin) + + var/obj/structure/bed/chair/C = null + if(isliving(teleatom)) + var/mob/living/L = teleatom + if(L.buckled) + C = L.buckled + if(force_teleport) + teleatom.forceMove(destturf) + playSpecials(destturf,effectout,soundout) + else + if(teleatom.Move(destturf)) + playSpecials(destturf,effectout,soundout) + if(C) + C.forceMove(destturf) + + destarea.Entered(teleatom) + + return 1 + +/datum/teleport/proc/teleport() + if(teleportChecks()) + return doTeleport() + return 0 + /datum/teleport/instant //teleports when datum is created - New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null) - if(..()) - teleport() - return +/datum/teleport/instant/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null) + if(..()) + teleport() + return -/datum/teleport/instant/science - - setEffects(datum/effect/effect/system/aeffectin,datum/effect/effect/system/aeffectout) - if(!aeffectin || !aeffectout) - var/datum/effect/effect/system/spark_spread/aeffect = new - aeffect.set_up(5, 1, teleatom) - effectin = effectin || aeffect - effectout = effectout || aeffect - return 1 - else - return ..() - - setPrecision(aprecision) - ..() - if(istype(teleatom, /obj/item/weapon/storage/backpack/holding)) - precision = rand(1,100) - - var/list/bagholding = teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding) - if(bagholding.len) - precision = max(rand(1,100)*bagholding.len,100) - if(istype(teleatom, /mob/living)) - var/mob/living/MM = teleatom - MM << "\red The Bluespace interface on your Bag of Holding interferes with the teleport!" +/datum/teleport/instant/science/setEffects(datum/effect/effect/system/aeffectin,datum/effect/effect/system/aeffectout) + if(!aeffectin || !aeffectout) + var/datum/effect/effect/system/spark_spread/aeffect = new + aeffect.set_up(5, 1, teleatom) + effectin = effectin || aeffect + effectout = effectout || aeffect return 1 + else + return ..() - teleportChecks() - if(istype(teleatom, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite - teleatom.visible_message("\red The [teleatom] bounces off of the portal!") +/datum/teleport/instant/science/setPrecision(aprecision) + ..() + if(istype(teleatom, /obj/item/weapon/storage/backpack/holding)) + precision = rand(1,100) + + var/list/bagholding = teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding) + if(bagholding.len) + precision = max(rand(1,100)*bagholding.len,100) + if(istype(teleatom, /mob/living)) + var/mob/living/MM = teleatom + MM << "\The [teleatom] bounces off of the portal!") + return 0 + + if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear))) + if(istype(teleatom, /mob/living)) + var/mob/living/MM = teleatom + MM.visible_message("\The [MM] bounces off of the portal!","Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.") + else + teleatom.visible_message("\The [teleatom] bounces off of the portal!") + return 0 + + if(destination.z in config.admin_levels) //centcomm z-level + if(istype(teleatom, /obj/mecha)) + var/obj/mecha/MM = teleatom + MM.occupant << "\The [MM] would not survive the jump to a location so far away!" + return 0 + if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding))) + teleatom.visible_message("\The [teleatom] bounces off of the portal!") return 0 - if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear))) - if(istype(teleatom, /mob/living)) - var/mob/living/MM = teleatom - MM.visible_message("\red The [MM] bounces off of the portal!","\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.") - else - teleatom.visible_message("\red The [teleatom] bounces off of the portal!") - return 0 - if(destination.z == 2) //centcomm z-level - if(istype(teleatom, /obj/mecha)) - var/obj/mecha/MM = teleatom - MM.occupant << "\red The mech would not survive the jump to a location so far away!" - return 0 - if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding))) - teleatom.visible_message("\red The Bag of Holding bounces off of the portal!") - return 0 - - - if(destination.z > 7) //Away mission z-levels - return 0 - return 1 \ No newline at end of file + if(destination.z > max_default_z_level()) //Away mission z-levels + return 0 + return 1 diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index 0f10d8d56f..6098315c11 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -94,7 +94,7 @@ /datum/recipe/proc/make(var/obj/container as obj) var/obj/result_obj = new result(container) for (var/obj/O in (container.contents-result_obj)) - O.reagents.trans_to(result_obj, O.reagents.total_volume) + O.reagents.trans_to_obj(result_obj, O.reagents.total_volume) qdel(O) container.reagents.clear_reagents() return result_obj @@ -109,7 +109,7 @@ if (O.reagents) O.reagents.del_reagent("nutriment") O.reagents.update_total() - O.reagents.trans_to(result_obj, O.reagents.total_volume) + O.reagents.trans_to_obj(result_obj, O.reagents.total_volume) qdel(O) container.reagents.clear_reagents() return result_obj diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index c7495ab749..1a7a9b8ae0 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -259,7 +259,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee name = "Corgi Crate" contains = list() cost = 50 - containertype = /obj/structure/largecrate/lisa + containertype = /obj/structure/largecrate/animal/corgi containername = "Corgi Crate" group = "Hydroponics" @@ -289,7 +289,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/cow name = "Cow crate" cost = 30 - containertype = /obj/structure/largecrate/cow + containertype = /obj/structure/largecrate/animal/cow containername = "Cow crate" access = access_hydroponics group = "Hydroponics" @@ -297,7 +297,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/goat name = "Goat crate" cost = 25 - containertype = /obj/structure/largecrate/goat + containertype = /obj/structure/largecrate/animal/goat containername = "Goat crate" access = access_hydroponics group = "Hydroponics" @@ -305,19 +305,11 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/chicken name = "Chicken crate" cost = 20 - containertype = /obj/structure/largecrate/chick + containertype = /obj/structure/largecrate/animal/chick containername = "Chicken crate" access = access_hydroponics group = "Hydroponics" -/datum/supply_packs/lisa - name = "Corgi crate" - contains = list() - cost = 50 - containertype = /obj/structure/largecrate/lisa - containername = "Corgi crate" - group = "Hydroponics" - /datum/supply_packs/seeds name = "Seeds crate" contains = list(/obj/item/seeds/chiliseed, @@ -345,11 +337,17 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/weedcontrol name = "Weed control crate" - contains = list(/obj/item/weapon/scythe, + contains = list(/obj/item/weapon/hatchet, + /obj/item/weapon/hatchet, + /obj/item/weapon/reagent_containers/spray/plantbgone, + /obj/item/weapon/reagent_containers/spray/plantbgone, + /obj/item/weapon/reagent_containers/spray/plantbgone, + /obj/item/weapon/reagent_containers/spray/plantbgone, + /obj/item/clothing/mask/gas, /obj/item/clothing/mask/gas, /obj/item/weapon/grenade/chem_grenade/antiweed, /obj/item/weapon/grenade/chem_grenade/antiweed) - cost = 20 + cost = 25 containertype = /obj/structure/closet/crate/secure/hydrosec containername = "Weed control crate" access = access_hydroponics @@ -1519,7 +1517,32 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /obj/item/weapon/stock_parts/subspace/crystal, /obj/item/weapon/storage/toolbox/electrical) +/datum/supply_packs/randomised/exosuit_mod + num_contained = 1 + contains = list( + /obj/item/device/kit/paint/ripley, + /obj/item/device/kit/paint/ripley/death, + /obj/item/device/kit/paint/ripley/flames_red, + /obj/item/device/kit/paint/ripley/flames_blue + ) + name = "Random APLU modkit" + cost = 200 + containertype = /obj/structure/closet/crate + containername = "heavy crate" + group = "Miscellaneous" +/datum/supply_packs/randomised/exosuit_mod/durand + contains = list( + /obj/item/device/kit/paint/durand, + /obj/item/device/kit/paint/durand/seraph, + /obj/item/device/kit/paint/durand/phazon + ) + name = "Random Durand exosuit modkit" - - +/datum/supply_packs/randomised/exosuit_mod/gygax + contains = list( + /obj/item/device/kit/paint/gygax, + /obj/item/device/kit/paint/gygax/darkgygax, + /obj/item/device/kit/paint/gygax/recitence + ) + name = "Random Gygax exosuit modkit" diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm index 7e8c8779cf..a0f1f9c7f1 100644 --- a/code/datums/wires/airlock.dm +++ b/code/datums/wires/airlock.dm @@ -37,10 +37,11 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048 var/haspower = A.arePowerSystemsOn() //If there's no power, then no lights will be on. . += ..() - . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", + . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", (A.locked ? "The door bolts have fallen!" : "The door bolts look up."), ((A.lights && haspower) ? "The door bolt lights are on." : "The door bolt lights are off!"), ((haspower) ? "The test light is on." : "The test light is off!"), + ((A.backupPowerCablesCut()) ? "The backup power light is off!" : "The backup power light is on."), ((A.aiControlDisabled==0 && !A.emagged && haspower)? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), ((A.safe==0 && haspower)? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."), ((A.normalspeed==0 && haspower)? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."), @@ -124,7 +125,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048 //Sending a pulse through flashes the red light on the door (if the door has power). if(A.arePowerSystemsOn() && A.density) A.do_animate("deny") - if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2) + if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) //Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). A.loseMainPower() if(AIRLOCK_WIRE_DOOR_BOLTS) @@ -135,7 +136,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048 else A.unlock() - if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2) + if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). A.loseBackupPower() if(AIRLOCK_WIRE_AI_CONTROL) diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 3b0b54942f..0555a140bd 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -278,6 +278,11 @@ var/const/POWER = 8 var/r = rand(1, wires.len) CutWireIndex(r) +/datum/wires/proc/RandomCutAll(var/probability = 10) + for(var/i = 1; i < MAX_FLAG && i < (1 << wire_count); i += i) + if(prob(probability)) + CutWireIndex(i) + /datum/wires/proc/CutAll() for(var/i = 1; i < MAX_FLAG && i < (1 << wire_count); i += i) CutWireIndex(i) diff --git a/code/defines/obj.dm b/code/defines/obj.dm index e105d67a5b..a70822942f 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -80,7 +80,8 @@ for(var/datum/data/record/t in data_core.general) var/name = t.fields["name"] var/rank = t.fields["rank"] - var/real_rank = t.fields["real_rank"] + var/real_rank = make_list_rank(t.fields["real_rank"]) + if(OOC) var/active = 0 for(var/mob/M in player_list) @@ -165,6 +166,15 @@ return dat +/var/list/acting_rank_prefixes = list("acting", "temporary", "interim") + +/proc/make_list_rank(rank) + for(var/prefix in acting_rank_prefixes) + if(findtext(rank, "[prefix] ", 1, 2+length(prefix))) + return copytext(rank, 2+length(prefix)) + return rank + + /* We can't just insert in HTML into the nanoUI so we need the raw data to play with. Instead of creating this list over and over when someone leaves their PDA open to the page @@ -189,7 +199,8 @@ var/global/ManifestJSON for(var/datum/data/record/t in data_core.general) var/name = sanitize(t.fields["name"]) var/rank = sanitize(t.fields["rank"]) - var/real_rank = t.fields["real_rank"] + var/real_rank = make_list_rank(t.fields["real_rank"]) + var/isactive = t.fields["p_stat"] var/department = 0 var/depthead = 0 // Department Heads will be placed at the top of their lists. diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 5b0ae96726..4d564bbf83 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -83,7 +83,7 @@ force = 5.0 throwforce = 7.0 w_class = 2.0 - matter = list("metal" = 50) + matter = list(DEFAULT_WALL_MATERIAL = 50) attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") /obj/item/weapon/cane/concealed @@ -175,47 +175,91 @@ origin_tech = "materials=1" var/breakouttime = 300 //Deciseconds = 30s = 0.5 minute -/obj/item/weapon/legcuffs/beartrap +/obj/item/weapon/beartrap name = "bear trap" throw_speed = 2 throw_range = 1 + gender = PLURAL + icon = 'icons/obj/items.dmi' icon_state = "beartrap0" desc = "A trap used to catch bears and other legged creatures." - var/armed = 0 + throwforce = 0 + w_class = 3.0 + origin_tech = "materials=1" + var/deployed = 0 suicide_act(mob/user) - viewers(user) << "\red [user] is putting the [src.name] on \his head! It looks like \he's trying to commit suicide." + viewers(user) << "[user] is putting the [src.name] on \his head! It looks like \he's trying to commit suicide." return (BRUTELOSS) -/obj/item/weapon/legcuffs/beartrap/attack_self(mob/user as mob) +/obj/item/weapon/beartrap/attack_self(mob/user as mob) ..() if(ishuman(user) && !user.stat && !user.restrained()) - armed = !armed - icon_state = "beartrap[armed]" - user << "[src] is now [armed ? "armed" : "disarmed"]" + if(deployed==0) + user.visible_message("[user] is deploying \the [src]", "You are deploying \the [src]!") + if (do_after(user, 60)) + user.visible_message("[user] has deployed \the [src]", "You have deployed \the [src]!") + deployed = 1 + user.drop_from_inventory(src, user.loc) + update_icon() + anchored = 1 -/obj/item/weapon/legcuffs/beartrap/Crossed(AM as mob|obj) - if(armed) +/obj/item/weapon/beartrap/attack_hand(mob/user as mob) + if(ishuman(user) && !user.stat && !user.restrained()) + if(deployed==1) + user.visible_message("[user] is disarming \the [src]", "You are disarming \the [src]!") + if (do_after(user, 60)) + user.visible_message("[user] has disarmed \the [src]", "You have disarmed \the [src]!") + deployed = 0 + anchored = 0 + update_icon() + + if(deployed==0) + ..() + +/obj/item/weapon/beartrap/Crossed(AM as mob|obj) + if(deployed) if(ishuman(AM)) if(isturf(src.loc)) - var/mob/living/carbon/H = AM + var/mob/living/carbon/human/H = AM if(H.m_intent == "run") - armed = 0 - H.legcuffed = src - src.loc = H - H.update_inv_legcuffed() - H << "\red You step on \the [src]!" - feedback_add_details("handcuffs","B") //Yes, I know they're legcuffs. Don't change this, no need for an extra variable. The "B" is used to tell them apart. + deployed = 0 + update_icon() + H << "You step on \the [src]!" for(var/mob/O in viewers(H, null)) if(O == H) continue - O.show_message("\red [H] steps on \the [src].", 1) + O.show_message("[H] steps on \the [src].", 1) + if(H.lying) + var/obj/item/organ/external/affecting = pick(H.organs) + if(affecting.take_damage(30, 0)) + H.UpdateDamageIcon() + affecting.embed(src) + else + var/list/potentialorgans = list() + for(var/organ in list("l_leg", "r_leg", "l_foot", "r_foot")) + var/obj/item/organ/external/R = H.get_organ(organ) + if(R && !(R.status & ORGAN_DESTROYED)) + potentialorgans += R + var/obj/item/organ/external/affecting = pick(potentialorgans) + if(affecting.take_damage(30, 0)) + H.UpdateDamageIcon() + affecting.embed(src) + + if(isanimal(AM) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator)) - armed = 0 + deployed = 0 var/mob/living/simple_animal/SA = AM SA.health -= 20 ..() +/obj/item/weapon/beartrap/update_icon() + ..() + + if(deployed == 0) + icon_state = "beartrap0" + else + icon_state = "beartrap1" /obj/item/weapon/caution @@ -271,7 +315,7 @@ w_class = 2.0 throw_speed = 4 throw_range = 20 - matter = list("metal" = 100) + matter = list(DEFAULT_WALL_MATERIAL = 100) origin_tech = "magnets=1" /obj/item/weapon/staff @@ -321,7 +365,7 @@ var/amount = 1.0 var/laying = 0.0 var/old_lay = null - matter = list("metal" = 40) + matter = list(DEFAULT_WALL_MATERIAL = 40) attack_verb = list("whipped", "lashed", "disciplined", "tickled") suicide_act(mob/user) @@ -345,7 +389,7 @@ name = "power control module" icon_state = "power_mod" desc = "Heavy-duty switching circuits for power control." - matter = list("metal" = 50, "glass" = 50) + matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/module/power_control/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) if (istype(W, /obj/item/device/multitool)) @@ -467,35 +511,35 @@ desc = "A basic capacitor used in the construction of a variety of devices." icon_state = "capacitor" origin_tech = "powerstorage=1" - matter = list("metal" = 50,"glass" = 50) + matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 50) /obj/item/weapon/stock_parts/scanning_module name = "scanning module" desc = "A compact, high resolution scanning module used in the construction of certain devices." icon_state = "scan_module" origin_tech = "magnets=1" - matter = list("metal" = 50,"glass" = 20) + matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20) /obj/item/weapon/stock_parts/manipulator name = "micro-manipulator" desc = "A tiny little manipulator used in the construction of certain devices." icon_state = "micro_mani" origin_tech = "materials=1;programming=1" - matter = list("metal" = 30) + matter = list(DEFAULT_WALL_MATERIAL = 30) /obj/item/weapon/stock_parts/micro_laser name = "micro-laser" desc = "A tiny laser used in certain devices." icon_state = "micro_laser" origin_tech = "magnets=1" - matter = list("metal" = 10,"glass" = 20) + matter = list(DEFAULT_WALL_MATERIAL = 10,"glass" = 20) /obj/item/weapon/stock_parts/matter_bin name = "matter bin" desc = "A container for hold compressed matter awaiting re-construction." icon_state = "matter_bin" origin_tech = "materials=1" - matter = list("metal" = 80) + matter = list(DEFAULT_WALL_MATERIAL = 80) //Rank 2 @@ -504,7 +548,7 @@ desc = "An advanced capacitor used in the construction of a variety of devices." origin_tech = "powerstorage=3" rating = 2 - matter = list("metal" = 50,"glass" = 50) + matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 50) /obj/item/weapon/stock_parts/scanning_module/adv name = "advanced scanning module" @@ -512,7 +556,7 @@ icon_state = "scan_module" origin_tech = "magnets=3" rating = 2 - matter = list("metal" = 50,"glass" = 20) + matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20) /obj/item/weapon/stock_parts/manipulator/nano name = "nano-manipulator" @@ -520,7 +564,7 @@ icon_state = "nano_mani" origin_tech = "materials=3,programming=2" rating = 2 - matter = list("metal" = 30) + matter = list(DEFAULT_WALL_MATERIAL = 30) /obj/item/weapon/stock_parts/micro_laser/high name = "high-power micro-laser" @@ -528,7 +572,7 @@ icon_state = "high_micro_laser" origin_tech = "magnets=3" rating = 2 - matter = list("metal" = 10,"glass" = 20) + matter = list(DEFAULT_WALL_MATERIAL = 10,"glass" = 20) /obj/item/weapon/stock_parts/matter_bin/adv name = "advanced matter bin" @@ -536,7 +580,7 @@ icon_state = "advanced_matter_bin" origin_tech = "materials=3" rating = 2 - matter = list("metal" = 80) + matter = list(DEFAULT_WALL_MATERIAL = 80) //Rating 3 @@ -545,14 +589,14 @@ desc = "A super-high capacity capacitor used in the construction of a variety of devices." origin_tech = "powerstorage=5;materials=4" rating = 3 - matter = list("metal" = 50,"glass" = 50) + matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 50) /obj/item/weapon/stock_parts/scanning_module/phasic name = "phasic scanning module" desc = "A compact, high resolution phasic scanning module used in the construction of certain devices." origin_tech = "magnets=5" rating = 3 - matter = list("metal" = 50,"glass" = 20) + matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20) /obj/item/weapon/stock_parts/manipulator/pico name = "pico-manipulator" @@ -560,7 +604,7 @@ icon_state = "pico_mani" origin_tech = "materials=5,programming=2" rating = 3 - matter = list("metal" = 30) + matter = list(DEFAULT_WALL_MATERIAL = 30) /obj/item/weapon/stock_parts/micro_laser/ultra name = "ultra-high-power micro-laser" @@ -568,7 +612,7 @@ desc = "A tiny laser used in certain devices." origin_tech = "magnets=5" rating = 3 - matter = list("metal" = 10,"glass" = 20) + matter = list(DEFAULT_WALL_MATERIAL = 10,"glass" = 20) /obj/item/weapon/stock_parts/matter_bin/super name = "super matter bin" @@ -576,7 +620,7 @@ icon_state = "super_matter_bin" origin_tech = "materials=5" rating = 3 - matter = list("metal" = 80) + matter = list(DEFAULT_WALL_MATERIAL = 80) // Subspace stock parts @@ -585,35 +629,35 @@ icon_state = "subspace_ansible" desc = "A compact module capable of sensing extradimensional activity." origin_tech = "programming=3;magnets=5;materials=4;bluespace=2" - matter = list("metal" = 30,"glass" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10) /obj/item/weapon/stock_parts/subspace/filter name = "hyperwave filter" icon_state = "hyperwave_filter" desc = "A tiny device capable of filtering and converting super-intense radiowaves." origin_tech = "programming=4;magnets=2" - matter = list("metal" = 30,"glass" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10) /obj/item/weapon/stock_parts/subspace/amplifier name = "subspace amplifier" icon_state = "subspace_amplifier" desc = "A compact micro-machine capable of amplifying weak subspace transmissions." origin_tech = "programming=3;magnets=4;materials=4;bluespace=2" - matter = list("metal" = 30,"glass" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10) /obj/item/weapon/stock_parts/subspace/treatment name = "subspace treatment disk" icon_state = "treatment_disk" desc = "A compact micro-machine capable of stretching out hyper-compressed radio waves." origin_tech = "programming=3;magnets=2;materials=5;bluespace=2" - matter = list("metal" = 30,"glass" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10) /obj/item/weapon/stock_parts/subspace/analyzer name = "subspace wavelength analyzer" icon_state = "wavelength_analyzer" desc = "A sophisticated analyzer capable of analyzing cryptic subspace wavelengths." origin_tech = "programming=3;magnets=4;materials=4;bluespace=2" - matter = list("metal" = 30,"glass" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10) /obj/item/weapon/stock_parts/subspace/crystal name = "ansible crystal" @@ -627,7 +671,7 @@ icon_state = "subspace_transmitter" desc = "A large piece of equipment used to open a window into the subspace dimension." origin_tech = "magnets=5;materials=5;bluespace=3" - matter = list("metal" = 50) + matter = list(DEFAULT_WALL_MATERIAL = 50) /obj/item/weapon/ectoplasm name = "ectoplasm" diff --git a/code/defines/procs/radio.dm b/code/defines/procs/radio.dm index 1e0e045928..0ee38f3b12 100644 --- a/code/defines/procs/radio.dm +++ b/code/defines/procs/radio.dm @@ -3,6 +3,16 @@ #define TELECOMMS_RECEPTION_RECEIVER 2 #define TELECOMMS_RECEPTION_BOTH 3 +/proc/register_radio(source, old_frequency, new_frequency, radio_filter) + if(old_frequency) + radio_controller.remove_object(source, old_frequency) + if(new_frequency) + return radio_controller.add_object(source, new_frequency, radio_filter) + +/proc/unregister_radio(source, frequency) + if(radio_controller) + radio_controller.remove_object(source, frequency) + /proc/get_frequency_name(var/display_freq) var/freq_text diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index 8a9eb4042d..6025457758 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -1,34 +1,20 @@ -proc/sql_poll_players() +proc/sql_poll_population() if(!sqllogging) return + var/admincount = admins.len var/playercount = 0 for(var/mob/M in player_list) if(M.client) playercount += 1 establish_db_connection() if(!dbcon.IsConnected()) - log_game("SQL ERROR during player polling. Failed to connect.") + log_game("SQL ERROR during population polling. Failed to connect.") else var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") - var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO population (playercount, time) VALUES ([playercount], '[sqltime]')") + var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO `tgstation`.`population` (`playercount`, `admincount`, `time`) VALUES ([playercount], [admincount], '[sqltime]')") if(!query.Execute()) var/err = query.ErrorMsg() - log_game("SQL ERROR during player polling. Error : \[[err]\]\n") - - -proc/sql_poll_admins() - if(!sqllogging) - return - var/admincount = admins.len - establish_db_connection() - if(!dbcon.IsConnected()) - log_game("SQL ERROR during admin polling. Failed to connect.") - else - var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") - var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO population (admincount, time) VALUES ([admincount], '[sqltime]')") - if(!query.Execute()) - var/err = query.ErrorMsg() - log_game("SQL ERROR during admin polling. Error : \[[err]\]\n") + log_game("SQL ERROR during population polling. Error : \[[err]\]\n") proc/sql_report_round_start() // TODO @@ -111,10 +97,8 @@ proc/statistic_cycle() if(!sqllogging) return while(1) - sql_poll_players() - sleep(600) - sql_poll_admins() - sleep(6000) // Poll every ten minutes + sql_poll_population() + sleep(6000) //This proc is used for feedback. It is executed at round end. proc/sql_commit_feedback() @@ -157,4 +141,4 @@ proc/sql_commit_feedback() var/DBQuery/query = dbcon.NewQuery("INSERT INTO erro_feedback (id, roundid, time, variable, value) VALUES (null, [newroundid], Now(), '[variable]', '[value]')") if(!query.Execute()) var/err = query.ErrorMsg() - log_game("SQL ERROR during death reporting. Error : \[[err]\]\n") \ No newline at end of file + log_game("SQL ERROR during death reporting. Error : \[[err]\]\n") diff --git a/code/game/antagonist/outsider/ert.dm b/code/game/antagonist/outsider/ert.dm index f52f031002..946ff1dfc2 100644 --- a/code/game/antagonist/outsider/ert.dm +++ b/code/game/antagonist/outsider/ert.dm @@ -32,13 +32,9 @@ var/datum/antagonist/ert/ert player.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves) player.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(src), slot_glasses) - var/obj/item/weapon/card/id/W = new(src) - W.assignment = "Emergency Response Team" + var/obj/item/weapon/card/id/centcom/ERT/W = new(src) W.registered_name = player.real_name W.name = "[player.real_name]'s ID Card ([W.assignment])" - W.icon_state = "centcom" - W.access = get_all_accesses() - W.access += get_all_centcom_access() player.equip_to_slot_or_del(W, slot_wear_id) return 1 diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 6dcf4f93ef..21e965244b 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -26,8 +26,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station icon = 'icons/turf/areas.dmi' icon_state = "unknown" layer = 10 + luminosity = 1 mouse_opacity = 0 - invisibility = INVISIBILITY_LIGHTING var/lightswitch = 1 var/eject = null @@ -48,9 +48,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station var/has_gravity = 1 var/list/apc = list() var/no_air = null - var/area/master // master area used for power calcluations - // (original area before splitting due to sd_DAL) - var/list/related // the other areas of the same type as this // var/list/lights // list of all lights on this area var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area var/air_doors_activated = 0 @@ -102,7 +99,6 @@ var/list/ghostteleportlocs = list() icon_state = "space" requires_power = 1 always_unpowered = 1 - lighting_use_dynamic = 1 power_light = 0 power_equip = 0 power_environ = 0 @@ -145,10 +141,8 @@ area/space/atmosalert() //place to another. Look at escape shuttle for example. //All shuttles should now be under shuttle since we have smooth-wall code. -/area/shuttle //DO NOT TURN THE lighting_use_dynamic STUFF ON FOR SHUTTLES. IT BREAKS THINGS. +/area/shuttle requires_power = 0 - luminosity = 1 - lighting_use_dynamic = 0 /area/shuttle/arrival name = "\improper Arrival Shuttle" @@ -249,15 +243,11 @@ area/space/atmosalert() icon_state = "shuttle" name = "\improper Alien Shuttle Base" requires_power = 1 - luminosity = 0 - lighting_use_dynamic = 1 /area/shuttle/alien/mine icon_state = "shuttle" name = "\improper Alien Shuttle Mine" requires_power = 1 - luminosity = 0 - lighting_use_dynamic = 1 /area/shuttle/prison/ name = "\improper Prison Shuttle" @@ -343,7 +333,6 @@ area/space/atmosalert() name = "start area" icon_state = "start" requires_power = 0 - luminosity = 1 lighting_use_dynamic = 0 has_gravity = 1 @@ -361,6 +350,7 @@ area/space/atmosalert() icon_state = "centcom" requires_power = 0 unlimited_power = 1 + lighting_use_dynamic = 0 /area/centcom/control name = "\improper Centcom Control" @@ -399,6 +389,7 @@ area/space/atmosalert() icon_state = "syndie-ship" requires_power = 0 unlimited_power = 1 + lighting_use_dynamic = 0 /area/syndicate_mothership/control name = "\improper Mercenary Control Room" @@ -1009,7 +1000,6 @@ area/space/atmosalert() /area/holodeck name = "\improper Holodeck" icon_state = "Holodeck" - luminosity = 1 lighting_use_dynamic = 0 /area/holodeck/alphadeck @@ -1139,7 +1129,6 @@ area/space/atmosalert() /area/solar requires_power = 1 always_unpowered = 1 - luminosity = 1 lighting_use_dynamic = 0 auxport diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index c66859f5d1..38452c3d5b 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -10,44 +10,38 @@ /area/New() icon_state = "" layer = 10 - master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references loc.loc.master ~Carn uid = ++global_uid - related = list(src) all_areas += src - if(requires_power) - luminosity = 0 - else + if(!requires_power) power_light = 0 //rastaf0 power_equip = 0 //rastaf0 power_environ = 0 //rastaf0 - luminosity = 1 - lighting_use_dynamic = 0 ..() // spawn(15) power_change() // all machines set to current power level, also updates lighting icon - InitializeLighting() + +/area/proc/get_contents() + return contents /area/proc/get_cameras() var/list/cameras = list() - for (var/area/RA in related) - for (var/obj/machinery/camera/C in RA) - cameras += C + for (var/obj/machinery/camera/C in src) + cameras += C return cameras /area/proc/atmosalert(danger_level, var/alarm_source) if (danger_level == 0) - atmosphere_alarm.clearAlarm(master, alarm_source) + atmosphere_alarm.clearAlarm(src, alarm_source) else - atmosphere_alarm.triggerAlarm(master, alarm_source, severity = danger_level) + atmosphere_alarm.triggerAlarm(src, alarm_source, severity = danger_level) //Check all the alarms before lowering atmosalm. Raising is perfectly fine. - for (var/area/RA in related) - for (var/obj/machinery/alarm/AA in RA) - if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.report_danger_level) - danger_level = max(danger_level, AA.danger_level) + for (var/obj/machinery/alarm/AA in src) + if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.report_danger_level) + danger_level = max(danger_level, AA.danger_level) if(danger_level != atmosalm) if (danger_level < 1 && atmosalm >= 1) @@ -57,17 +51,16 @@ air_doors_close() atmosalm = danger_level - for(var/area/RA in related) - for (var/obj/machinery/alarm/AA in RA) - AA.update_icon() + for (var/obj/machinery/alarm/AA in src) + AA.update_icon() return 1 return 0 /area/proc/air_doors_close() - if(!src.master.air_doors_activated) - src.master.air_doors_activated = 1 - for(var/obj/machinery/door/firedoor/E in src.master.all_doors) + if(!air_doors_activated) + air_doors_activated = 1 + for(var/obj/machinery/door/firedoor/E in all_doors) if(!E.blocked) if(E.operating) E.nextstate = CLOSED @@ -76,9 +69,9 @@ E.close() /area/proc/air_doors_open() - if(src.master.air_doors_activated) - src.master.air_doors_activated = 0 - for(var/obj/machinery/door/firedoor/E in src.master.all_doors) + if(air_doors_activated) + air_doors_activated = 0 + for(var/obj/machinery/door/firedoor/E in all_doors) if(!E.blocked) if(E.operating) E.nextstate = OPEN @@ -89,11 +82,8 @@ /area/proc/fire_alert() if(!fire) - master.fire = 1 //used for firedoor checks - master.updateicon() - for(var/area/A in related) - A.fire = 1 - A.updateicon() + fire = 1 //used for firedoor checks + updateicon() mouse_opacity = 0 for(var/obj/machinery/door/firedoor/D in all_doors) if(!D.blocked) @@ -105,11 +95,8 @@ /area/proc/fire_reset() if (fire) - master.fire = 0 //used for firedoor checks - master.updateicon() - for(var/area/A in related) - A.fire = 0 - A.updateicon() + fire = 0 //used for firedoor checks + updateicon() mouse_opacity = 0 for(var/obj/machinery/door/firedoor/D in all_doors) if(!D.blocked) @@ -153,7 +140,7 @@ return /area/proc/updateicon() - if ((fire || eject || party) && (!requires_power||power_environ) && !lighting_space)//If it doesn't require power, can still activate this proc. + if ((fire || eject || party) && (!requires_power||power_environ) && !istype(src, /area/space))//If it doesn't require power, can still activate this proc. if(fire && !eject && !party) icon_state = "blue" /*else if(atmosalm && !fire && !eject && !party) @@ -177,56 +164,53 @@ /area/proc/powered(var/chan) // return true if the area has power to given channel - if(!master.requires_power) + if(!requires_power) return 1 - if(master.always_unpowered) + if(always_unpowered) return 0 - if(src.lighting_space) - return 0 // Nope sorry switch(chan) if(EQUIP) - return master.power_equip + return power_equip if(LIGHT) - return master.power_light + return power_light if(ENVIRON) - return master.power_environ + return power_environ return 0 // called when power status changes /area/proc/power_change() - for(var/area/RA in related) - for(var/obj/machinery/M in RA) // for each machine in the area - M.power_change() // reverify power status (to update icons etc.) - if (fire || eject || party) - RA.updateicon() + for(var/obj/machinery/M in src) // for each machine in the area + M.power_change() // reverify power status (to update icons etc.) + if (fire || eject || party) + updateicon() /area/proc/usage(var/chan) var/used = 0 switch(chan) if(LIGHT) - used += master.used_light + used += used_light if(EQUIP) - used += master.used_equip + used += used_equip if(ENVIRON) - used += master.used_environ + used += used_environ if(TOTAL) - used += master.used_light + master.used_equip + master.used_environ + used += used_light + used_equip + used_environ return used /area/proc/clear_usage() - master.used_equip = 0 - master.used_light = 0 - master.used_environ = 0 + used_equip = 0 + used_light = 0 + used_environ = 0 /area/proc/use_power(var/amount, var/chan) switch(chan) if(EQUIP) - master.used_equip += amount + used_equip += amount if(LIGHT) - master.used_light += amount + used_light += amount if(ENVIRON) - master.used_environ += amount + used_environ += amount var/list/mob/living/forced_ambiance_list = new @@ -274,27 +258,23 @@ var/list/mob/living/forced_ambiance_list = new L.client.played = world.time /area/proc/gravitychange(var/gravitystate = 0, var/area/A) - A.has_gravity = gravitystate - for(var/area/SubA in A.related) - SubA.has_gravity = gravitystate - - if(gravitystate) - for(var/mob/living/carbon/human/M in SubA) - thunk(M) - for(var/mob/M1 in SubA) - M1.make_floating(0) - else - for(var/mob/M in SubA) - if(M.Check_Dense_Object() && istype(src,/mob/living/carbon/human/)) - var/mob/living/carbon/human/H = src - if(istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.flags & NOSLIP)) //magboots + dense_object = no floaty effect - H.make_floating(0) - else - H.make_floating(1) + if(gravitystate) + for(var/mob/living/carbon/human/M in A) + thunk(M) + for(var/mob/M1 in A) + M1.make_floating(0) + else + for(var/mob/M in A) + if(M.Check_Dense_Object() && istype(src,/mob/living/carbon/human/)) + var/mob/living/carbon/human/H = src + if(istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.flags & NOSLIP)) //magboots + dense_object = no floaty effect + H.make_floating(0) else - M.make_floating(1) + H.make_floating(1) + else + M.make_floating(1) /area/proc/thunk(mob) if(istype(get_turf(mob), /turf/space)) // Can't fall onto nothing. diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 152622f88e..742c6389a9 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -11,6 +11,7 @@ var/pass_flags = 0 var/throwpass = 0 var/germ_level = GERM_LEVEL_AMBIENT // The higher the germ level, the more germ on the atom. + var/simulated = 1 //filter for actions - used by lighting overlays ///Chemistry. var/datum/reagents/reagents = null @@ -25,7 +26,7 @@ /atom/Destroy() . = ..() density = 0 - SetOpacity(0) + set_opacity(0) if(reagents) qdel(reagents) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b8b8bbb9f6..f86c135da4 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -30,15 +30,10 @@ ..() /atom/movable/Destroy() - if(opacity) - if(isturf(loc)) - if(loc:lighting_lumcount > 1) - UpdateAffectingLights() + . = ..() + loc = null - ..() - - /atom/movable/proc/initialize() return @@ -215,4 +210,4 @@ /atom/movable/overlay/attack_hand(a, b, c) if (src.master) return src.master.attack_hand(a, b, c) - return \ No newline at end of file + return diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 68e1f34f88..deb4426cf5 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -598,8 +598,7 @@ inject_amount = 0 if (inject_amount > 50) inject_amount = 50 - connected.beaker.reagents.trans_to(connected.occupant, inject_amount) - connected.beaker.reagents.reaction(connected.occupant) + connected.beaker.reagents.trans_to_mob(connected.occupant, inject_amount, CHEM_BLOOD) return 1 // return 1 forces an update to all Nano uis attached to src //////////////////////////////////////////////////////// diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 6e9c3d9b68..44486d605b 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -3,7 +3,7 @@ name = "blob" icon = 'icons/mob/blob.dmi' icon_state = "blob" - luminosity = 3 + light_range = 3 desc = "Some blob creature thingy" density = 1 opacity = 0 diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index 337ad39c0d..b5854ed981 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -22,8 +22,8 @@ desc = "A floating crystal that hums with an unearthly energy" icon_state = "pylon" var/isbroken = 0 - luminosity = 5 - l_color = "#3e0000" + light_range = 5 + light_color = "#3e0000" var/obj/item/wepon = null /obj/structure/cult/pylon/attack_hand(mob/M as mob) @@ -47,7 +47,7 @@ isbroken = 1 density = 0 icon_state = "pylon-broken" - SetLuminosity(0) + set_light(0) else user << "You hit the pylon!" playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1) @@ -66,13 +66,12 @@ isbroken = 0 density = 1 icon_state = "pylon" - SetLuminosity(5) + set_light(5) /obj/structure/cult/tome name = "Desk" desc = "A desk covered in arcane manuscripts and tomes in unknown languages. Looking at the text makes your skin crawl" icon_state = "tomealtar" -// luminosity = 5 //sprites for this no longer exist -Pete //(they were stolen from another game anyway) @@ -105,8 +104,8 @@ return /obj/effect/gateway/active - luminosity=5 - l_color="#ff0000" + light_range=5 + light_color="#ff0000" spawnable=list( /mob/living/simple_animal/hostile/scarybat, /mob/living/simple_animal/hostile/creature, @@ -114,8 +113,8 @@ ) /obj/effect/gateway/active/cult - luminosity=5 - l_color="#ff0000" + light_range=5 + light_color="#ff0000" spawnable=list( /mob/living/simple_animal/hostile/scarybat/cult, /mob/living/simple_animal/hostile/creature/cult, diff --git a/code/game/gamemodes/cult/cultify/mob.dm b/code/game/gamemodes/cult/cultify/mob.dm index 965d2548f7..154078de3d 100644 --- a/code/game/gamemodes/cult/cultify/mob.dm +++ b/code/game/gamemodes/cult/cultify/mob.dm @@ -43,7 +43,7 @@ narsimage = image('icons/obj/narsie.dmi',src.loc,"narsie",9,1) narsimage.mouse_opacity = 0 if(!narglow) //Create narglow - narglow = image('icons/obj/narsie.dmi',narsimage.loc,"glow-narsie",LIGHTING_LAYER+2,1) + narglow = image('icons/obj/narsie.dmi',narsimage.loc,"glow-narsie",12,1) narglow.mouse_opacity = 0 //Else if no dir is given, simply send them the image of narsie var/new_x = 32 * (N.x - src.x) + N.pixel_x diff --git a/code/game/gamemodes/cult/cultify/obj.dm b/code/game/gamemodes/cult/cultify/obj.dm index 630877eb11..cbc3571896 100644 --- a/code/game/gamemodes/cult/cultify/obj.dm +++ b/code/game/gamemodes/cult/cultify/obj.dm @@ -32,13 +32,6 @@ /obj/item/weapon/storage/backpack/cultpack/cultify() return -/obj/item/weapon/table_parts/cultify() - new /obj/item/weapon/table_parts/wood(loc) - ..() - -/obj/item/weapon/table_parts/wood/cultify() - return - /obj/machinery/cultify() // We keep the number of cultified machines down by only converting those that are dense // The alternative is to keep a separate file of exceptions. @@ -149,8 +142,12 @@ ..() /obj/structure/table/cultify() - new /obj/structure/table/woodentable(loc) - ..() - -/obj/structure/table/woodentable/cultify() - return + // Make it a wood-reinforced wooden table. + // There are cult materials available, but it'd make the table non-deconstructable with how holotables work. + // Could possibly use a new material var for holographic-ness? + material = name_to_material["wood"] + reinforced = name_to_material["wood"] + update_desc() + update_connections(1) + update_icon() + update_material() diff --git a/code/game/gamemodes/cult/hell_universe.dm b/code/game/gamemodes/cult/hell_universe.dm index 39f4402391..9a7344f036 100644 --- a/code/game/gamemodes/cult/hell_universe.dm +++ b/code/game/gamemodes/cult/hell_universe.dm @@ -54,9 +54,8 @@ In short: runedec += 9000 //basically removing the rune cap /datum/universal_state/hell/proc/AreaSet() - for(var/area/ca in world) - var/area/A = ca.master - if(!istype(A,/area) || A.name=="Space") + for(var/area/A in world) + if(A.name=="Space") continue // Reset all alarms. @@ -74,9 +73,8 @@ In short: spess.overlays += I /datum/universal_state/hell/proc/AmbientSet() - for(var/turf/T in world) - if(istype(T, /turf/space)) continue - T.update_lumcount(1, 255, 0, 0, 0) + for(var/atom/movable/lighting_overlay/L in world) + L.update_lumcount(1, 0, 0) /datum/universal_state/hell/proc/MiscSet() for(var/turf/simulated/floor/T in world) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 5599be4686..8ead4b96ba 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -127,6 +127,7 @@ var/list/sacrificed = list() if(target.getFireLoss() < 100) target.hallucination = min(target.hallucination, 500) return 0 + target.take_overall_damage(0, rand(5, 20)) // You dirty resister cannot handle the damage to your mind. Easily. - even cultists who accept right away should experience some effects // Resist messages go! if(initial_message) //don't do this stuff right away, only if they resist or hesitate. @@ -417,6 +418,7 @@ var/list/sacrificed = list() var/mob/dead/observer/ghost for(var/mob/dead/observer/O in this_rune.loc) if(!O.client) continue + if(!O.MayRespawn()) continue if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue ghost = O break diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index 305205c6a0..dc315ac510 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm @@ -8,7 +8,7 @@ //luminosity = 5 //l_color="#0066FF" - layer = LIGHTING_LAYER+1 + layer = 11 var/spawned=0 // DIR mask var/next_check=0 @@ -23,7 +23,7 @@ processing_turfs.Remove(src) ..() -/turf/unsimulated/wall/supermatter/proc/process() +/turf/unsimulated/wall/supermatter/process() // Only check infrequently. if(next_check>world.time) return diff --git a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm index 62c8b1aa44..8c826fe22d 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm @@ -10,7 +10,7 @@ announce=0 narnar=0 - layer=LIGHTING_LAYER+2 // ITS SO BRIGHT + layer=12 // ITS SO BRIGHT consume_range = 6 @@ -65,7 +65,7 @@ /mob/proc/see_rift(var/obj/singularity/narsie/large/exit/R) if((R.z == src.z) && (get_dist(R,src) <= (R.consume_range+10)) && !(R in view(src))) if(!riftimage) - riftimage = image('icons/obj/rift.dmi',src.loc,"rift",LIGHTING_LAYER+2,1) + riftimage = image('icons/obj/rift.dmi',src.loc,"rift",12,1) riftimage.mouse_opacity = 0 var/new_x = 32 * (R.x - src.x) + R.pixel_x diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm index 23729763a5..37b68340a8 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm @@ -83,11 +83,10 @@ AUTOMATED ALERT: Link to [command_name()] lost."} return /datum/universal_state/supermatter_cascade/proc/AreaSet() - for(var/area/ca in world) - var/area/A=ca.master + for(var/area/A in world) if(A.z in config.admin_levels) continue - if(!istype(A,/area) || istype(A,/area/space)) + if(istype(A,/area/space)) continue // Reset all alarms. @@ -111,10 +110,9 @@ AUTOMATED ALERT: Link to [command_name()] lost."} spess.overlays += "end01" /datum/universal_state/supermatter_cascade/proc/AmbientSet() - for(var/turf/T in world) - if(istype(T, /turf/space)) continue - if(!(T.z in config.admin_levels)) - T.update_lumcount(1, 160, 255, 0, 0) + for(var/atom/movable/lighting_overlay/L in world) + if(!(L.z in config.admin_levels)) + L.update_lumcount(0.5, 1, 0) /datum/universal_state/supermatter_cascade/proc/MiscSet() for (var/obj/machinery/firealarm/alm in world) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 68641616d8..34a57a0768 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -110,11 +110,11 @@ var/global/datum/controller/gameticker/ticker else src.mode.announce() + current_state = GAME_STATE_PLAYING create_characters() //Create player characters and transfer them collect_minds() equip_characters() data_core.manifest() - current_state = GAME_STATE_PLAYING callHook("roundstart") @@ -155,7 +155,6 @@ var/global/datum/controller/gameticker/ticker for(var/obj/multiz/ladder/L in world) L.connect() //Lazy hackfix for ladders. TODO: move this to an actual controller. ~ Z if(config.sql_enabled) - spawn(3000) statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE return 1 @@ -292,7 +291,7 @@ var/global/datum/controller/gameticker/ticker if(player.mind.assigned_role != "MODE") job_master.EquipRank(player, player.mind.assigned_role, 0) UpdateFactionList(player) - EquipCustomItems(player) + equip_custom_items(player) if(captainless) for(var/mob/M in player_list) if(!istype(M,/mob/new_player)) @@ -418,7 +417,7 @@ var/global/datum/controller/gameticker/ticker robo.laws.show_laws(world) if(dronecount) - world << "There [dronecount>1 ? "were" : "was"] [dronecount] industrious maintenance [dronecount>1 ? "drones" : "drone"] at the end of this round." + world << "There [dronecount>1 ? "were" : "was"] [dronecount] industrious maintenance [dronecount>1 ? "drones" : "drone"] at the end of this round." mode.declare_completion()//To declare normal completion. diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 7b6b1dc952..530b9b9567 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -8,7 +8,7 @@ item_state = "electronic" throw_speed = 4 throw_range = 20 - matter = list("metal" = 500) + matter = list(DEFAULT_WALL_MATERIAL = 500) var/obj/item/weapon/disk/nuclear/the_disk = null var/active = 0 diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 076c0afbf3..d13f90d2be 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -798,7 +798,7 @@ datum/objective/heist/salvage choose_target() switch(rand(1,8)) if(1) - target = "metal" + target = DEFAULT_WALL_MATERIAL target_amount = 300 if(2) target = "glass" diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 2981596645..3c029d5298 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -24,44 +24,6 @@ if (prob(75)) DIFFMUT = rand(0,20) - /* Old, for reference (so I don't accidentally activate something) - N3X - var/list/avnums = new/list() - var/tempnum - - avnums.Add(2) - avnums.Add(12) - avnums.Add(10) - avnums.Add(8) - avnums.Add(4) - avnums.Add(11) - avnums.Add(13) - avnums.Add(6) - - tempnum = pick(avnums) - avnums.Remove(tempnum) - HULKBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - TELEBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - FIREBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - XRAYBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - CLUMSYBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - FAKEBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - DEAFBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - BLINDBLOCK = tempnum - */ var/list/numsToAssign=new() for(var/i=1;i