mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 06:22:26 +01:00
+8
-7
@@ -1,7 +1,8 @@
|
||||
#ignore misc BYOND files
|
||||
*.log
|
||||
*.int
|
||||
*.rsc
|
||||
*.dmb
|
||||
*.lk
|
||||
data/
|
||||
#ignore misc BYOND files
|
||||
*.log
|
||||
*.int
|
||||
*.rsc
|
||||
*.dmb
|
||||
*.lk
|
||||
*.backup
|
||||
data/
|
||||
|
||||
+69
-27
@@ -93,8 +93,10 @@
|
||||
#include "code\controllers\lighting_controller.dm"
|
||||
#include "code\controllers\master_controller.dm"
|
||||
#include "code\controllers\shuttle_controller.dm"
|
||||
#include "code\controllers\subsystems.dm"
|
||||
#include "code\controllers\verbs.dm"
|
||||
#include "code\controllers\voting.dm"
|
||||
#include "code\controllers\subsystem\alarms.dm"
|
||||
#include "code\datums\ai_laws.dm"
|
||||
#include "code\datums\browser.dm"
|
||||
#include "code\datums\computerfiles.dm"
|
||||
@@ -237,14 +239,12 @@
|
||||
#include "code\game\gamemodes\cult\ritual.dm"
|
||||
#include "code\game\gamemodes\cult\runes.dm"
|
||||
#include "code\game\gamemodes\cult\talisman.dm"
|
||||
#include "code\game\gamemodes\events\biomass.dm"
|
||||
#include "code\game\gamemodes\events\black_hole.dm"
|
||||
#include "code\game\gamemodes\events\clang.dm"
|
||||
#include "code\game\gamemodes\events\dust.dm"
|
||||
#include "code\game\gamemodes\events\miniblob.dm"
|
||||
#include "code\game\gamemodes\events\power_failure.dm"
|
||||
#include "code\game\gamemodes\events\space_ninja.dm"
|
||||
#include "code\game\gamemodes\events\spacevines.dm"
|
||||
#include "code\game\gamemodes\events\wormholes.dm"
|
||||
#include "code\game\gamemodes\events\holidays\Christmas.dm"
|
||||
#include "code\game\gamemodes\events\holidays\Holidays.dm"
|
||||
@@ -304,8 +304,8 @@
|
||||
#include "code\game\machinery\autolathe.dm"
|
||||
#include "code\game\machinery\autolathe_datums.dm"
|
||||
#include "code\game\machinery\Beacon.dm"
|
||||
#include "code\game\machinery\bees_apiary.dm"
|
||||
#include "code\game\machinery\bees_items.dm"
|
||||
#include "code\game\machinery\biogenerator.dm"
|
||||
#include "code\game\machinery\bioprinter.dm"
|
||||
#include "code\game\machinery\buttons.dm"
|
||||
#include "code\game\machinery\cell_charger.dm"
|
||||
@@ -382,8 +382,6 @@
|
||||
#include "code\game\machinery\computer\computer.dm"
|
||||
#include "code\game\machinery\computer\crew.dm"
|
||||
#include "code\game\machinery\computer\guestpass.dm"
|
||||
#include "code\game\machinery\computer\HolodeckControl.dm"
|
||||
#include "code\game\machinery\computer\hologram.dm"
|
||||
#include "code\game\machinery\computer\law.dm"
|
||||
#include "code\game\machinery\computer\medical.dm"
|
||||
#include "code\game\machinery\computer\message.dm"
|
||||
@@ -453,9 +451,7 @@
|
||||
#include "code\game\machinery\embedded_controller\embedded_program_base.dm"
|
||||
#include "code\game\machinery\embedded_controller\simple_docking_controller.dm"
|
||||
#include "code\game\machinery\kitchen\gibber.dm"
|
||||
#include "code\game\machinery\kitchen\juicer.dm"
|
||||
#include "code\game\machinery\kitchen\microwave.dm"
|
||||
#include "code\game\machinery\kitchen\processor.dm"
|
||||
#include "code\game\machinery\kitchen\smartfridge.dm"
|
||||
#include "code\game\machinery\pipe\construction.dm"
|
||||
#include "code\game\machinery\pipe\pipe_dispenser.dm"
|
||||
@@ -489,6 +485,7 @@
|
||||
#include "code\game\mecha\working\hoverpod.dm"
|
||||
#include "code\game\mecha\working\ripley.dm"
|
||||
#include "code\game\mecha\working\working.dm"
|
||||
#include "code\game\objects\buckling.dm"
|
||||
#include "code\game\objects\empulse.dm"
|
||||
#include "code\game\objects\explosion.dm"
|
||||
#include "code\game\objects\explosion_recursive.dm"
|
||||
@@ -552,6 +549,7 @@
|
||||
#include "code\game\objects\items\devices\pipe_painter.dm"
|
||||
#include "code\game\objects\items\devices\powersink.dm"
|
||||
#include "code\game\objects\items\devices\scanners.dm"
|
||||
#include "code\game\objects\items\devices\spy_bug.dm"
|
||||
#include "code\game\objects\items\devices\suit_cooling.dm"
|
||||
#include "code\game\objects\items\devices\taperecorder.dm"
|
||||
#include "code\game\objects\items\devices\traitordevices.dm"
|
||||
@@ -572,6 +570,7 @@
|
||||
#include "code\game\objects\items\robot\robot_items.dm"
|
||||
#include "code\game\objects\items\robot\robot_parts.dm"
|
||||
#include "code\game\objects\items\robot\robot_upgrades.dm"
|
||||
#include "code\game\objects\items\stacks\matter_synth.dm"
|
||||
#include "code\game\objects\items\stacks\medical.dm"
|
||||
#include "code\game\objects\items\stacks\nanopaste.dm"
|
||||
#include "code\game\objects\items\stacks\rods.dm"
|
||||
@@ -632,9 +631,11 @@
|
||||
#include "code\game\objects\items\weapons\circuitboards\computer\research.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\computer\supply.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\computer\telecomms.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\machinery\biogenerator.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\machinery\cloning.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\machinery\pacman.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\machinery\power.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\machinery\recharge_station.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\machinery\research.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\machinery\shieldgen.dm"
|
||||
#include "code\game\objects\items\weapons\circuitboards\machinery\telecomms.dm"
|
||||
@@ -704,6 +705,7 @@
|
||||
#include "code\game\objects\structures\tank_dispenser.dm"
|
||||
#include "code\game\objects\structures\target_stake.dm"
|
||||
#include "code\game\objects\structures\transit_tubes.dm"
|
||||
#include "code\game\objects\structures\under_wardrobe.dm"
|
||||
#include "code\game\objects\structures\watercloset.dm"
|
||||
#include "code\game\objects\structures\windoor_assembly.dm"
|
||||
#include "code\game\objects\structures\window.dm"
|
||||
@@ -789,6 +791,7 @@
|
||||
#include "code\modules\admin\verbs\debug.dm"
|
||||
#include "code\modules\admin\verbs\diagnostics.dm"
|
||||
#include "code\modules\admin\verbs\getlogs.dm"
|
||||
#include "code\modules\admin\verbs\icarus.dm"
|
||||
#include "code\modules\admin\verbs\mapping.dm"
|
||||
#include "code\modules\admin\verbs\massmodvar.dm"
|
||||
#include "code\modules\admin\verbs\modifyvariables.dm"
|
||||
@@ -806,6 +809,13 @@
|
||||
#include "code\modules\admin\verbs\ticklag.dm"
|
||||
#include "code\modules\admin\verbs\tripAI.dm"
|
||||
#include "code\modules\admin\verbs\vox_raiders.dm"
|
||||
#include "code\modules\alarm\alarm.dm"
|
||||
#include "code\modules\alarm\alarm_handler.dm"
|
||||
#include "code\modules\alarm\atmosphere_alarm.dm"
|
||||
#include "code\modules\alarm\camera_alarm.dm"
|
||||
#include "code\modules\alarm\fire_alarm.dm"
|
||||
#include "code\modules\alarm\motion_alarm.dm"
|
||||
#include "code\modules\alarm\power_alarm.dm"
|
||||
#include "code\modules\assembly\assembly.dm"
|
||||
#include "code\modules\assembly\bomb.dm"
|
||||
#include "code\modules\assembly\helpers.dm"
|
||||
@@ -871,7 +881,6 @@
|
||||
#include "code\modules\clothing\spacesuits\rig\modules\computer.dm"
|
||||
#include "code\modules\clothing\spacesuits\rig\modules\modules.dm"
|
||||
#include "code\modules\clothing\spacesuits\rig\modules\ninja.dm"
|
||||
#include "code\modules\clothing\spacesuits\rig\modules\rig_weapons.dm"
|
||||
#include "code\modules\clothing\spacesuits\rig\modules\utility.dm"
|
||||
#include "code\modules\clothing\spacesuits\rig\modules\vision.dm"
|
||||
#include "code\modules\clothing\spacesuits\rig\suits\alien.dm"
|
||||
@@ -898,14 +907,16 @@
|
||||
#include "code\modules\clothing\under\miscellaneous.dm"
|
||||
#include "code\modules\clothing\under\shorts.dm"
|
||||
#include "code\modules\clothing\under\syndicate.dm"
|
||||
#include "code\modules\clothing\under\ties.dm"
|
||||
#include "code\modules\clothing\under\accessories\accessory.dm"
|
||||
#include "code\modules\clothing\under\accessories\armband.dm"
|
||||
#include "code\modules\clothing\under\accessories\holster.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\destilery\main.dm"
|
||||
#include "code\modules\detectivework\evidence.dm"
|
||||
#include "code\modules\detectivework\footprints_and_rag.dm"
|
||||
#include "code\modules\detectivework\forensics.dm"
|
||||
@@ -950,6 +961,13 @@
|
||||
#include "code\modules\events\spontaneous_appendicitis.dm"
|
||||
#include "code\modules\events\viral_infection.dm"
|
||||
#include "code\modules\events\wallrot.dm"
|
||||
#include "code\modules\examine\examine.dm"
|
||||
#include "code\modules\examine\descriptions\atmospherics.dm"
|
||||
#include "code\modules\examine\descriptions\engineering.dm"
|
||||
#include "code\modules\examine\descriptions\mobs.dm"
|
||||
#include "code\modules\examine\descriptions\stacks.dm"
|
||||
#include "code\modules\examine\descriptions\structures.dm"
|
||||
#include "code\modules\examine\descriptions\turfs.dm"
|
||||
#include "code\modules\ext_scripts\irc.dm"
|
||||
#include "code\modules\ext_scripts\python.dm"
|
||||
#include "code\modules\flufftext\Dreaming.dm"
|
||||
@@ -958,15 +976,29 @@
|
||||
#include "code\modules\food\recipes_microwave.dm"
|
||||
#include "code\modules\games\cards.dm"
|
||||
#include "code\modules\genetics\side_effects.dm"
|
||||
#include "code\modules\hydroponics\biogenerator.dm"
|
||||
#include "code\modules\holodeck\HolodeckControl.dm"
|
||||
#include "code\modules\holodeck\HolodeckObjects.dm"
|
||||
#include "code\modules\hydroponics\_hydro_setup.dm"
|
||||
#include "code\modules\hydroponics\grown.dm"
|
||||
#include "code\modules\hydroponics\grown_inedible.dm"
|
||||
#include "code\modules\hydroponics\hydro_tools.dm"
|
||||
#include "code\modules\hydroponics\hydro_tray.dm"
|
||||
#include "code\modules\hydroponics\grown_predefined.dm"
|
||||
#include "code\modules\hydroponics\seed.dm"
|
||||
#include "code\modules\hydroponics\seed_controller.dm"
|
||||
#include "code\modules\hydroponics\seed_datums.dm"
|
||||
#include "code\modules\hydroponics\seed_machines.dm"
|
||||
#include "code\modules\hydroponics\seed_mobs.dm"
|
||||
#include "code\modules\hydroponics\seeds.dm"
|
||||
#include "code\modules\hydroponics\vines.dm"
|
||||
#include "code\modules\hydroponics\seed_packets.dm"
|
||||
#include "code\modules\hydroponics\seed_storage.dm"
|
||||
#include "code\modules\hydroponics\spreading\spreading.dm"
|
||||
#include "code\modules\hydroponics\spreading\spreading_growth.dm"
|
||||
#include "code\modules\hydroponics\spreading\spreading_response.dm"
|
||||
#include "code\modules\hydroponics\trays\tray.dm"
|
||||
#include "code\modules\hydroponics\trays\tray_apiary.dm"
|
||||
#include "code\modules\hydroponics\trays\tray_process.dm"
|
||||
#include "code\modules\hydroponics\trays\tray_reagents.dm"
|
||||
#include "code\modules\hydroponics\trays\tray_soil.dm"
|
||||
#include "code\modules\hydroponics\trays\tray_tools.dm"
|
||||
#include "code\modules\hydroponics\trays\tray_update_icons.dm"
|
||||
#include "code\modules\library\lib_items.dm"
|
||||
#include "code\modules\library\lib_machines.dm"
|
||||
#include "code\modules\library\lib_readme.dm"
|
||||
@@ -991,7 +1023,6 @@
|
||||
#include "code\modules\mining\ore.dm"
|
||||
#include "code\modules\mining\ore_datum.dm"
|
||||
#include "code\modules\mining\satchel_ore_boxdm.dm"
|
||||
#include "code\modules\mining\drilling\distribution.dm"
|
||||
#include "code\modules\mining\drilling\drill.dm"
|
||||
#include "code\modules\mining\drilling\scanner.dm"
|
||||
#include "code\modules\mob\death.dm"
|
||||
@@ -1031,6 +1062,7 @@
|
||||
#include "code\modules\mob\living\carbon\carbon_powers.dm"
|
||||
#include "code\modules\mob\living\carbon\give.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"
|
||||
#include "code\modules\mob\living\carbon\alien\alien_attacks.dm"
|
||||
#include "code\modules\mob\living\carbon\alien\alien_damage.dm"
|
||||
@@ -1097,6 +1129,7 @@
|
||||
#include "code\modules\mob\living\carbon\metroid\emote.dm"
|
||||
#include "code\modules\mob\living\carbon\metroid\examine.dm"
|
||||
#include "code\modules\mob\living\carbon\metroid\hud.dm"
|
||||
#include "code\modules\mob\living\carbon\metroid\items.dm"
|
||||
#include "code\modules\mob\living\carbon\metroid\life.dm"
|
||||
#include "code\modules\mob\living\carbon\metroid\login.dm"
|
||||
#include "code\modules\mob\living\carbon\metroid\metroid.dm"
|
||||
@@ -1112,7 +1145,6 @@
|
||||
#include "code\modules\mob\living\carbon\monkey\login.dm"
|
||||
#include "code\modules\mob\living\carbon\monkey\monkey.dm"
|
||||
#include "code\modules\mob\living\carbon\monkey\update_icons.dm"
|
||||
#include "code\modules\mob\living\silicon\alarm.dm"
|
||||
#include "code\modules\mob\living\silicon\death.dm"
|
||||
#include "code\modules\mob\living\silicon\laws.dm"
|
||||
#include "code\modules\mob\living\silicon\login.dm"
|
||||
@@ -1121,11 +1153,13 @@
|
||||
#include "code\modules\mob\living\silicon\ai\ai.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\death.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\examine.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\latejoin.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\laws.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\life.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\login.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\logout.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\say.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\subsystems.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\freelook\cameranet.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\freelook\chunk.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\freelook\eye.dm"
|
||||
@@ -1142,6 +1176,7 @@
|
||||
#include "code\modules\mob\living\silicon\pai\recruit.dm"
|
||||
#include "code\modules\mob\living\silicon\pai\say.dm"
|
||||
#include "code\modules\mob\living\silicon\pai\software.dm"
|
||||
#include "code\modules\mob\living\silicon\pai\software_modules.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\analyzer.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\component.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\death.dm"
|
||||
@@ -1157,6 +1192,7 @@
|
||||
#include "code\modules\mob\living\silicon\robot\robot_items.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\robot_movement.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\subsystems.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\drone\drone.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\drone\drone_abilities.dm"
|
||||
#include "code\modules\mob\living\silicon\robot\drone\drone_console.dm"
|
||||
@@ -1211,9 +1247,14 @@
|
||||
#include "code\modules\nano\JSON Reader.dm"
|
||||
#include "code\modules\nano\JSON Writer.dm"
|
||||
#include "code\modules\nano\nanoexternal.dm"
|
||||
#include "code\modules\nano\nanointeraction.dm"
|
||||
#include "code\modules\nano\nanomanager.dm"
|
||||
#include "code\modules\nano\nanomapgen.dm"
|
||||
#include "code\modules\nano\nanoui.dm"
|
||||
#include "code\modules\nano\modules\alarm_monitor.dm"
|
||||
#include "code\modules\nano\modules\crew_monitor.dm"
|
||||
#include "code\modules\nano\modules\power_monitor.dm"
|
||||
#include "code\modules\nano\modules\rcon.dm"
|
||||
#include "code\modules\organs\blood.dm"
|
||||
#include "code\modules\organs\organ.dm"
|
||||
#include "code\modules\organs\organ_alien.dm"
|
||||
@@ -1268,7 +1309,6 @@
|
||||
#include "code\modules\power\antimatter\containment_jar.dm"
|
||||
#include "code\modules\power\antimatter\control.dm"
|
||||
#include "code\modules\power\antimatter\shielding.dm"
|
||||
#include "code\modules\power\rust\areas.dm"
|
||||
#include "code\modules\power\rust\circuits_and_design.dm"
|
||||
#include "code\modules\power\rust\core_control.dm"
|
||||
#include "code\modules\power\rust\core_field.dm"
|
||||
@@ -1309,6 +1349,7 @@
|
||||
#include "code\modules\projectiles\ammunition\bullets.dm"
|
||||
#include "code\modules\projectiles\guns\alien.dm"
|
||||
#include "code\modules\projectiles\guns\energy.dm"
|
||||
#include "code\modules\projectiles\guns\launcher.dm"
|
||||
#include "code\modules\projectiles\guns\projectile.dm"
|
||||
#include "code\modules\projectiles\guns\energy\laser.dm"
|
||||
#include "code\modules\projectiles\guns\energy\nuclear.dm"
|
||||
@@ -1316,14 +1357,17 @@
|
||||
#include "code\modules\projectiles\guns\energy\special.dm"
|
||||
#include "code\modules\projectiles\guns\energy\stun.dm"
|
||||
#include "code\modules\projectiles\guns\energy\temperature.dm"
|
||||
#include "code\modules\projectiles\guns\launcher\crossbow.dm"
|
||||
#include "code\modules\projectiles\guns\launcher\grenade_launcher.dm"
|
||||
#include "code\modules\projectiles\guns\launcher\pneumatic.dm"
|
||||
#include "code\modules\projectiles\guns\launcher\rocket.dm"
|
||||
#include "code\modules\projectiles\guns\launcher\syringe_gun.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\automatic.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\crossbow.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\launcher.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\dartgun.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\pistol.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\pneumatic.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\revolver.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\rocket.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\shotgun.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\sniper.dm"
|
||||
#include "code\modules\projectiles\projectile\animate.dm"
|
||||
#include "code\modules\projectiles\projectile\beams.dm"
|
||||
#include "code\modules\projectiles\projectile\bullets.dm"
|
||||
@@ -1331,6 +1375,8 @@
|
||||
#include "code\modules\projectiles\projectile\energy.dm"
|
||||
#include "code\modules\projectiles\projectile\force.dm"
|
||||
#include "code\modules\projectiles\projectile\special.dm"
|
||||
#include "code\modules\random_map\mining_distribution.dm"
|
||||
#include "code\modules\random_map\random_map.dm"
|
||||
#include "code\modules\reagents\Chemistry-Colours.dm"
|
||||
#include "code\modules\reagents\Chemistry-Holder.dm"
|
||||
#include "code\modules\reagents\Chemistry-Machinery.dm"
|
||||
@@ -1338,11 +1384,8 @@
|
||||
#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\dartgun.dm"
|
||||
#include "code\modules\reagents\grenade_launcher.dm"
|
||||
#include "code\modules\reagents\reagent_containers.dm"
|
||||
#include "code\modules\reagents\reagent_dispenser.dm"
|
||||
#include "code\modules\reagents\syringe_gun.dm"
|
||||
#include "code\modules\reagents\reagent_containers\blood_pack.dm"
|
||||
#include "code\modules\reagents\reagent_containers\borghydro.dm"
|
||||
#include "code\modules\reagents\reagent_containers\dropper.dm"
|
||||
@@ -1362,7 +1405,6 @@
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\drinkingglass.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\jar.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\bottle\robot.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\snacks\grown.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\snacks\meat.dm"
|
||||
#include "code\modules\reagents\reagent_containers\glass\bottle.dm"
|
||||
#include "code\modules\reagents\reagent_containers\glass\bottle\robot.dm"
|
||||
@@ -1423,7 +1465,6 @@
|
||||
#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\prehistoric_plants.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"
|
||||
@@ -1496,6 +1537,7 @@
|
||||
#include "code\modules\vehicles\cargo_train.dm"
|
||||
#include "code\modules\vehicles\train.dm"
|
||||
#include "code\modules\vehicles\vehicle.dm"
|
||||
#include "code\modules\virus2\admin.dm"
|
||||
#include "code\modules\virus2\analyser.dm"
|
||||
#include "code\modules\virus2\antibodies.dm"
|
||||
#include "code\modules\virus2\centrifuge.dm"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
//transfer_moles - Limits the amount of moles to transfer. The actual amount of gas moved may also be limited by available_power, if given.
|
||||
//available_power - the maximum amount of power that may be used when moving gas. If null then the transfer is not limited by power.
|
||||
/proc/pump_gas(var/obj/machinery/M, var/datum/gas_mixture/source, var/datum/gas_mixture/sink, var/transfer_moles = null, var/available_power = null)
|
||||
if (source.total_moles < MINUMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (source.total_moles < MINIMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
//var/source_moles_initial = source.total_moles
|
||||
@@ -41,7 +41,7 @@
|
||||
if (!isnull(available_power) && specific_power > 0)
|
||||
transfer_moles = min(transfer_moles, available_power / specific_power)
|
||||
|
||||
if (transfer_moles < MINUMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (transfer_moles < MINIMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
//Update flow rate meter
|
||||
@@ -75,7 +75,7 @@
|
||||
//total_transfer_moles - Limits the amount of moles to scrub. The actual amount of gas scrubbed may also be limited by available_power, if given.
|
||||
//available_power - the maximum amount of power that may be used when scrubbing gas. If null then the scrubbing is not limited by power.
|
||||
/proc/scrub_gas(var/obj/machinery/M, var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink, var/total_transfer_moles = null, var/available_power = null)
|
||||
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (source.total_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
filtering = filtering & source.gas //only filter gasses that are actually there. DO NOT USE &=
|
||||
@@ -84,14 +84,14 @@
|
||||
var/total_filterable_moles = 0 //the total amount of filterable gas
|
||||
var/list/specific_power_gas = list() //the power required to remove one mole of pure gas, for each gas type
|
||||
for (var/g in filtering)
|
||||
if (source.gas[g] < MINUMUM_MOLES_TO_FILTER)
|
||||
if (source.gas[g] < MINIMUM_MOLES_TO_FILTER)
|
||||
continue
|
||||
|
||||
var/specific_power = calculate_specific_power_gas(g, source, sink)/ATMOS_FILTER_EFFICIENCY
|
||||
specific_power_gas[g] = specific_power
|
||||
total_filterable_moles += source.gas[g]
|
||||
|
||||
if (total_filterable_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (total_filterable_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
//now that we know the total amount of filterable gas, we can calculate the amount of power needed to scrub one mole of gas
|
||||
@@ -110,7 +110,7 @@
|
||||
if (!isnull(available_power) && total_specific_power > 0)
|
||||
total_transfer_moles = min(total_transfer_moles, available_power/total_specific_power)
|
||||
|
||||
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (total_transfer_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
//Update flow rate var
|
||||
@@ -146,7 +146,7 @@
|
||||
//total_transfer_moles - Limits the amount of moles to input. The actual amount of gas filtered may also be limited by available_power, if given.
|
||||
//available_power - the maximum amount of power that may be used when filtering gas. If null then the filtering is not limited by power.
|
||||
/proc/filter_gas(var/obj/machinery/M, var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink_filtered, var/datum/gas_mixture/sink_clean, var/total_transfer_moles = null, var/available_power = null)
|
||||
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (source.total_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
filtering = filtering & source.gas //only filter gasses that are actually there. DO NOT USE &=
|
||||
@@ -156,7 +156,7 @@
|
||||
var/total_unfilterable_moles = 0 //the total amount of non-filterable gas
|
||||
var/list/specific_power_gas = list() //the power required to remove one mole of pure gas, for each gas type
|
||||
for (var/g in source.gas)
|
||||
if (source.gas[g] < MINUMUM_MOLES_TO_FILTER)
|
||||
if (source.gas[g] < MINIMUM_MOLES_TO_FILTER)
|
||||
continue
|
||||
|
||||
if (g in filtering)
|
||||
@@ -179,7 +179,7 @@
|
||||
if (!isnull(available_power) && total_specific_power > 0)
|
||||
total_transfer_moles = min(total_transfer_moles, available_power/total_specific_power)
|
||||
|
||||
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (total_transfer_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
//Update flow rate var
|
||||
@@ -218,7 +218,7 @@
|
||||
//I don't like the copypasta, but I decided to keep both versions of gas filtering as filter_gas is slightly faster (doesn't create as many temporary lists, doesn't call update_values() as much)
|
||||
//filter_gas can be removed and replaced with this proc if need be.
|
||||
/proc/filter_gas_multi(var/obj/machinery/M, var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink_clean, var/total_transfer_moles = null, var/available_power = null)
|
||||
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (source.total_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
filtering = filtering & source.gas //only filter gasses that are actually there. DO NOT USE &=
|
||||
@@ -228,7 +228,7 @@
|
||||
var/total_unfilterable_moles = 0 //the total amount of non-filterable gas
|
||||
var/list/specific_power_gas = list() //the power required to remove one mole of pure gas, for each gas type
|
||||
for (var/g in source.gas)
|
||||
if (source.gas[g] < MINUMUM_MOLES_TO_FILTER)
|
||||
if (source.gas[g] < MINIMUM_MOLES_TO_FILTER)
|
||||
continue
|
||||
|
||||
if (g in filtering)
|
||||
@@ -252,7 +252,7 @@
|
||||
if (!isnull(available_power) && total_specific_power > 0)
|
||||
total_transfer_moles = min(total_transfer_moles, available_power/total_specific_power)
|
||||
|
||||
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (total_transfer_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
//Update Flow Rate var
|
||||
@@ -304,7 +304,7 @@
|
||||
var/total_input_moles = 0 //for flow rate calculation
|
||||
var/list/source_specific_power = list()
|
||||
for (var/datum/gas_mixture/source in mix_sources)
|
||||
if (source.total_moles < MINUMUM_MOLES_TO_FILTER)
|
||||
if (source.total_moles < MINIMUM_MOLES_TO_FILTER)
|
||||
return -1 //either mix at the set ratios or mix no gas at all
|
||||
|
||||
var/mix_ratio = mix_sources[source]
|
||||
@@ -321,7 +321,7 @@
|
||||
total_input_volume += source.volume
|
||||
total_input_moles += source.total_moles
|
||||
|
||||
if (total_mixing_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (total_mixing_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
if (isnull(total_transfer_moles))
|
||||
@@ -333,7 +333,7 @@
|
||||
if (!isnull(available_power) && total_specific_power > 0)
|
||||
total_transfer_moles = min(total_transfer_moles, available_power / total_specific_power)
|
||||
|
||||
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
if (total_transfer_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||
return -1
|
||||
|
||||
//Update flow rate var
|
||||
|
||||
@@ -1,37 +1,50 @@
|
||||
//node1, air1, network1 correspond to input
|
||||
//node2, air2, network2 correspond to output
|
||||
|
||||
#define ADIABATIC_EXPONENT 0.667 //Actually adiabatic exponent - 1.
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator
|
||||
name = "circulator/heat exchanger"
|
||||
desc = "A gas circulator pump and heat exchanger."
|
||||
name = "circulator"
|
||||
desc = "A gas circulator turbine and heat exchanger."
|
||||
icon = 'icons/obj/pipes.dmi'
|
||||
icon_state = "circ-off"
|
||||
anchored = 0
|
||||
|
||||
var/kinetic_efficiency = 0.04 //combined kinetic and kinetic-to-electric efficiency
|
||||
var/volume_ratio = 0.2
|
||||
|
||||
var/recent_moles_transferred = 0
|
||||
var/last_heat_capacity = 0
|
||||
var/last_temperature = 0
|
||||
var/last_pressure_delta = 0
|
||||
var/last_worldtime_transfer = 0
|
||||
var/last_stored_energy_transferred = 0
|
||||
var/volume_capacity_used = 0
|
||||
var/stored_energy = 0
|
||||
|
||||
density = 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/New()
|
||||
..()
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
air1.volume = 400
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
|
||||
var/datum/gas_mixture/removed
|
||||
if(anchored && !(stat&BROKEN) )
|
||||
if(anchored && !(stat&BROKEN) && network1)
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
last_pressure_delta = max(input_starting_pressure - output_starting_pressure + 10, 0)
|
||||
last_pressure_delta = max(input_starting_pressure - output_starting_pressure - 5, 0)
|
||||
|
||||
//only circulate air if there is a pressure difference (plus 10 kPa to represent friction in the machine)
|
||||
if(air1.temperature > 0 && last_pressure_delta > 0)
|
||||
//only circulate air if there is a pressure difference (plus 5kPa kinetic, 10kPa static friction)
|
||||
if(air1.temperature > 0 && last_pressure_delta > 5)
|
||||
|
||||
//Calculate necessary moles to transfer using PV = nRT
|
||||
recent_moles_transferred = last_pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
recent_moles_transferred = (last_pressure_delta*network1.volume/(air1.temperature * R_IDEAL_GAS_EQUATION))/3 //uses the volume of the whole network, not just itself
|
||||
volume_capacity_used = min( (last_pressure_delta*network1.volume/3)/(input_starting_pressure*air1.volume) , 1) //how much of the gas in the input air volume is consumed
|
||||
|
||||
//Calculate energy generated from kinetic turbine
|
||||
stored_energy += 1/ADIABATIC_EXPONENT * min(last_pressure_delta * network1.volume , input_starting_pressure*air1.volume) * (1 - volume_ratio**ADIABATIC_EXPONENT) * kinetic_efficiency
|
||||
|
||||
//Actually transfer the gas
|
||||
removed = air1.remove(recent_moles_transferred)
|
||||
@@ -40,8 +53,7 @@
|
||||
last_temperature = removed.temperature
|
||||
|
||||
//Update the gas networks.
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
network1.update = 1
|
||||
|
||||
last_worldtime_transfer = world.time
|
||||
else
|
||||
@@ -50,6 +62,11 @@
|
||||
update_icon()
|
||||
return removed
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/proc/return_stored_energy()
|
||||
last_stored_energy_transferred = stored_energy
|
||||
stored_energy = 0
|
||||
return last_stored_energy_transferred
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/process()
|
||||
..()
|
||||
|
||||
@@ -72,8 +89,11 @@
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
anchored = !anchored
|
||||
user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor."
|
||||
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
|
||||
"You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \
|
||||
"You hear a ratchet")
|
||||
|
||||
if(anchored)
|
||||
if(dir & (NORTH|SOUTH))
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
var/transfer_moles = (set_flow_rate/input_air.volume)*input_air.total_moles
|
||||
|
||||
var/power_draw = -1
|
||||
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
||||
if (transfer_moles > MINIMUM_MOLES_TO_FILTER)
|
||||
power_draw = filter_gas_multi(src, filtering_outputs, input_air, output_air, transfer_moles, power_rating)
|
||||
|
||||
if (power_draw >= 0)
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
transfer_moles += (set_flow_rate*P.concentration/P.air.volume)*P.air.total_moles
|
||||
|
||||
var/power_draw = -1
|
||||
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
||||
if (transfer_moles > MINIMUM_MOLES_TO_FILTER)
|
||||
power_draw = mix_gas(src, mixing_inputs, output.air, transfer_moles, power_rating)
|
||||
|
||||
if (power_draw >= 0)
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
var/transfer_moles = (set_flow_rate/air1.volume)*air1.total_moles
|
||||
|
||||
var/power_draw = -1
|
||||
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
||||
if (transfer_moles > MINIMUM_MOLES_TO_FILTER)
|
||||
power_draw = filter_gas(src, filtered_out, air1, air2, air3, transfer_moles, power_rating)
|
||||
|
||||
if(network2)
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
var/transfer_moles = (set_flow_rate*mixing_inputs[air1]/air1.volume)*air1.total_moles + (set_flow_rate*mixing_inputs[air1]/air2.volume)*air2.total_moles
|
||||
|
||||
var/power_draw = -1
|
||||
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
||||
if (transfer_moles > MINIMUM_MOLES_TO_FILTER)
|
||||
power_draw = mix_gas(src, mixing_inputs, air3, transfer_moles, power_rating)
|
||||
|
||||
if(network1 && mixing_inputs[air1])
|
||||
|
||||
@@ -7,52 +7,47 @@
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
|
||||
anchored = 1.0
|
||||
|
||||
var/heatsink_temperature = T20C //the constant temperature resevoir into which the freezer pumps heat. Probably the hull of the station or something.
|
||||
var/internal_volume = 600 //L
|
||||
|
||||
anchored = 1
|
||||
use_power = 0
|
||||
idle_power_usage = 5 //5 Watts for thermostat related circuitry
|
||||
idle_power_usage = 5 // 5 Watts for thermostat related circuitry
|
||||
|
||||
var/max_power_rating = 20000 //power rating when the usage is turned up to 100
|
||||
var/heatsink_temperature = T20C // The constant temperature reservoir into which the freezer pumps heat. Probably the hull of the station or something.
|
||||
var/internal_volume = 600 // L
|
||||
|
||||
var/max_power_rating = 20000 // Power rating when the usage is turned up to 100
|
||||
var/power_setting = 100
|
||||
|
||||
var/set_temperature = T20C //thermostat
|
||||
var/set_temperature = T20C // Thermostat
|
||||
var/cooling = 0
|
||||
var/opened = 0 //for deconstruction
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/New()
|
||||
..()
|
||||
air_contents.volume = internal_volume
|
||||
initialize_directions = dir
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/unary_atmos/cooler(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
|
||||
power_rating = max_power_rating * (power_setting/100)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 2)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/initialize()
|
||||
if(node) return
|
||||
if(node)
|
||||
return
|
||||
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, node_connect))
|
||||
if(target.initialize_directions & get_dir(target, src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/update_icon()
|
||||
if(src.node)
|
||||
if(src.use_power && cooling)
|
||||
if(node)
|
||||
if(use_power && cooling)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer"
|
||||
@@ -61,10 +56,10 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/attack_hand(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
// this is the data which will be sent to the ui
|
||||
@@ -78,15 +73,15 @@
|
||||
data["powerSetting"] = power_setting
|
||||
|
||||
var/temp_class = "good"
|
||||
if (air_contents.temperature > (T0C - 20))
|
||||
if(air_contents.temperature > (T0C - 20))
|
||||
temp_class = "bad"
|
||||
else if (air_contents.temperature < (T0C - 20) && air_contents.temperature > (T0C - 100))
|
||||
else if(air_contents.temperature < (T0C - 20) && air_contents.temperature > (T0C - 100))
|
||||
temp_class = "average"
|
||||
data["gasTemperatureClass"] = temp_class
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
if(!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "freezer.tmpl", "Gas Cooling System", 440, 300)
|
||||
@@ -98,30 +93,31 @@
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/Topic(href, href_list)
|
||||
if (href_list["toggleStatus"])
|
||||
src.use_power = !src.use_power
|
||||
if(href_list["toggleStatus"])
|
||||
use_power = !use_power
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.set_temperature = min(src.set_temperature+amount, 1000)
|
||||
set_temperature = min(set_temperature + amount, 1000)
|
||||
else
|
||||
src.set_temperature = max(src.set_temperature+amount, 0)
|
||||
set_temperature = max(set_temperature + amount, 0)
|
||||
if(href_list["setPower"]) //setting power to 0 is redundant anyways
|
||||
var/new_setting = between(0, text2num(href_list["setPower"]), 100)
|
||||
set_power_level(new_setting)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/process()
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) || !use_power)
|
||||
cooling = 0
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if (network && air_contents.temperature > set_temperature)
|
||||
if(network && air_contents.temperature > set_temperature)
|
||||
cooling = 1
|
||||
|
||||
var/heat_transfer = max( -air_contents.get_thermal_energy_change(set_temperature - 5), 0 )
|
||||
@@ -132,7 +128,7 @@
|
||||
heat_transfer = min(heat_transfer, cop * power_rating) //limit heat transfer by available power
|
||||
|
||||
var/removed = -air_contents.add_thermal_energy(-heat_transfer) //remove the heat
|
||||
if (debug)
|
||||
if(debug)
|
||||
visible_message("[src]: Removing [removed] W.")
|
||||
|
||||
use_power(power_rating)
|
||||
@@ -147,49 +143,37 @@
|
||||
/obj/machinery/atmospherics/unary/freezer/RefreshParts()
|
||||
..()
|
||||
var/cap_rating = 0
|
||||
var/cap_count = 0
|
||||
var/manip_rating = 0
|
||||
var/manip_count = 0
|
||||
var/bin_rating = 0
|
||||
var/bin_count = 0
|
||||
|
||||
for(var/obj/item/weapon/stock_parts/P in component_parts)
|
||||
if(istype(P, /obj/item/weapon/stock_parts/capacitor))
|
||||
cap_rating += P.rating
|
||||
cap_count++
|
||||
if(istype(P, /obj/item/weapon/stock_parts/manipulator))
|
||||
manip_rating += P.rating
|
||||
manip_count++
|
||||
if(istype(P, /obj/item/weapon/stock_parts/matter_bin))
|
||||
bin_rating += P.rating
|
||||
bin_count++
|
||||
cap_rating /= cap_count
|
||||
bin_rating /= bin_count
|
||||
manip_rating /= manip_count
|
||||
|
||||
power_rating = initial(power_rating)*cap_rating //more powerful
|
||||
heatsink_temperature = initial(heatsink_temperature)/((manip_rating+bin_rating)/2) //more efficient
|
||||
air_contents.volume = max(initial(internal_volume) - 200, 0) + 200*bin_rating
|
||||
power_rating = initial(power_rating) * cap_rating / 2 //more powerful
|
||||
heatsink_temperature = initial(heatsink_temperature) / ((manip_rating + bin_rating) / 2) //more efficient
|
||||
air_contents.volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating
|
||||
set_power_level(power_setting)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/proc/set_power_level(var/new_power_setting)
|
||||
power_setting = new_power_setting
|
||||
power_rating = max_power_rating * (power_setting/100)
|
||||
|
||||
//dismantling code. copied from autolathe
|
||||
/obj/machinery/atmospherics/unary/freezer/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/screwdriver))
|
||||
opened = !opened
|
||||
user << "You [opened ? "open" : "close"] the maintenance hatch of [src]."
|
||||
if(default_deconstruction_screwdriver(user, O))
|
||||
return
|
||||
|
||||
if (opened && istype(O, /obj/item/weapon/crowbar))
|
||||
dismantle()
|
||||
if(default_deconstruction_crowbar(user, O))
|
||||
return
|
||||
if(default_part_replacement(user, O))
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/examine(mob/user)
|
||||
..(user)
|
||||
if (opened)
|
||||
if(panel_open)
|
||||
user << "The maintenance hatch is open."
|
||||
|
||||
@@ -7,25 +7,21 @@
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "heater_0"
|
||||
density = 1
|
||||
|
||||
anchored = 1.0
|
||||
|
||||
var/set_temperature = T20C //thermostat
|
||||
var/max_temperature = T20C + 680
|
||||
var/internal_volume = 600 //L
|
||||
|
||||
anchored = 1
|
||||
use_power = 0
|
||||
idle_power_usage = 5 //5 Watts for thermostat related circuitry
|
||||
|
||||
var/max_temperature = T20C + 680
|
||||
var/internal_volume = 600 //L
|
||||
|
||||
var/max_power_rating = 20000 //power rating when the usage is turned up to 100
|
||||
var/power_setting = 100
|
||||
|
||||
var/set_temperature = T20C //thermostat
|
||||
var/heating = 0 //mainly for icon updates
|
||||
var/opened = 0 //for deconstruction
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/New()
|
||||
..()
|
||||
air_contents.volume = internal_volume
|
||||
initialize_directions = dir
|
||||
|
||||
component_parts = list()
|
||||
@@ -33,16 +29,18 @@
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 5)
|
||||
|
||||
power_rating = max_power_rating * (power_setting/100)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/initialize()
|
||||
if(node) return
|
||||
if(node)
|
||||
return
|
||||
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, node_connect))
|
||||
if(target.initialize_directions & get_dir(target, src))
|
||||
node = target
|
||||
break
|
||||
|
||||
@@ -50,8 +48,8 @@
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/update_icon()
|
||||
if(src.node)
|
||||
if(src.use_power && src.heating)
|
||||
if(node)
|
||||
if(use_power && heating)
|
||||
icon_state = "heater_1"
|
||||
else
|
||||
icon_state = "heater"
|
||||
@@ -68,7 +66,7 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if (network && air_contents.total_moles && air_contents.temperature < set_temperature)
|
||||
if(network && air_contents.total_moles && air_contents.temperature < set_temperature)
|
||||
air_contents.add_thermal_energy(power_rating * HEATER_PERF_MULT)
|
||||
use_power(power_rating)
|
||||
|
||||
@@ -80,10 +78,10 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/attack_hand(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
// this is the data which will be sent to the ui
|
||||
@@ -97,13 +95,13 @@
|
||||
data["powerSetting"] = power_setting
|
||||
|
||||
var/temp_class = "normal"
|
||||
if (air_contents.temperature > (T20C+40))
|
||||
if(air_contents.temperature > (T20C+40))
|
||||
temp_class = "bad"
|
||||
data["gasTemperatureClass"] = temp_class
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
if(!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "freezer.tmpl", "Gas Heating System", 440, 300)
|
||||
@@ -115,63 +113,54 @@
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/Topic(href, href_list)
|
||||
if (href_list["toggleStatus"])
|
||||
src.use_power = !src.use_power
|
||||
if(href_list["toggleStatus"])
|
||||
use_power = !use_power
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.set_temperature = min(src.set_temperature+amount, max_temperature)
|
||||
set_temperature = min(set_temperature + amount, max_temperature)
|
||||
else
|
||||
src.set_temperature = max(src.set_temperature+amount, 0)
|
||||
set_temperature = max(set_temperature + amount, 0)
|
||||
if(href_list["setPower"]) //setting power to 0 is redundant anyways
|
||||
var/new_setting = between(0, text2num(href_list["setPower"]), 100)
|
||||
set_power_level(new_setting)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
return 1
|
||||
|
||||
//upgrading parts
|
||||
/obj/machinery/atmospherics/unary/heater/RefreshParts()
|
||||
..()
|
||||
|
||||
var/cap_rating = 0
|
||||
var/cap_count = 0
|
||||
var/bin_rating = 0
|
||||
var/bin_count = 0
|
||||
|
||||
for(var/obj/item/weapon/stock_parts/P in component_parts)
|
||||
if(istype(P, /obj/item/weapon/stock_parts/capacitor))
|
||||
cap_rating += P.rating
|
||||
cap_count++
|
||||
if(istype(P, /obj/item/weapon/stock_parts/matter_bin))
|
||||
bin_rating += P.rating
|
||||
bin_count++
|
||||
cap_rating /= cap_count
|
||||
bin_rating /= bin_count
|
||||
|
||||
max_power_rating = initial(max_power_rating)*cap_rating
|
||||
max_temperature = max(initial(max_temperature) - T20C, 0)*((bin_rating*2 + cap_rating)/3) + T20C
|
||||
air_contents.volume = max(initial(internal_volume) - 200, 0) + 200*bin_rating
|
||||
max_power_rating = initial(max_power_rating) * cap_rating / 2
|
||||
max_temperature = max(initial(max_temperature) - T20C, 0) * ((bin_rating * 4 + cap_rating) / 5) + T20C
|
||||
air_contents.volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating
|
||||
set_power_level(power_setting)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/proc/set_power_level(var/new_power_setting)
|
||||
power_setting = new_power_setting
|
||||
power_rating = max_power_rating * (power_setting/100)
|
||||
|
||||
//dismantling code. copied from autolathe
|
||||
/obj/machinery/atmospherics/unary/heater/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/screwdriver))
|
||||
opened = !opened
|
||||
user << "You [opened ? "open" : "close"] the maintenance hatch of [src]."
|
||||
if(default_deconstruction_screwdriver(user, O))
|
||||
return
|
||||
|
||||
if (opened && istype(O, /obj/item/weapon/crowbar))
|
||||
dismantle()
|
||||
if(default_deconstruction_crowbar(user, O))
|
||||
return
|
||||
if(default_part_replacement(user, O))
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/examine(mob/user)
|
||||
..(user)
|
||||
if (opened)
|
||||
if(panel_open)
|
||||
user << "The maintenance hatch is open."
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
var/area_uid
|
||||
var/id_tag = null
|
||||
|
||||
var/hibernate = 0 //Do we even process?
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
|
||||
var/external_pressure_bound = EXTERNAL_PRESSURE_BOUND
|
||||
@@ -88,7 +89,7 @@
|
||||
/obj/machinery/atmospherics/unary/vent_pump/engine
|
||||
name = "Engine Core Vent"
|
||||
power_channel = ENVIRON
|
||||
power_rating = 15000 //15 kW ~ 20 HP
|
||||
power_rating = 30000 //15 kW ~ 20 HP
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/engine/New()
|
||||
..()
|
||||
@@ -150,8 +151,8 @@
|
||||
/obj/machinery/atmospherics/unary/vent_pump/process()
|
||||
..()
|
||||
|
||||
last_power_draw = 0
|
||||
last_flow_rate = 0
|
||||
if (hibernate)
|
||||
return 1
|
||||
|
||||
if (!node)
|
||||
use_power = 0
|
||||
@@ -177,6 +178,17 @@
|
||||
transfer_moles = min(transfer_moles, environment.total_moles*air_contents.volume/environment.volume) //group_multiplier gets divided out here
|
||||
power_draw = pump_gas(src, environment, air_contents, transfer_moles, power_rating)
|
||||
|
||||
else
|
||||
//If we're in an area that is fucking ideal, and we don't have to do anything, chances are we won't next tick either so why redo these calculations?
|
||||
//JESUS FUCK. THERE ARE LITERALLY 250 OF YOU MOTHERFUCKERS ON ZLEVEL ONE AND YOU DO THIS SHIT EVERY TICK WHEN VERY OFTEN THERE IS NO REASON TO
|
||||
|
||||
if(pump_direction && pressure_checks == PRESSURE_CHECK_EXTERNAL && controller_iteration > 10) //99% of all vents
|
||||
//Fucking hibernate because you ain't doing shit.
|
||||
hibernate = 1
|
||||
spawn(rand(100,200)) //hibernate for 10 or 20 seconds randomly
|
||||
hibernate = 0
|
||||
|
||||
|
||||
if (power_draw >= 0)
|
||||
last_power_draw = power_draw
|
||||
use_power(power_draw)
|
||||
@@ -256,6 +268,9 @@
|
||||
/obj/machinery/atmospherics/unary/vent_pump/receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
hibernate = 0
|
||||
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: /obj/machinery/atmospherics/unary/vent_pump/receive_signal([signal.debug_print()])")
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
@@ -368,6 +383,7 @@
|
||||
user << "You are too far away to read the gauge."
|
||||
if(welded)
|
||||
user << "It seems welded shut."
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/power_change()
|
||||
var/old_stat = stat
|
||||
@@ -421,4 +437,4 @@
|
||||
if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated
|
||||
ML.handle_ventcrawl(src)
|
||||
return
|
||||
..()*/
|
||||
..()*/
|
||||
|
||||
@@ -99,6 +99,8 @@
|
||||
"power" = use_power,
|
||||
"scrubbing" = scrubbing,
|
||||
"panic" = panic,
|
||||
"filter_o2" = ("oxygen" in scrubbing_gas),
|
||||
"filter_n2" = ("nitrogen" in scrubbing_gas),
|
||||
"filter_co2" = ("carbon_dioxide" in scrubbing_gas),
|
||||
"filter_phoron" = ("phoron" in scrubbing_gas),
|
||||
"filter_n2o" = ("sleeping_agent" in scrubbing_gas),
|
||||
@@ -171,7 +173,7 @@
|
||||
use_power = !use_power
|
||||
|
||||
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"] != null)
|
||||
panic = text2num(signal.data["panic_siphon"])
|
||||
if(panic)
|
||||
use_power = 1
|
||||
scrubbing = 0
|
||||
@@ -187,11 +189,25 @@
|
||||
|
||||
if(signal.data["scrubbing"] != null)
|
||||
scrubbing = text2num(signal.data["scrubbing"])
|
||||
if(scrubbing)
|
||||
panic = 0
|
||||
if(signal.data["toggle_scrubbing"])
|
||||
scrubbing = !scrubbing
|
||||
if(scrubbing)
|
||||
panic = 0
|
||||
|
||||
var/list/toggle = list()
|
||||
|
||||
if(!isnull(signal.data["o2_scrub"]) && text2num(signal.data["o2_scrub"]) != ("oxygen" in scrubbing_gas))
|
||||
toggle += "oxygen"
|
||||
else if(signal.data["toggle_o2_scrub"])
|
||||
toggle += "oxygen"
|
||||
|
||||
if(!isnull(signal.data["n2_scrub"]) && text2num(signal.data["n2_scrub"]) != ("nitrogen" in scrubbing_gas))
|
||||
toggle += "nitrogen"
|
||||
else if(signal.data["toggle_n2_scrub"])
|
||||
toggle += "nitrogen"
|
||||
|
||||
if(!isnull(signal.data["co2_scrub"]) && text2num(signal.data["co2_scrub"]) != ("carbon_dioxide" in scrubbing_gas))
|
||||
toggle += "carbon_dioxide"
|
||||
else if(signal.data["toggle_co2_scrub"])
|
||||
@@ -261,6 +277,7 @@
|
||||
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||
else
|
||||
user << "You are too far away to read the gauge."
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Del()
|
||||
if(initial_loc)
|
||||
|
||||
@@ -3,18 +3,23 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging
|
||||
icon = 'icons/atmos/heat.dmi'
|
||||
icon_state = "intact"
|
||||
pipe_icon = "hepipe"
|
||||
color = "#404040"
|
||||
level = 2
|
||||
var/initialize_directions_he
|
||||
var/surface = 2 //surface area in m^2
|
||||
var/icon_temperature = T20C //stop small changes in temperature causing an icon refresh
|
||||
|
||||
minimum_temperature_difference = 20
|
||||
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
|
||||
|
||||
buckle_lying = 1
|
||||
|
||||
// BubbleWrap
|
||||
New()
|
||||
..()
|
||||
initialize_directions_he = initialize_directions // The auto-detection from /pipe is good enough for a simple HE pipe
|
||||
// BubbleWrap END
|
||||
color = "#404040" //we don't make use of the fancy overlay system for colours, use this to set the default.
|
||||
|
||||
initialize()
|
||||
normalize_dir()
|
||||
@@ -48,19 +53,53 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging
|
||||
if(!parent)
|
||||
..()
|
||||
else
|
||||
var/environment_temperature = 0
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
if(istype(loc, /turf/simulated/))
|
||||
var/environment_temperature = 0
|
||||
if(loc:blocks_air)
|
||||
environment_temperature = loc:temperature
|
||||
else
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
environment_temperature = environment.temperature
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
|
||||
parent.temperature_interact(loc, volume, thermal_conductivity)
|
||||
else if(istype(loc, /turf/space/))
|
||||
parent.radiate_heat_to_space(surface, 1)
|
||||
|
||||
if(buckled_mob)
|
||||
var/hc = pipe_air.heat_capacity()
|
||||
var/avg_temp = (pipe_air.temperature * hc + buckled_mob.bodytemperature * 3500) / (hc + 3500)
|
||||
pipe_air.temperature = avg_temp
|
||||
buckled_mob.bodytemperature = avg_temp
|
||||
|
||||
var/heat_limit = 1000
|
||||
|
||||
var/mob/living/carbon/human/H = buckled_mob
|
||||
if(istype(H) && H.species)
|
||||
heat_limit = H.species.heat_level_3
|
||||
|
||||
if(pipe_air.temperature > heat_limit + 1)
|
||||
buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest", used_weapon = "Excessive Heat")
|
||||
|
||||
//fancy radiation glowing
|
||||
if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //start glowing at 500K
|
||||
if(abs(pipe_air.temperature - icon_temperature) > 10)
|
||||
icon_temperature = pipe_air.temperature
|
||||
|
||||
var/h_r = heat2color_r(icon_temperature)
|
||||
var/h_g = heat2color_g(icon_temperature)
|
||||
var/h_b = heat2color_b(icon_temperature)
|
||||
|
||||
if(icon_temperature < 2000) //scale up overlay until 2000K
|
||||
var/scale = (icon_temperature - 500) / 1500
|
||||
h_r = 64 + (h_r - 64)*scale
|
||||
h_g = 64 + (h_g - 64)*scale
|
||||
h_b = 64 + (h_b - 64)*scale
|
||||
|
||||
animate(src, color = rgb(h_r, h_g, h_b), time = 20, easing = SINE_EASING)
|
||||
|
||||
|
||||
|
||||
|
||||
obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction
|
||||
icon = 'icons/atmos/junction.dmi'
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
var/alert_pressure = 80*ONE_ATMOSPHERE
|
||||
//minimum pressure before check_pressure(...) should be called
|
||||
|
||||
can_buckle = 1
|
||||
buckle_require_restraints = 1
|
||||
buckle_lying = -1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/drain_power()
|
||||
return -1
|
||||
|
||||
|
||||
+13
-3
@@ -9,6 +9,13 @@
|
||||
src:Topic(href, href_list)
|
||||
return null
|
||||
|
||||
/proc/is_on_same_plane_or_station(var/z1, var/z2)
|
||||
if(z1 == z2)
|
||||
return 1
|
||||
if((z1 in config.station_levels) && (z2 in config.station_levels))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/get_area(O)
|
||||
var/turf/loc = get_turf(O)
|
||||
if(!loc)
|
||||
@@ -43,7 +50,7 @@
|
||||
return level in config.station_levels
|
||||
|
||||
/proc/isNotStationLevel(var/level)
|
||||
return !isStationLevel()
|
||||
return !isStationLevel(level)
|
||||
|
||||
/proc/isPlayerLevel(var/level)
|
||||
return level in config.player_levels
|
||||
@@ -484,5 +491,8 @@ datum/projectile_data
|
||||
temps[direction] = rstats
|
||||
return temps
|
||||
|
||||
/proc/MinutesToTicks(var/minutes as num)
|
||||
return minutes * 60 * 10
|
||||
/proc/MinutesToTicks(var/minutes)
|
||||
return SecondsToTicks(60 * minutes)
|
||||
|
||||
/proc/SecondsToTicks(var/seconds)
|
||||
return seconds * 10
|
||||
|
||||
@@ -42,10 +42,10 @@ var/global/list/facial_hair_styles_male_list = list()
|
||||
var/global/list/facial_hair_styles_female_list = list()
|
||||
var/global/list/skin_styles_female_list = list() //unused
|
||||
//Underwear
|
||||
var/global/list/underwear_m = list("White", "Grey", "Green", "Blue", "Black", "Mankini", "None") //Curse whoever made male/female underwear diffrent colours
|
||||
var/global/list/underwear_f = list("Red", "White", "Yellow", "Blue", "Black", "Thong", "None")
|
||||
var/global/list/underwear_m = list("White" = "m1", "Grey" = "m2", "Green" = "m3", "Blue" = "m4", "Black" = "m5", "Mankini" = "m6", "None") //Curse whoever made male/female underwear diffrent colours
|
||||
var/global/list/underwear_f = list("Red" = "f1", "White" = "f2", "Yellow" = "f3", "Blue" = "f4", "Black" = "f5", "Thong" = "f6", "Black Sports" = "f7","White Sports" = "f8","None")
|
||||
//undershirt
|
||||
var/global/list/undershirt_t = list("Black Tank top", "White Tank top", "Black shirt", "White shirt", "None")
|
||||
var/global/list/undershirt_t = list("Black Tank top" = "u1", "White Tank top" = "u2", "Black shirt" = "u3", "White shirt" = "u4", "None")
|
||||
//Backpacks
|
||||
var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Alt")
|
||||
|
||||
|
||||
@@ -343,6 +343,12 @@ proc/listclearnulls(list/list)
|
||||
return (result + L.Copy(Li, 0))
|
||||
return (result + R.Copy(Ri, 0))
|
||||
|
||||
// Macros to test for bits in a bitfield. Note, that this is for use with indexes, not bit-masks!
|
||||
#define BITTEST(bitfield,index) ((bitfield) & (1 << (index)))
|
||||
#define BITSET(bitfield,index) (bitfield) |= (1 << (index))
|
||||
#define BITRESET(bitfield,index) (bitfield) &= ~(1 << (index))
|
||||
#define BITFLIP(bitfield,index) (bitfield) ^= (1 << (index))
|
||||
|
||||
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
|
||||
/proc/bitfield2list(bitfield = 0, list/wordlist)
|
||||
var/list/r = list()
|
||||
@@ -369,6 +375,12 @@ proc/listclearnulls(list/list)
|
||||
i++
|
||||
return null
|
||||
|
||||
// Returns the key based on the index
|
||||
/proc/get_key_by_value(var/list/L, var/value)
|
||||
for(var/key in L)
|
||||
if(L[key] == value)
|
||||
return key
|
||||
|
||||
/proc/count_by_type(var/list/L, type)
|
||||
var/i = 0
|
||||
for(var/T in L)
|
||||
@@ -584,3 +596,7 @@ datum/proc/dd_SortValue()
|
||||
|
||||
/obj/machinery/camera/dd_SortValue()
|
||||
return "[c_tag]"
|
||||
|
||||
/datum/alarm/dd_SortValue()
|
||||
return "[sanitize(last_name)]"
|
||||
|
||||
|
||||
+118
-106
@@ -1,9 +1,5 @@
|
||||
#define RAND_F(L, H) (rand()*(H-L) + L)
|
||||
|
||||
// Credits to Nickr5 for the useful procs I've taken from his library resource.
|
||||
|
||||
var/const/E = 2.71828183
|
||||
var/const/Sqrt2 = 1.41421356
|
||||
// Macro functions.
|
||||
#define RAND_F(LOW, HIGH) (rand()*(HIGH-LOW) + LOW)
|
||||
|
||||
// List of square roots for the numbers 1-100.
|
||||
var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
|
||||
@@ -11,111 +7,127 @@ var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10)
|
||||
|
||||
/proc/Atan2(x, y)
|
||||
if(!x && !y) return 0
|
||||
var/a = arccos(x / sqrt(x*x + y*y))
|
||||
return y >= 0 ? a : -a
|
||||
|
||||
/proc/Ceiling(x)
|
||||
return -round(-x)
|
||||
|
||||
/proc/Clamp(val, min, max)
|
||||
return max(min, min(val, max))
|
||||
|
||||
// cotangent
|
||||
/proc/Cot(x)
|
||||
return 1 / Tan(x)
|
||||
|
||||
// cosecant
|
||||
/proc/Csc(x)
|
||||
return 1 / sin(x)
|
||||
|
||||
/proc/Default(a, b)
|
||||
return a ? a : b
|
||||
|
||||
/proc/Floor(x)
|
||||
return round(x)
|
||||
|
||||
// Greatest Common Divisor - Euclid's algorithm
|
||||
/proc/Gcd(a, b)
|
||||
return b ? Gcd(b, a % b) : a
|
||||
|
||||
/proc/Inverse(x)
|
||||
return 1 / x
|
||||
|
||||
/proc/IsAboutEqual(a, b, deviation = 0.1)
|
||||
return abs(a - b) <= deviation
|
||||
|
||||
/proc/IsEven(x)
|
||||
return x % 2 == 0
|
||||
|
||||
// Returns true if val is from min to max, inclusive.
|
||||
/proc/IsInRange(val, min, max)
|
||||
return min <= val && val <= max
|
||||
|
||||
/proc/IsInteger(x)
|
||||
return Floor(x) == x
|
||||
|
||||
/proc/IsOdd(x)
|
||||
return !IsEven(x)
|
||||
|
||||
/proc/IsMultiple(x, y)
|
||||
return x % y == 0
|
||||
|
||||
// Least Common Multiple
|
||||
/proc/Lcm(a, b)
|
||||
return abs(a) / Gcd(a, b) * abs(b)
|
||||
|
||||
// Performs a linear interpolation between a and b.
|
||||
// Note that amount=0 returns a, amount=1 returns b, and
|
||||
// amount=0.5 returns the mean of a and b.
|
||||
/proc/Lerp(a, b, amount = 0.5)
|
||||
return a + (b - a) * amount
|
||||
|
||||
/proc/Mean(...)
|
||||
var/values = 0
|
||||
var/sum = 0
|
||||
for(var/val in args)
|
||||
values++
|
||||
sum += val
|
||||
return sum / values
|
||||
|
||||
|
||||
// Returns the nth root of x.
|
||||
/proc/Root(n, x)
|
||||
return x ** (1 / n)
|
||||
|
||||
// secant
|
||||
/proc/Sec(x)
|
||||
return 1 / cos(x)
|
||||
|
||||
// The quadratic formula. Returns a list with the solutions, or an empty list
|
||||
// if they are imaginary.
|
||||
/proc/SolveQuadratic(a, b, c)
|
||||
ASSERT(a)
|
||||
. = list()
|
||||
var/d = b*b - 4 * a * c
|
||||
var/bottom = 2 * a
|
||||
if(d < 0) return
|
||||
var/root = sqrt(d)
|
||||
. += (-b + root) / bottom
|
||||
if(!d) return
|
||||
. += (-b - root) / bottom
|
||||
|
||||
// tangent
|
||||
/proc/Tan(x)
|
||||
return sin(x) / cos(x)
|
||||
|
||||
/proc/ToDegrees(radians)
|
||||
// 180 / Pi
|
||||
return radians * 57.2957795
|
||||
|
||||
/proc/ToRadians(degrees)
|
||||
// Pi / 180
|
||||
return degrees * 0.0174532925
|
||||
|
||||
// min is inclusive, max is exclusive
|
||||
/proc/Wrap(val, min, max)
|
||||
var/d = max - min
|
||||
var/t = Floor((val - min) / d)
|
||||
return val - (t * d)
|
||||
|
||||
/proc/Default(a, b)
|
||||
return a ? a : b
|
||||
|
||||
// Trigonometric functions.
|
||||
/proc/Tan(x)
|
||||
return sin(x) / cos(x)
|
||||
|
||||
/proc/Csc(x)
|
||||
return 1 / sin(x)
|
||||
|
||||
/proc/Sec(x)
|
||||
return 1 / cos(x)
|
||||
|
||||
/proc/Cot(x)
|
||||
return 1 / Tan(x)
|
||||
|
||||
/proc/Atan2(x, y)
|
||||
if(!x && !y) return 0
|
||||
var/a = arccos(x / sqrt(x*x + y*y))
|
||||
return y >= 0 ? a : -a
|
||||
|
||||
/proc/Floor(x)
|
||||
return round(x)
|
||||
|
||||
/proc/Ceiling(x)
|
||||
return -round(-x)
|
||||
|
||||
// Greatest Common Divisor: Euclid's algorithm.
|
||||
/proc/Gcd(a, b)
|
||||
while (1)
|
||||
if (!b) return a
|
||||
a %= b
|
||||
if (!a) return b
|
||||
b %= a
|
||||
|
||||
// Least Common Multiple. The formula is a consequence of: a*b = LCM*GCD.
|
||||
/proc/Lcm(a, b)
|
||||
return abs(a) * abs(b) / Gcd(a, b)
|
||||
|
||||
// Useful in the cases when x is a large expression, e.g. x = 3a/2 + b^2 + Function(c)
|
||||
/proc/Square(x)
|
||||
return x*x
|
||||
|
||||
/proc/Inverse(x)
|
||||
return 1 / x
|
||||
|
||||
// Condition checks.
|
||||
/proc/IsAboutEqual(a, b, delta = 0.1)
|
||||
return abs(a - b) <= delta
|
||||
|
||||
// Returns true if val is from min to max, inclusive.
|
||||
/proc/IsInRange(val, min, max)
|
||||
return (val >= min) && (val <= max)
|
||||
|
||||
/proc/IsInteger(x)
|
||||
return Floor(x) == x
|
||||
|
||||
/proc/IsMultiple(x, y)
|
||||
return x % y == 0
|
||||
|
||||
/proc/IsEven(x)
|
||||
return !(x & 0x1)
|
||||
|
||||
/proc/IsOdd(x)
|
||||
return (x & 0x1)
|
||||
|
||||
// Performs a linear interpolation between a and b.
|
||||
// Note: weight=0 returns a, weight=1 returns b, and weight=0.5 returns the mean of a and b.
|
||||
/proc/Interpolate(a, b, weight = 0.5)
|
||||
return a + (b - a) * weight // Equivalent to: a*(1 - weight) + b*weight
|
||||
|
||||
/proc/Mean(...)
|
||||
var/sum = 0
|
||||
for(var/val in args)
|
||||
sum += val
|
||||
return sum / args.len
|
||||
|
||||
// Returns the nth root of x.
|
||||
/proc/Root(n, x)
|
||||
return x ** (1 / n)
|
||||
|
||||
// The quadratic formula. Returns a list with the solutions, or an empty list
|
||||
// if they are imaginary.
|
||||
/proc/SolveQuadratic(a, b, c)
|
||||
ASSERT(a)
|
||||
|
||||
. = list()
|
||||
var/discriminant = b*b - 4*a*c
|
||||
var/bottom = 2*a
|
||||
|
||||
// Return if the roots are imaginary.
|
||||
if(discriminant < 0)
|
||||
return
|
||||
|
||||
var/root = sqrt(discriminant)
|
||||
. += (-b + root) / bottom
|
||||
|
||||
// If discriminant == 0, there would be two roots at the same position.
|
||||
if(discriminant != 0)
|
||||
. += (-b - root) / bottom
|
||||
|
||||
/proc/ToDegrees(radians)
|
||||
// 180 / Pi ~ 57.2957795
|
||||
return radians * 57.2957795
|
||||
|
||||
/proc/ToRadians(degrees)
|
||||
// Pi / 180 ~ 0.0174532925
|
||||
return degrees * 0.0174532925
|
||||
|
||||
// Vector algebra.
|
||||
/proc/squaredNorm(x, y)
|
||||
return x*x + y*y
|
||||
|
||||
/proc/norm(x, y)
|
||||
return sqrt(squaredNorm(x, y))
|
||||
|
||||
+13
-2
@@ -329,14 +329,25 @@ proc/TextPreview(var/string,var/len=40)
|
||||
//This means that it doesn't just remove < and > and call it a day.
|
||||
//Also limit the size of the input, if specified.
|
||||
/proc/strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
|
||||
if(!input)
|
||||
return
|
||||
var/opentag = 1 //These store the position of < and > respectively.
|
||||
var/closetag = 1
|
||||
while(1)
|
||||
opentag = findtext(input, "<")
|
||||
closetag = findtext(input, ">")
|
||||
if(!closetag || !opentag)
|
||||
if(closetag && opentag)
|
||||
if(closetag < opentag)
|
||||
input = copytext(input, (closetag + 1))
|
||||
else
|
||||
input = copytext(input, 1, opentag) + copytext(input, (closetag + 1))
|
||||
else if(closetag || opentag)
|
||||
if(opentag)
|
||||
input = copytext(input, 1, opentag)
|
||||
else
|
||||
input = copytext(input, (closetag + 1))
|
||||
else
|
||||
break
|
||||
input = copytext(input, 1, opentag) + copytext(input, (closetag + 1))
|
||||
if(max_length)
|
||||
input = copytext(input,1,max_length)
|
||||
return sanitize(input)
|
||||
|
||||
@@ -11,20 +11,6 @@ proc/worldtime2text(time = world.time)
|
||||
proc/time_stamp()
|
||||
return time2text(world.timeofday, "hh:mm:ss")
|
||||
|
||||
/* Preserving this so future generations can see how fucking retarded some people are
|
||||
proc/time_stamp()
|
||||
var/hh = text2num(time2text(world.timeofday, "hh")) // Set the hour
|
||||
var/mm = text2num(time2text(world.timeofday, "mm")) // Set the minute
|
||||
var/ss = text2num(time2text(world.timeofday, "ss")) // Set the second
|
||||
var/ph
|
||||
var/pm
|
||||
var/ps
|
||||
if(hh < 10) ph = "0"
|
||||
if(mm < 10) pm = "0"
|
||||
if(ss < 10) ps = "0"
|
||||
return"[ph][hh]:[pm][mm]:[ps][ss]"
|
||||
*/
|
||||
|
||||
/* Returns 1 if it is the selected month and day */
|
||||
proc/isDay(var/month, var/day)
|
||||
if(isnum(month) && isnum(day))
|
||||
|
||||
+224
-238
@@ -9,333 +9,319 @@
|
||||
* worldtime2text
|
||||
*/
|
||||
|
||||
//Returns an integer given a hex input
|
||||
// Returns an integer given a hexadecimal number string as input.
|
||||
/proc/hex2num(hex)
|
||||
if (!( istext(hex) ))
|
||||
if (!istext(hex))
|
||||
return
|
||||
|
||||
var/num = 0
|
||||
var/power = 0
|
||||
var/i = null
|
||||
i = length(hex)
|
||||
while(i > 0)
|
||||
var/char = copytext(hex, i, i + 1)
|
||||
var/num = 0
|
||||
var/power = 1
|
||||
var/i = length(hex)
|
||||
|
||||
while (i)
|
||||
var/char = text2ascii(hex, i)
|
||||
switch(char)
|
||||
if("0")
|
||||
//Apparently, switch works with empty statements, yay! If that doesn't work, blame me, though. -- Urist
|
||||
if("9", "8", "7", "6", "5", "4", "3", "2", "1")
|
||||
num += text2num(char) * 16 ** power
|
||||
if("a", "A")
|
||||
num += 16 ** power * 10
|
||||
if("b", "B")
|
||||
num += 16 ** power * 11
|
||||
if("c", "C")
|
||||
num += 16 ** power * 12
|
||||
if("d", "D")
|
||||
num += 16 ** power * 13
|
||||
if("e", "E")
|
||||
num += 16 ** power * 14
|
||||
if("f", "F")
|
||||
num += 16 ** power * 15
|
||||
if(48) // 0 -- do nothing
|
||||
if(49 to 57) num += (char - 48) * power // 1-9
|
||||
if(97, 65) num += power * 10 // A
|
||||
if(98, 66) num += power * 11 // B
|
||||
if(99, 67) num += power * 12 // C
|
||||
if(100, 68) num += power * 13 // D
|
||||
if(101, 69) num += power * 14 // E
|
||||
if(102, 70) num += power * 15 // F
|
||||
else
|
||||
return
|
||||
power++
|
||||
power *= 16
|
||||
i--
|
||||
return num
|
||||
|
||||
//Returns the hex value of a number given a value assumed to be a base-ten value
|
||||
/proc/num2hex(num, placeholder)
|
||||
// Returns the hex value of a number given a value assumed to be a base-ten value
|
||||
/proc/num2hex(num, digits)
|
||||
if (digits == null)
|
||||
digits = 2
|
||||
|
||||
if (placeholder == null)
|
||||
placeholder = 2
|
||||
if (!( isnum(num) ))
|
||||
if (!isnum(num))
|
||||
return
|
||||
if (num == 0)
|
||||
var/final = ""
|
||||
for(var/i=1 to placeholder) final = "[final]0"
|
||||
return final
|
||||
var/hex = ""
|
||||
var/i = 0
|
||||
while(16 ** i < num)
|
||||
i++
|
||||
var/power = null
|
||||
power = i - 1
|
||||
while(power >= 0)
|
||||
var/val = round(num / 16 ** power)
|
||||
num -= val * 16 ** power
|
||||
switch(val)
|
||||
if(9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0)
|
||||
hex += text("[]", val)
|
||||
if(10.0)
|
||||
hex += "A"
|
||||
if(11.0)
|
||||
hex += "B"
|
||||
if(12.0)
|
||||
hex += "C"
|
||||
if(13.0)
|
||||
hex += "D"
|
||||
if(14.0)
|
||||
hex += "E"
|
||||
if(15.0)
|
||||
hex += "F"
|
||||
else
|
||||
power--
|
||||
while(length(hex) < placeholder)
|
||||
hex = text("0[]", hex)
|
||||
return hex
|
||||
|
||||
// hex is our return value, to which each hex-digit of num is appended to.
|
||||
var/hex = ""
|
||||
var/power = -4
|
||||
var/n = 1
|
||||
|
||||
// Figure out power. (power of 2)
|
||||
while (n < num)
|
||||
power += 4
|
||||
n *= 16
|
||||
|
||||
// Note that we have to start appending to hex with the most-significant digits.
|
||||
while (power >= 0)
|
||||
var/m = (num >> power) & 15
|
||||
hex += ascii2text(m + (m < 10 ? 48 : 87)) // Provided by the IconProcs library.
|
||||
power -= 4
|
||||
|
||||
// Append zeroes to make sure that hex is atleast digits long.
|
||||
var/left = length(hex) - digits
|
||||
while (left-- > 0)
|
||||
hex = text("0[]", hex)
|
||||
|
||||
return hex
|
||||
|
||||
// Concatenates a list of strings into a single string. A seperator may optionally be provided.
|
||||
/proc/list2text(list/ls, sep)
|
||||
if(ls.len <= 1) // Early-out code for empty or singleton lists.
|
||||
if (ls.len <= 1) // Early-out code for empty or singleton lists.
|
||||
return ls.len ? ls[1] : ""
|
||||
|
||||
|
||||
var/l = ls.len // Made local for sanic speed.
|
||||
var/i = 0 // Incremented every time a list index is accessed.
|
||||
|
||||
if(sep <> null)
|
||||
var/i = 0 // Incremented every time a list index is accessed.
|
||||
|
||||
if (sep <> null)
|
||||
// Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc...
|
||||
#define S1 sep, ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
#define S1 sep, ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
|
||||
// Having the small concatenations come before the large ones boosted speed by an average of at least 5%.
|
||||
if(l-1 & 0x01) // 'i' will always be 1 here.
|
||||
if (l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if(l-i & 0x02)
|
||||
if (l-i & 0x02)
|
||||
. = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if(l-i & 0x04)
|
||||
if (l-i & 0x04)
|
||||
. = text("[][][][][][][][][]", ., S4) // And so on....
|
||||
if(l-i & 0x08)
|
||||
if (l-i & 0x08)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S4, S4)
|
||||
if(l-i & 0x10)
|
||||
if (l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if(l-i & 0x20)
|
||||
if (l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if(l-i & 0x40)
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if (l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while(l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while (l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
else
|
||||
// Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc...
|
||||
#define S1 ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
#define S1 ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
if(l-1 & 0x01) // 'i' will always be 1 here.
|
||||
|
||||
if (l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. += S1 // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if(l-i & 0x02)
|
||||
if (l-i & 0x02)
|
||||
. = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if(l-i & 0x04)
|
||||
if (l-i & 0x04)
|
||||
. = text("[][][][][]", ., S4) // And so on...
|
||||
if(l-i & 0x08)
|
||||
if (l-i & 0x08)
|
||||
. = text("[][][][][][][][][]", ., S4, S4)
|
||||
if(l-i & 0x10)
|
||||
if (l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if(l-i & 0x20)
|
||||
if (l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if(l-i & 0x40)
|
||||
if (l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while(l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while (l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
|
||||
//slower then list2text, but correctly processes associative lists.
|
||||
// Slower then list2text, but correctly processes associative lists.
|
||||
proc/tg_list2text(list/list, glue=",")
|
||||
if(!istype(list) || !list.len)
|
||||
if (!istype(list) || !list.len)
|
||||
return
|
||||
var/output
|
||||
for(var/i=1 to list.len)
|
||||
output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]")
|
||||
return output
|
||||
|
||||
|
||||
//Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator)
|
||||
// Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator)
|
||||
/proc/text2list(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if(delim_len < 1) return list(text)
|
||||
if (delim_len < 1)
|
||||
return list(text)
|
||||
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
do
|
||||
found = findtext(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while(found)
|
||||
|
||||
do
|
||||
found = findtext(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while (found)
|
||||
|
||||
// Case sensitive version of /proc/text2list().
|
||||
/proc/text2listEx(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if (delim_len < 1)
|
||||
return list(text)
|
||||
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
|
||||
do
|
||||
found = findtextEx(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while (found)
|
||||
|
||||
/proc/text2numlist(text, delimiter="\n")
|
||||
var/list/num_list = list()
|
||||
for(var/x in text2list(text, delimiter))
|
||||
num_list += text2num(x)
|
||||
return num_list
|
||||
|
||||
//Case Sensitive!
|
||||
/proc/text2listEx(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if(delim_len < 1) return list(text)
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
do
|
||||
found = findtextEx(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while(found)
|
||||
|
||||
//Splits the text of a file at seperator and returns them in a list.
|
||||
// Splits the text of a file at seperator and returns them in a list.
|
||||
/proc/file2list(filename, seperator="\n")
|
||||
return text2list(return_file_text(filename),seperator)
|
||||
|
||||
|
||||
//Turns a direction into text
|
||||
|
||||
// Turns a direction into text
|
||||
/proc/num2dir(direction)
|
||||
switch(direction)
|
||||
if(1.0) return NORTH
|
||||
if(2.0) return SOUTH
|
||||
if(4.0) return EAST
|
||||
if(8.0) return WEST
|
||||
switch (direction)
|
||||
if (1.0) return NORTH
|
||||
if (2.0) return SOUTH
|
||||
if (4.0) return EAST
|
||||
if (8.0) return WEST
|
||||
else
|
||||
world.log << "UNKNOWN DIRECTION: [direction]"
|
||||
|
||||
|
||||
|
||||
//Turns a direction into text
|
||||
// Turns a direction into text
|
||||
/proc/dir2text(direction)
|
||||
switch(direction)
|
||||
if(1.0)
|
||||
return "north"
|
||||
if(2.0)
|
||||
return "south"
|
||||
if(4.0)
|
||||
return "east"
|
||||
if(8.0)
|
||||
return "west"
|
||||
if(5.0)
|
||||
return "northeast"
|
||||
if(6.0)
|
||||
return "southeast"
|
||||
if(9.0)
|
||||
return "northwest"
|
||||
if(10.0)
|
||||
return "southwest"
|
||||
else
|
||||
return
|
||||
switch (direction)
|
||||
if (1.0) return "north"
|
||||
if (2.0) return "south"
|
||||
if (4.0) return "east"
|
||||
if (8.0) return "west"
|
||||
if (5.0) return "northeast"
|
||||
if (6.0) return "southeast"
|
||||
if (9.0) return "northwest"
|
||||
if (10.0) return "southwest"
|
||||
|
||||
//Turns text into proper directions
|
||||
// Turns text into proper directions
|
||||
/proc/text2dir(direction)
|
||||
switch(uppertext(direction))
|
||||
if("NORTH")
|
||||
return 1
|
||||
if("SOUTH")
|
||||
return 2
|
||||
if("EAST")
|
||||
return 4
|
||||
if("WEST")
|
||||
return 8
|
||||
if("NORTHEAST")
|
||||
return 5
|
||||
if("NORTHWEST")
|
||||
return 9
|
||||
if("SOUTHEAST")
|
||||
return 6
|
||||
if("SOUTHWEST")
|
||||
return 10
|
||||
else
|
||||
return
|
||||
switch (uppertext(direction))
|
||||
if ("NORTH") return 1
|
||||
if ("SOUTH") return 2
|
||||
if ("EAST") return 4
|
||||
if ("WEST") return 8
|
||||
if ("NORTHEAST") return 5
|
||||
if ("NORTHWEST") return 9
|
||||
if ("SOUTHEAST") return 6
|
||||
if ("SOUTHWEST") return 10
|
||||
|
||||
//Converts an angle (degrees) into an ss13 direction
|
||||
// Converts an angle (degrees) into an ss13 direction
|
||||
/proc/angle2dir(var/degree)
|
||||
degree = ((degree+22.5)%365)
|
||||
if(degree < 45) return NORTH
|
||||
if(degree < 90) return NORTHEAST
|
||||
if(degree < 135) return EAST
|
||||
if(degree < 180) return SOUTHEAST
|
||||
if(degree < 225) return SOUTH
|
||||
if(degree < 270) return SOUTHWEST
|
||||
if(degree < 315) return WEST
|
||||
degree = (degree + 22.5) % 365 // 22.5 = 45 / 2
|
||||
if (degree < 45) return NORTH
|
||||
if (degree < 90) return NORTHEAST
|
||||
if (degree < 135) return EAST
|
||||
if (degree < 180) return SOUTHEAST
|
||||
if (degree < 225) return SOUTH
|
||||
if (degree < 270) return SOUTHWEST
|
||||
if (degree < 315) return WEST
|
||||
return NORTH|WEST
|
||||
|
||||
//returns the north-zero clockwise angle in degrees, given a direction
|
||||
|
||||
// Returns the north-zero clockwise angle in degrees, given a direction
|
||||
/proc/dir2angle(var/D)
|
||||
switch(D)
|
||||
if(NORTH) return 0
|
||||
if(SOUTH) return 180
|
||||
if(EAST) return 90
|
||||
if(WEST) return 270
|
||||
if(NORTHEAST) return 45
|
||||
if(SOUTHEAST) return 135
|
||||
if(NORTHWEST) return 315
|
||||
if(SOUTHWEST) return 225
|
||||
else return null
|
||||
switch (D)
|
||||
if (NORTH) return 0
|
||||
if (SOUTH) return 180
|
||||
if (EAST) return 90
|
||||
if (WEST) return 270
|
||||
if (NORTHEAST) return 45
|
||||
if (SOUTHEAST) return 135
|
||||
if (NORTHWEST) return 315
|
||||
if (SOUTHWEST) return 225
|
||||
|
||||
//Returns the angle in english
|
||||
// Returns the angle in english
|
||||
/proc/angle2text(var/degree)
|
||||
return dir2text(angle2dir(degree))
|
||||
|
||||
//Converts a blend_mode constant to one acceptable to icon.Blend()
|
||||
// Converts a blend_mode constant to one acceptable to icon.Blend()
|
||||
/proc/blendMode2iconMode(blend_mode)
|
||||
switch(blend_mode)
|
||||
if(BLEND_MULTIPLY) return ICON_MULTIPLY
|
||||
if(BLEND_ADD) return ICON_ADD
|
||||
if(BLEND_SUBTRACT) return ICON_SUBTRACT
|
||||
else return ICON_OVERLAY
|
||||
switch (blend_mode)
|
||||
if (BLEND_MULTIPLY) return ICON_MULTIPLY
|
||||
if (BLEND_ADD) return ICON_ADD
|
||||
if (BLEND_SUBTRACT) return ICON_SUBTRACT
|
||||
else return ICON_OVERLAY
|
||||
|
||||
//Converts a rights bitfield into a string
|
||||
// Converts a rights bitfield into a string
|
||||
/proc/rights2text(rights,seperator="")
|
||||
if(rights & R_BUILDMODE) . += "[seperator]+BUILDMODE"
|
||||
if(rights & R_ADMIN) . += "[seperator]+ADMIN"
|
||||
if(rights & R_BAN) . += "[seperator]+BAN"
|
||||
if(rights & R_FUN) . += "[seperator]+FUN"
|
||||
if(rights & R_SERVER) . += "[seperator]+SERVER"
|
||||
if(rights & R_DEBUG) . += "[seperator]+DEBUG"
|
||||
if(rights & R_POSSESS) . += "[seperator]+POSSESS"
|
||||
if(rights & R_PERMISSIONS) . += "[seperator]+PERMISSIONS"
|
||||
if(rights & R_STEALTH) . += "[seperator]+STEALTH"
|
||||
if(rights & R_REJUVINATE) . += "[seperator]+REJUVINATE"
|
||||
if(rights & R_VAREDIT) . += "[seperator]+VAREDIT"
|
||||
if(rights & R_SOUNDS) . += "[seperator]+SOUND"
|
||||
if(rights & R_SPAWN) . += "[seperator]+SPAWN"
|
||||
if(rights & R_MOD) . += "[seperator]+MODERATOR"
|
||||
if(rights & R_MENTOR) . += "[seperator]+MENTOR"
|
||||
if (rights & R_BUILDMODE) . += "[seperator]+BUILDMODE"
|
||||
if (rights & R_ADMIN) . += "[seperator]+ADMIN"
|
||||
if (rights & R_BAN) . += "[seperator]+BAN"
|
||||
if (rights & R_FUN) . += "[seperator]+FUN"
|
||||
if (rights & R_SERVER) . += "[seperator]+SERVER"
|
||||
if (rights & R_DEBUG) . += "[seperator]+DEBUG"
|
||||
if (rights & R_POSSESS) . += "[seperator]+POSSESS"
|
||||
if (rights & R_PERMISSIONS) . += "[seperator]+PERMISSIONS"
|
||||
if (rights & R_STEALTH) . += "[seperator]+STEALTH"
|
||||
if (rights & R_REJUVINATE) . += "[seperator]+REJUVINATE"
|
||||
if (rights & R_VAREDIT) . += "[seperator]+VAREDIT"
|
||||
if (rights & R_SOUNDS) . += "[seperator]+SOUND"
|
||||
if (rights & R_SPAWN) . += "[seperator]+SPAWN"
|
||||
if (rights & R_MOD) . += "[seperator]+MODERATOR"
|
||||
if (rights & R_MENTOR) . += "[seperator]+MENTOR"
|
||||
return .
|
||||
|
||||
/proc/ui_style2icon(ui_style)
|
||||
switch(ui_style)
|
||||
if("old") return 'icons/mob/screen1_old.dmi'
|
||||
if("Orange") return 'icons/mob/screen1_Orange.dmi'
|
||||
if("Midnight") return 'icons/mob/screen1_Midnight.dmi'
|
||||
else return 'icons/mob/screen1_White.dmi'
|
||||
switch (ui_style)
|
||||
if ("old") return 'icons/mob/screen1_old.dmi'
|
||||
if ("Orange") return 'icons/mob/screen1_Orange.dmi'
|
||||
if ("Midnight") return 'icons/mob/screen1_Midnight.dmi'
|
||||
else return 'icons/mob/screen1_White.dmi'
|
||||
|
||||
// heat2color functions. Adapted from: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
|
||||
/proc/heat2color(temp)
|
||||
return rgb(heat2color_r(temp), heat2color_g(temp), heat2color_b(temp))
|
||||
|
||||
/proc/heat2color_r(temp)
|
||||
temp /= 100
|
||||
if(temp <= 66)
|
||||
. = 255
|
||||
else
|
||||
. = max(0, min(255, 329.698727446 * (temp - 60) ** -0.1332047592))
|
||||
|
||||
/proc/heat2color_g(temp)
|
||||
temp /= 100
|
||||
if(temp <= 66)
|
||||
. = max(0, min(255, 99.4708025861 * log(temp) - 161.1195681661))
|
||||
else
|
||||
. = max(0, min(255, 288.1221695283 * ((temp - 60) ** -0.0755148492)))
|
||||
|
||||
/proc/heat2color_b(temp)
|
||||
temp /= 100
|
||||
if(temp >= 66)
|
||||
. = 255
|
||||
else
|
||||
if(temp <= 16)
|
||||
. = 0
|
||||
else
|
||||
. = max(0, min(255, 138.5177312231 * log(temp - 10) - 305.0447927307))
|
||||
|
||||
@@ -1249,7 +1249,7 @@ proc/is_hot(obj/item/W as obj)
|
||||
return 1000
|
||||
else
|
||||
return 0
|
||||
if(/obj/item/clothing/mask/cigarette)
|
||||
if(/obj/item/clothing/mask/smokable/cigarette)
|
||||
if(W:lit)
|
||||
return 1000
|
||||
else
|
||||
@@ -1287,7 +1287,7 @@ proc/is_hot(obj/item/W as obj)
|
||||
istype(W, /obj/item/weapon/weldingtool) || \
|
||||
istype(W, /obj/item/weapon/flame/lighter/zippo) || \
|
||||
istype(W, /obj/item/weapon/flame/match) || \
|
||||
istype(W, /obj/item/clothing/mask/cigarette) || \
|
||||
istype(W, /obj/item/clothing/mask/smokable/cigarette) || \
|
||||
istype(W, /obj/item/weapon/shovel) \
|
||||
)
|
||||
|
||||
@@ -1305,7 +1305,7 @@ proc/is_hot(obj/item/W as obj)
|
||||
/proc/can_operate(mob/living/carbon/M)
|
||||
return (M.lying && \
|
||||
locate(/obj/machinery/optable, M.loc) || \
|
||||
(locate(/obj/structure/stool/bed/roller, M.loc) && prob(75)) || \
|
||||
(locate(/obj/structure/bed/roller, M.loc) && prob(75)) || \
|
||||
(locate(/obj/structure/table/, M.loc) && prob(66)))
|
||||
|
||||
/proc/reverse_direction(var/dir)
|
||||
@@ -1378,3 +1378,15 @@ var/list/WALLITEMS = list(
|
||||
if(istype(arglist,/list))
|
||||
arglist = list2params(arglist)
|
||||
return "<a href='?src=\ref[D];[arglist]'>[content]</a>"
|
||||
|
||||
/proc/get_random_colour(var/simple, var/lower, var/upper)
|
||||
var/colour
|
||||
if(simple)
|
||||
colour = pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))
|
||||
else
|
||||
for(var/i=1;i<=3;i++)
|
||||
var/temp_col = "[num2hex(rand(lower,upper))]"
|
||||
if(length(temp_col )<2)
|
||||
temp_col = "0[temp_col]"
|
||||
colour += temp_col
|
||||
return colour
|
||||
|
||||
+97
-55
@@ -241,6 +241,8 @@ datum/hud/New(mob/owner)
|
||||
brain_hud(ui_style)
|
||||
else if(isalien(mymob))
|
||||
larva_hud()
|
||||
else if(isslime(mymob))
|
||||
slime_hud()
|
||||
else if(isAI(mymob))
|
||||
ai_hud()
|
||||
else if(isrobot(mymob))
|
||||
@@ -254,59 +256,99 @@ datum/hud/New(mob/owner)
|
||||
set name = "F12"
|
||||
set hidden = 1
|
||||
|
||||
if(hud_used)
|
||||
if(ishuman(src))
|
||||
if(!client) return
|
||||
if(client.view != world.view)
|
||||
return
|
||||
if(hud_used.hud_shown)
|
||||
hud_used.hud_shown = 0
|
||||
if(src.hud_used.adding)
|
||||
src.client.screen -= src.hud_used.adding
|
||||
if(src.hud_used.other)
|
||||
src.client.screen -= src.hud_used.other
|
||||
if(src.hud_used.hotkeybuttons)
|
||||
src.client.screen -= src.hud_used.hotkeybuttons
|
||||
if(src.hud_used.item_action_list)
|
||||
src.client.screen -= src.hud_used.item_action_list
|
||||
|
||||
//Due to some poor coding some things need special treatment:
|
||||
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
|
||||
if(!full)
|
||||
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
|
||||
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
else
|
||||
src.client.screen -= src.healths
|
||||
src.client.screen -= src.internals
|
||||
src.client.screen -= src.gun_setting_icon
|
||||
|
||||
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
|
||||
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
|
||||
|
||||
else
|
||||
hud_used.hud_shown = 1
|
||||
if(src.hud_used.adding)
|
||||
src.client.screen += src.hud_used.adding
|
||||
if(src.hud_used.other && src.hud_used.inventory_shown)
|
||||
src.client.screen += src.hud_used.other
|
||||
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
|
||||
src.client.screen += src.hud_used.hotkeybuttons
|
||||
if(src.healths)
|
||||
src.client.screen |= src.healths
|
||||
if(src.internals)
|
||||
src.client.screen |= src.internals
|
||||
if(src.gun_setting_icon)
|
||||
src.client.screen |= src.gun_setting_icon
|
||||
|
||||
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
|
||||
src.client.screen += src.zone_sel //This one is a special snowflake
|
||||
|
||||
hud_used.hidden_inventory_update()
|
||||
hud_used.persistant_inventory_update()
|
||||
update_action_buttons()
|
||||
else
|
||||
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
|
||||
else
|
||||
if(!hud_used)
|
||||
usr << "\red This mob type does not use a HUD."
|
||||
return
|
||||
|
||||
if(!ishuman(src))
|
||||
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
|
||||
return
|
||||
|
||||
if(!client) return
|
||||
if(client.view != world.view)
|
||||
return
|
||||
if(hud_used.hud_shown)
|
||||
hud_used.hud_shown = 0
|
||||
if(src.hud_used.adding)
|
||||
src.client.screen -= src.hud_used.adding
|
||||
if(src.hud_used.other)
|
||||
src.client.screen -= src.hud_used.other
|
||||
if(src.hud_used.hotkeybuttons)
|
||||
src.client.screen -= src.hud_used.hotkeybuttons
|
||||
if(src.hud_used.item_action_list)
|
||||
src.client.screen -= src.hud_used.item_action_list
|
||||
|
||||
//Due to some poor coding some things need special treatment:
|
||||
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
|
||||
if(!full)
|
||||
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
|
||||
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
else
|
||||
src.client.screen -= src.healths
|
||||
src.client.screen -= src.internals
|
||||
src.client.screen -= src.gun_setting_icon
|
||||
|
||||
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
|
||||
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
|
||||
|
||||
else
|
||||
hud_used.hud_shown = 1
|
||||
if(src.hud_used.adding)
|
||||
src.client.screen += src.hud_used.adding
|
||||
if(src.hud_used.other && src.hud_used.inventory_shown)
|
||||
src.client.screen += src.hud_used.other
|
||||
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
|
||||
src.client.screen += src.hud_used.hotkeybuttons
|
||||
if(src.healths)
|
||||
src.client.screen |= src.healths
|
||||
if(src.internals)
|
||||
src.client.screen |= src.internals
|
||||
if(src.gun_setting_icon)
|
||||
src.client.screen |= src.gun_setting_icon
|
||||
|
||||
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
|
||||
src.client.screen += src.zone_sel //This one is a special snowflake
|
||||
|
||||
hud_used.hidden_inventory_update()
|
||||
hud_used.persistant_inventory_update()
|
||||
update_action_buttons()
|
||||
|
||||
//Similar to button_pressed_F12() but keeps zone_sel, gun_setting_icon, and healths.
|
||||
/mob/proc/toggle_zoom_hud()
|
||||
if(!hud_used)
|
||||
return
|
||||
if(!ishuman(src))
|
||||
return
|
||||
if(!client)
|
||||
return
|
||||
if(client.view != world.view)
|
||||
return
|
||||
|
||||
if(hud_used.hud_shown)
|
||||
hud_used.hud_shown = 0
|
||||
if(src.hud_used.adding)
|
||||
src.client.screen -= src.hud_used.adding
|
||||
if(src.hud_used.other)
|
||||
src.client.screen -= src.hud_used.other
|
||||
if(src.hud_used.hotkeybuttons)
|
||||
src.client.screen -= src.hud_used.hotkeybuttons
|
||||
if(src.hud_used.item_action_list)
|
||||
src.client.screen -= src.hud_used.item_action_list
|
||||
src.client.screen -= src.internals
|
||||
else
|
||||
hud_used.hud_shown = 1
|
||||
if(src.hud_used.adding)
|
||||
src.client.screen += src.hud_used.adding
|
||||
if(src.hud_used.other && src.hud_used.inventory_shown)
|
||||
src.client.screen += src.hud_used.other
|
||||
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
|
||||
src.client.screen += src.hud_used.hotkeybuttons
|
||||
if(src.internals)
|
||||
src.client.screen |= src.internals
|
||||
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
|
||||
|
||||
hud_used.hidden_inventory_update()
|
||||
hud_used.persistant_inventory_update()
|
||||
update_action_buttons()
|
||||
@@ -433,9 +433,6 @@
|
||||
f_style = "Shaved"
|
||||
if(dna.species == "Human") //no more xenos losing ears/tentacles
|
||||
h_style = pick("Bedhead", "Bedhead 2", "Bedhead 3")
|
||||
undershirt = undershirt_t.Find("None")
|
||||
if(gender == MALE)
|
||||
underwear = underwear_m.Find("None")
|
||||
else
|
||||
underwear = underwear_f.Find("None")
|
||||
undershirt = null
|
||||
underwear = null
|
||||
regenerate_icons()
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||
mymob.gun_setting_icon.set_dir(2)
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
if (G.aim_targets)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.set_dir(1)
|
||||
|
||||
@@ -33,3 +33,71 @@
|
||||
mymob.client.screen = null
|
||||
|
||||
mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay)
|
||||
|
||||
/datum/hud/proc/slime_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
|
||||
|
||||
src.adding = list()
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new /obj/screen()
|
||||
using.name = "act_intent"
|
||||
using.set_dir(SOUTHWEST)
|
||||
using.icon = ui_style
|
||||
using.icon_state = "intent_"+mymob.a_intent
|
||||
using.screen_loc = ui_zonesel
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
action_intent = using
|
||||
|
||||
//intent small hud objects
|
||||
var/icon/ico
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "help"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_zonesel
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
help_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "disarm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_zonesel
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
disarm_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "grab"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_zonesel
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
grab_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "harm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_zonesel
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
hurt_intent = using
|
||||
|
||||
mymob.client.screen = null
|
||||
mymob.client.screen += src.adding
|
||||
|
||||
return
|
||||
@@ -157,7 +157,7 @@ var/obj/screen/robot_inventory
|
||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||
mymob.gun_setting_icon.set_dir(2)
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
if (G.aim_targets)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.set_dir(1)
|
||||
|
||||
+46
-30
@@ -120,45 +120,61 @@
|
||||
|
||||
// Eating
|
||||
if(Victim)
|
||||
if (Victim == A)
|
||||
Feedstop()
|
||||
return
|
||||
|
||||
// Basic attack.
|
||||
A.attack_generic(src, (is_adult ? rand(20,40) : rand(5,25)), "glomped")
|
||||
|
||||
// Handle mob shocks.
|
||||
var/mob/living/M = A
|
||||
if(istype(M) && powerlevel > 0 && !istype(A,/mob/living/carbon/slime))
|
||||
if (istype(M))
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.flags & IS_SYNTHETIC || (H.species.siemens_coefficient<0.5))
|
||||
return
|
||||
switch(src.a_intent)
|
||||
if ("help") // We just poke the other
|
||||
M.visible_message("<span class='notice'>[src] gently pokes [M]!</span>", "<span class='notice'>[src] gently pokes you!</span>")
|
||||
if ("disarm") // We stun the target, with the intention to feed
|
||||
var/stunprob = 1
|
||||
var/power = max(0, min(10, (powerlevel + rand(0, 3))))
|
||||
if (powerlevel > 0 && !istype(A, /mob/living/carbon/slime))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.flags & IS_SYNTHETIC)
|
||||
return
|
||||
stunprob *= H.species.siemens_coefficient
|
||||
|
||||
var/power = max(0,min(10,(powerlevel+rand(0,3))))
|
||||
|
||||
var/stunprob = 10
|
||||
switch(power*10)
|
||||
if(1 to 2) stunprob = 20
|
||||
if(3 to 4) stunprob = 30
|
||||
if(5 to 6) stunprob = 40
|
||||
if(7 to 8) stunprob = 60
|
||||
if(9) stunprob = 70
|
||||
if(10) stunprob = 95
|
||||
switch(power * 10)
|
||||
if(0) stunprob *= 10
|
||||
if(1 to 2) stunprob *= 20
|
||||
if(3 to 4) stunprob *= 30
|
||||
if(5 to 6) stunprob *= 40
|
||||
if(7 to 8) stunprob *= 60
|
||||
if(9) stunprob *= 70
|
||||
if(10) stunprob *= 95
|
||||
|
||||
if(prob(stunprob))
|
||||
powerlevel = max(0,powerlevel-3)
|
||||
src.visible_message("\red <B>The [name] has shocked [M]!</B>")
|
||||
M.Weaken(power)
|
||||
M.Stun(power)
|
||||
if (M.stuttering < power) M.stuttering = power
|
||||
if(prob(stunprob))
|
||||
powerlevel = max(0, powerlevel-3)
|
||||
M.visible_message("<span class='danger'>[src] has shocked [M]!</span>", "<span class='danger'>[src] has shocked you!</span>")
|
||||
M.Weaken(power)
|
||||
M.Stun(power)
|
||||
M.stuttering = max(M.stuttering, power)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, M)
|
||||
s.start()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, M)
|
||||
s.start()
|
||||
|
||||
if(prob(stunprob) && powerlevel >= 8)
|
||||
M.adjustFireLoss(powerlevel * rand(6,10))
|
||||
M.updatehealth()
|
||||
if(prob(stunprob) && powerlevel >= 8)
|
||||
M.adjustFireLoss(powerlevel * rand(6,10))
|
||||
else if(prob(40))
|
||||
M.visible_message("<span class='danger'>[src] has pounced at [M]!</span>", "<span class='danger'>[src] has pounced at you!</span>")
|
||||
M.Weaken(power)
|
||||
else
|
||||
M.visible_message("<span class='danger'>[src] has tried to pounce at [M]!</span>", "<span class='danger'>[src] has tried to pounce at you!</span>")
|
||||
M.updatehealth()
|
||||
if ("grab") // We feed
|
||||
Wrap(M)
|
||||
if ("hurt") // Attacking
|
||||
A.attack_generic(src, (is_adult ? rand(20,40) : rand(5,25)), "glomped")
|
||||
else
|
||||
A.attack_generic(src, (is_adult ? rand(20,40) : rand(5,25)), "glomped") // Basic attack.
|
||||
/*
|
||||
New Players:
|
||||
Have no reason to click on anything at all.
|
||||
|
||||
@@ -182,6 +182,8 @@
|
||||
var/dooc_allowed = 1
|
||||
var/dsay_allowed = 1
|
||||
|
||||
var/starlight = 0 // Whether space turfs have ambient light or not
|
||||
|
||||
/datum/configuration/New()
|
||||
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
|
||||
for (var/T in L)
|
||||
@@ -603,6 +605,9 @@
|
||||
config.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
|
||||
config.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
|
||||
|
||||
if("starlight")
|
||||
config.starlight = 1
|
||||
|
||||
else
|
||||
log_misc("Unknown setting in configuration: '[name]'")
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ datum/controller/game_controller
|
||||
var/powernets_cost = 0
|
||||
var/nano_cost = 0
|
||||
var/events_cost = 0
|
||||
var/alarms_cost = 0
|
||||
var/ticker_cost = 0
|
||||
var/total_cost = 0
|
||||
|
||||
@@ -33,8 +34,7 @@ datum/controller/game_controller
|
||||
var/mob/list/expensive_mobs = list()
|
||||
|
||||
var/list/shuttle_list // For debugging and VV
|
||||
var/datum/ore_distribution/asteroid_ore_map // For debugging and VV.
|
||||
|
||||
var/datum/random_map/ore/asteroid_ore_map // For debugging and VV.
|
||||
|
||||
datum/controller/game_controller/New()
|
||||
//There can be only one master_controller. Out with the old and in with the new.
|
||||
@@ -59,6 +59,9 @@ datum/controller/game_controller/New()
|
||||
datum/controller/game_controller/proc/setup()
|
||||
world.tick_lag = config.Ticklag
|
||||
|
||||
//Create the asteroid Z-level.
|
||||
new /datum/random_map(null,13,32,5,217,223)
|
||||
|
||||
spawn(20)
|
||||
createRandomZlevel()
|
||||
|
||||
@@ -77,9 +80,6 @@ datum/controller/game_controller/proc/setup()
|
||||
|
||||
transfer_controller = new
|
||||
|
||||
for(var/i=0, i<max_secret_rooms, i++)
|
||||
make_mining_asteroid_secret()
|
||||
|
||||
spawn(0)
|
||||
if(ticker)
|
||||
ticker.pregame()
|
||||
@@ -108,14 +108,15 @@ datum/controller/game_controller/proc/setup_objects()
|
||||
var/obj/machinery/atmospherics/unary/vent_scrubber/T = U
|
||||
T.broadcast_status()
|
||||
|
||||
//Create the mining ore distribution map.
|
||||
asteroid_ore_map = new /datum/ore_distribution()
|
||||
asteroid_ore_map.populate_distribution_map()
|
||||
// Create the mining ore distribution map.
|
||||
// These values determine the specific area that the map is applied to.
|
||||
// If you do not use the official Baycode asteroid map, you will need to change them.
|
||||
asteroid_ore_map = new /datum/random_map/ore(null,13,32,5,217,223)
|
||||
|
||||
//Shitty hack to fix mining turf overlays, for some reason New() is not being called.
|
||||
for(var/turf/simulated/floor/plating/airless/asteroid/T in world)
|
||||
T.updateMineralOverlays()
|
||||
T.name = "asteroid"
|
||||
//for(var/turf/simulated/floor/plating/airless/asteroid/T in world)
|
||||
// T.updateMineralOverlays()
|
||||
// T.name = "asteroid"
|
||||
|
||||
//Set up spawn points.
|
||||
populate_spawn_points()
|
||||
@@ -231,6 +232,11 @@ datum/controller/game_controller/proc/process()
|
||||
process_events()
|
||||
events_cost = (world.timeofday - timer) / 10
|
||||
|
||||
//ALARMS
|
||||
timer = world.timeofday
|
||||
process_alarms()
|
||||
alarms_cost = (world.timeofday - timer) / 10
|
||||
|
||||
//TICKER
|
||||
timer = world.timeofday
|
||||
last_thing_processed = ticker.type
|
||||
@@ -238,7 +244,7 @@ datum/controller/game_controller/proc/process()
|
||||
ticker_cost = (world.timeofday - timer) / 10
|
||||
|
||||
//TIMING
|
||||
total_cost = air_cost + sun_cost + mobs_cost + diseases_cost + machines_cost + objects_cost + networks_cost + powernets_cost + nano_cost + events_cost + ticker_cost
|
||||
total_cost = air_cost + sun_cost + mobs_cost + diseases_cost + machines_cost + objects_cost + networks_cost + powernets_cost + nano_cost + events_cost + alarms_cost + ticker_cost
|
||||
|
||||
var/end_time = world.timeofday
|
||||
if(end_time < start_time) //why not just use world.time instead?
|
||||
@@ -288,6 +294,7 @@ datum/controller/game_controller/proc/process_machines_process()
|
||||
last_thing_processed = Machine.type
|
||||
if(Machine.process() != PROCESS_KILL)
|
||||
if(Machine)
|
||||
Machine.power_change()
|
||||
if(Machine.use_power)
|
||||
Machine.auto_use_power()
|
||||
continue
|
||||
@@ -333,9 +340,13 @@ datum/controller/game_controller/proc/process_nano()
|
||||
nanomanager.processing_uis.Cut(i,i+1)
|
||||
|
||||
datum/controller/game_controller/proc/process_events()
|
||||
last_thing_processed = /datum/event
|
||||
last_thing_processed = /datum/event_manager
|
||||
event_manager.process()
|
||||
|
||||
datum/controller/game_controller/proc/process_alarms()
|
||||
last_thing_processed = /datum/subsystem/alarm
|
||||
alarm_manager.fire()
|
||||
|
||||
datum/controller/game_controller/proc/Recover() //Mostly a placeholder for now.
|
||||
var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n"
|
||||
for(var/varname in master_controller.vars)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// We manually initialize the alarm handlers instead of looping over all existing types
|
||||
// to make it possible to write: camera.triggerAlarm() rather than alarm_manager.managers[datum/alarm_handler/camera].triggerAlarm() or a variant thereof.
|
||||
/var/global/datum/alarm_handler/atmosphere/atmosphere_alarm = new()
|
||||
/var/global/datum/alarm_handler/camera/camera_alarm = new()
|
||||
/var/global/datum/alarm_handler/fire/fire_alarm = new()
|
||||
/var/global/datum/alarm_handler/motion/motion_alarm = new()
|
||||
/var/global/datum/alarm_handler/power/power_alarm = new()
|
||||
|
||||
/datum/subsystem/alarm
|
||||
name = "Alarm"
|
||||
var/list/datum/alarm/all_handlers
|
||||
|
||||
/datum/subsystem/alarm/New()
|
||||
all_handlers = list(atmosphere_alarm, camera_alarm, fire_alarm, motion_alarm, power_alarm)
|
||||
|
||||
/datum/subsystem/alarm/stat_entry()
|
||||
stat(null,"Alarm-[master_controller.alarms_cost]\t#[number_of_active_alarms()]")
|
||||
|
||||
/datum/subsystem/alarm/fire()
|
||||
for(var/datum/alarm_handler/AH in all_handlers)
|
||||
AH.process()
|
||||
|
||||
/datum/subsystem/alarm/proc/active_alarms()
|
||||
var/list/all_alarms = new
|
||||
for(var/datum/alarm_handler/AH in all_handlers)
|
||||
var/list/alarms = AH.alarms
|
||||
all_alarms += alarms
|
||||
|
||||
return all_alarms
|
||||
|
||||
/datum/subsystem/alarm/proc/number_of_active_alarms()
|
||||
var/list/alarms = active_alarms()
|
||||
return alarms.len
|
||||
@@ -0,0 +1,46 @@
|
||||
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
|
||||
|
||||
/datum/subsystem
|
||||
//things you will want to define
|
||||
var/name //name of the subsystem
|
||||
var/priority = 0 //priority affects order of initialization. Higher priorities are initialized first, lower priorities later. Can be decimal and negative values.
|
||||
var/wait = 20 //time to wait (in deciseconds) between each call to fire(). Must be a positive integer.
|
||||
|
||||
//things you will probably want to leave alone
|
||||
var/can_fire = 0 //prevent fire() calls
|
||||
var/last_fire = 0 //last world.time we called fire()
|
||||
var/next_fire = 0 //scheduled world.time for next fire()
|
||||
var/cpu = 0 //cpu-usage stats (somewhat vague)
|
||||
var/cost = 0 //average time to execute
|
||||
var/times_fired = 0 //number of times we have called fire()
|
||||
|
||||
//used to initialize the subsystem BEFORE the map has loaded
|
||||
/datum/subsystem/New()
|
||||
|
||||
//previously, this would have been named 'process()' but that name is used everywhere for different things!
|
||||
//fire() seems more suitable. This is the procedure that gets called every 'wait' deciseconds.
|
||||
//fire(), and the procs it calls, SHOULD NOT HAVE ANY SLEEP OPERATIONS in them!
|
||||
//YE BE WARNED!
|
||||
/datum/subsystem/proc/fire()
|
||||
can_fire = 0
|
||||
|
||||
//used to initialize the subsystem AFTER the map has loaded
|
||||
/datum/subsystem/proc/Initialize(start_timeofday)
|
||||
var/time = (world.timeofday - start_timeofday) / 10
|
||||
var/msg = "Initialized [name] SubSystem within [time] seconds"
|
||||
world << "<span class='userdanger'>[msg]</span>"
|
||||
world.log << msg
|
||||
|
||||
//hook for printing stats to the "MC" statuspanel for admins to see performance and related stats etc.
|
||||
/datum/subsystem/proc/stat_entry()
|
||||
stat(name, "[round(cost,0.001)]ds\t(CPU:[round(cpu,1)]%)")
|
||||
|
||||
//could be used to postpone a costly subsystem for one cycle
|
||||
//for instance, during cpu intensive operations like explosions
|
||||
/datum/subsystem/proc/postpone()
|
||||
if(next_fire - world.time < wait)
|
||||
next_fire += wait
|
||||
|
||||
//usually called via datum/subsystem/New() when replacing a subsystem (i.e. due to a recurring crash)
|
||||
//should attempt to salvage what it can from the old instance of subsystem
|
||||
/datum/subsystem/proc/Recover()
|
||||
+26
-12
@@ -1,26 +1,34 @@
|
||||
//TODO: rewrite and standardise all controller datums to the datum/controller type
|
||||
//TODO: allow all controllers to be deleted for clean restarts (see WIP master controller stuff) - MC done - lighting done
|
||||
|
||||
/client/proc/show_distribution_map()
|
||||
/client/proc/print_random_map()
|
||||
set category = "Debug"
|
||||
set name = "Show Distribution Map"
|
||||
set desc = "Print the asteroid ore distribution map to the world."
|
||||
set name = "Display Random Map"
|
||||
set desc = "Show the contents of a random map."
|
||||
|
||||
if(!holder) return
|
||||
|
||||
if(master_controller && master_controller.asteroid_ore_map)
|
||||
master_controller.asteroid_ore_map.print_distribution_map(usr)
|
||||
var/datum/random_map/choice = input("Choose a map to debug.") as null|anything in random_maps
|
||||
if(!choice)
|
||||
return
|
||||
choice.display_map(usr)
|
||||
|
||||
/client/proc/remake_distribution_map()
|
||||
|
||||
/client/proc/create_random_map()
|
||||
set category = "Debug"
|
||||
set name = "Remake Distribution Map"
|
||||
set desc = "Rebuild the asteroid ore distribution map."
|
||||
set name = "Create Random Map"
|
||||
set desc = "Create a random map."
|
||||
|
||||
if(!holder) return
|
||||
|
||||
if(master_controller && master_controller.asteroid_ore_map)
|
||||
master_controller.asteroid_ore_map = new /datum/ore_distribution()
|
||||
master_controller.asteroid_ore_map.populate_distribution_map()
|
||||
var/map_datum = input("Choose a map to create.") as null|anything in typesof(/datum/random_map)-/datum/random_map
|
||||
if(!map_datum)
|
||||
return
|
||||
var/seed = input("Seed? (default null)") as text|null
|
||||
var/tx = input("X? (default 1)") as text|null
|
||||
var/ty = input("Y? (default 1)") as text|null
|
||||
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"))
|
||||
set category = "Debug"
|
||||
@@ -48,7 +56,7 @@
|
||||
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
|
||||
return
|
||||
|
||||
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event"))
|
||||
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm"))
|
||||
set category = "Debug"
|
||||
set name = "Debug Controller"
|
||||
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
|
||||
@@ -106,5 +114,11 @@
|
||||
if("Event")
|
||||
debug_variables(event_manager)
|
||||
feedback_add_details("admin_verb", "DEvent")
|
||||
if("Plants")
|
||||
debug_variables(plant_controller)
|
||||
feedback_add_details("admin_verb", "DPlants")
|
||||
if("Alarm")
|
||||
debug_variables(alarm_manager)
|
||||
feedback_add_details("admin_verb", "DAlarm")
|
||||
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
|
||||
return
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
assignment = "Unassigned"
|
||||
|
||||
var/id = add_zero(num2hex(rand(1, 1.6777215E7)), 6) //this was the best they could come up with? A large random number? *sigh*
|
||||
|
||||
var/icon/front = new(get_id_photo(H), dir = SOUTH)
|
||||
var/icon/side = new(get_id_photo(H), dir = WEST)
|
||||
//General Record
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
playSpecials(curturf,effectin,soundin)
|
||||
|
||||
var/obj/structure/stool/bed/chair/C = null
|
||||
var/obj/structure/bed/chair/C = null
|
||||
if(isliving(teleatom))
|
||||
var/mob/living/L = teleatom
|
||||
if(L.buckled)
|
||||
|
||||
+8
-8
@@ -500,7 +500,7 @@ datum/mind
|
||||
else if(href_list["implant"])
|
||||
var/mob/living/carbon/human/H = current
|
||||
|
||||
H.hud_updateflag |= (1 << IMPLOYAL_HUD) // updates that players HUD images so secHUD's pick up they are implanted or not.
|
||||
BITSET(H.hud_updateflag, IMPLOYAL_HUD) // updates that players HUD images so secHUD's pick up they are implanted or not.
|
||||
|
||||
switch(href_list["implant"])
|
||||
if("remove")
|
||||
@@ -540,7 +540,7 @@ datum/mind
|
||||
|
||||
|
||||
else if (href_list["revolution"])
|
||||
current.hud_updateflag |= (1 << SPECIALROLE_HUD)
|
||||
BITSET(current.hud_updateflag, SPECIALROLE_HUD)
|
||||
|
||||
switch(href_list["revolution"])
|
||||
if("clear")
|
||||
@@ -635,7 +635,7 @@ datum/mind
|
||||
usr << "\red Reequipping revolutionary goes wrong!"
|
||||
|
||||
else if (href_list["cult"])
|
||||
current.hud_updateflag |= (1 << SPECIALROLE_HUD)
|
||||
BITSET(current.hud_updateflag, SPECIALROLE_HUD)
|
||||
switch(href_list["cult"])
|
||||
if("clear")
|
||||
if(src in ticker.mode.cult)
|
||||
@@ -685,7 +685,7 @@ datum/mind
|
||||
usr << "\red Spawning amulet failed!"
|
||||
|
||||
else if (href_list["wizard"])
|
||||
current.hud_updateflag |= (1 << SPECIALROLE_HUD)
|
||||
BITSET(current.hud_updateflag, SPECIALROLE_HUD)
|
||||
|
||||
switch(href_list["wizard"])
|
||||
if("clear")
|
||||
@@ -715,7 +715,7 @@ datum/mind
|
||||
usr << "\blue The objectives for wizard [key] have been generated. You can edit them and anounce manually."
|
||||
|
||||
else if (href_list["changeling"])
|
||||
current.hud_updateflag |= (1 << SPECIALROLE_HUD)
|
||||
BITSET(current.hud_updateflag, SPECIALROLE_HUD)
|
||||
switch(href_list["changeling"])
|
||||
if("clear")
|
||||
if(src in ticker.mode.changelings)
|
||||
@@ -751,7 +751,7 @@ datum/mind
|
||||
else if (href_list["mercenary"])
|
||||
var/mob/living/carbon/human/H = current
|
||||
|
||||
current.hud_updateflag |= (1 << SPECIALROLE_HUD)
|
||||
BITSET(current.hud_updateflag, SPECIALROLE_HUD)
|
||||
|
||||
switch(href_list["mercenary"])
|
||||
if("clear")
|
||||
@@ -805,7 +805,7 @@ datum/mind
|
||||
usr << "\red No valid nuke found!"
|
||||
|
||||
else if (href_list["traitor"])
|
||||
current.hud_updateflag |= (1 << SPECIALROLE_HUD)
|
||||
BITSET(current.hud_updateflag, SPECIALROLE_HUD)
|
||||
switch(href_list["traitor"])
|
||||
if("clear")
|
||||
if(src in ticker.mode.traitors)
|
||||
@@ -888,7 +888,7 @@ datum/mind
|
||||
current.radiation -= 50
|
||||
|
||||
else if (href_list["silicon"])
|
||||
current.hud_updateflag |= (1 << SPECIALROLE_HUD)
|
||||
BITSET(current.hud_updateflag, SPECIALROLE_HUD)
|
||||
switch(href_list["silicon"])
|
||||
if("unmalf")
|
||||
if(src in ticker.mode.malf_ai)
|
||||
|
||||
+57
-41
@@ -26,52 +26,68 @@
|
||||
*
|
||||
* Functions you do not need to call directly but could:
|
||||
* /datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
|
||||
* //1=precisely, 0=insufficiently, -1=superfluous
|
||||
*
|
||||
* /datum/recipe/proc/check_items(var/obj/container as obj)
|
||||
* //1=precisely, 0=insufficiently, -1=superfluous
|
||||
*
|
||||
* */
|
||||
|
||||
/datum/recipe
|
||||
var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice
|
||||
var/list/items // example: =list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
|
||||
var/result //example: = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
|
||||
var/time = 100 // 1/10 part of second
|
||||
var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice
|
||||
var/list/items // example: = list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
|
||||
var/list/fruit // example: = list("fruit" = 3)
|
||||
var/result // example: = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
|
||||
var/time = 100 // 1/10 part of second
|
||||
|
||||
|
||||
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous
|
||||
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
|
||||
. = 1
|
||||
for (var/r_r in reagents)
|
||||
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
|
||||
if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
|
||||
if (aval_r_amnt>reagents[r_r])
|
||||
. = -1
|
||||
. = 0
|
||||
else
|
||||
return 0
|
||||
return -1
|
||||
if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
|
||||
return -1
|
||||
return 0
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_items(var/obj/container as obj) //1=precisely, 0=insufficiently, -1=superfluous
|
||||
if (!items)
|
||||
if (locate(/obj/) in container)
|
||||
return -1
|
||||
else
|
||||
return 1
|
||||
/datum/recipe/proc/check_fruit(var/obj/container)
|
||||
. = 1
|
||||
var/list/checklist = items.Copy()
|
||||
for (var/obj/O in container)
|
||||
var/found = 0
|
||||
for (var/type in checklist)
|
||||
if (istype(O,type))
|
||||
checklist-=type
|
||||
found = 1
|
||||
break
|
||||
if (!found)
|
||||
if(fruit && fruit.len)
|
||||
var/list/checklist = list()
|
||||
for(var/fruittype in fruit) // I do not trust Copy().
|
||||
checklist[fruittype] = fruit[fruittype]
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in container)
|
||||
if(!G.seed || !G.seed.kitchen_tag || isnull(checklist[G.seed.kitchen_tag]))
|
||||
continue
|
||||
checklist[G.seed.kitchen_tag]--
|
||||
for(var/ktag in checklist)
|
||||
if(!isnull(checklist[ktag]))
|
||||
if(checklist[ktag] < 0)
|
||||
. = 0
|
||||
else if(checklist[ktag] > 0)
|
||||
. = -1
|
||||
break
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_items(var/obj/container as obj)
|
||||
. = 1
|
||||
if (items && items.len)
|
||||
var/list/checklist = list()
|
||||
for(var/item_type in items)
|
||||
checklist |= item_type //Still don't trust Copy().
|
||||
for(var/obj/O in container)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
continue // Fruit is handled in check_fruit().
|
||||
var/found = 0
|
||||
for(var/item_type in checklist)
|
||||
if (istype(O,item_type))
|
||||
checklist-=item_type
|
||||
found = 1
|
||||
break
|
||||
if (!found)
|
||||
. = 0
|
||||
if (checklist.len)
|
||||
. = -1
|
||||
if (checklist.len)
|
||||
return 0
|
||||
return .
|
||||
|
||||
//general version
|
||||
@@ -85,6 +101,9 @@
|
||||
|
||||
// food-related
|
||||
/datum/recipe/proc/make_food(var/obj/container as obj)
|
||||
if(!result)
|
||||
world << "<span class='danger'>Recipe [type] is defined without a result, please bug this.</span>"
|
||||
return
|
||||
var/obj/result_obj = new result(container)
|
||||
for (var/obj/O in (container.contents-result_obj))
|
||||
if (O.reagents)
|
||||
@@ -95,26 +114,23 @@
|
||||
container.reagents.clear_reagents()
|
||||
return result_obj
|
||||
|
||||
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact = 1 as num)
|
||||
if (!exact)
|
||||
exact = -1
|
||||
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact)
|
||||
var/list/datum/recipe/possible_recipes = new
|
||||
var/target = exact ? 0 : 1
|
||||
for (var/datum/recipe/recipe in avaiable_recipes)
|
||||
if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact)
|
||||
possible_recipes+=recipe
|
||||
if((recipe.check_reagents(obj.reagents) < target) || (recipe.check_items(obj) < target) || (recipe.check_fruit(obj) < target))
|
||||
continue
|
||||
possible_recipes |= recipe
|
||||
if (possible_recipes.len==0)
|
||||
return null
|
||||
else if (possible_recipes.len==1)
|
||||
return possible_recipes[1]
|
||||
else //okay, let's select the most complicated recipe
|
||||
var/r_count = 0
|
||||
var/i_count = 0
|
||||
var/highest_count = 0
|
||||
. = possible_recipes[1]
|
||||
for (var/datum/recipe/recipe in possible_recipes)
|
||||
var/N_i = (recipe.items)?(recipe.items.len):0
|
||||
var/N_r = (recipe.reagents)?(recipe.reagents.len):0
|
||||
if (N_i > i_count || (N_i== i_count && N_r > r_count ))
|
||||
r_count = N_r
|
||||
i_count = N_i
|
||||
var/count = ((recipe.items)?(recipe.items.len):0) + ((recipe.reagents)?(recipe.reagents.len):0) + ((recipe.fruit)?(recipe.fruit.len):0)
|
||||
if (count >= highest_count)
|
||||
highest_count = count
|
||||
. = recipe
|
||||
return .
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
return
|
||||
|
||||
if(target && target.buckled)
|
||||
target.buckled.unbuckle()
|
||||
target.buckled.unbuckle_mob()
|
||||
|
||||
var/list/tempL = L
|
||||
var/attempt = null
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
spawn(0)
|
||||
|
||||
if(target.buckled)
|
||||
var/obj/structure/stool/bed/buckled_to = target.buckled.
|
||||
buckled_to.unbuckle()
|
||||
var/obj/structure/bed/buckled_to = target.buckled.
|
||||
buckled_to.unbuckle_mob()
|
||||
|
||||
var/mobloc = get_turf(target.loc)
|
||||
var/obj/effect/dummy/spell_jaunt/holder = new /obj/effect/dummy/spell_jaunt( mobloc )
|
||||
|
||||
Executable → Regular
+107
-42
@@ -53,9 +53,8 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/weapon/reagent_containers/food/snacks/tofu,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/tofu,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana)
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
)
|
||||
cost = 10
|
||||
containertype = /obj/structure/closet/crate/freezer
|
||||
containername = "Food crate"
|
||||
@@ -155,21 +154,31 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/weapon/storage/toolbox/emergency,
|
||||
/obj/item/clothing/suit/storage/hazardvest,
|
||||
/obj/item/clothing/suit/storage/hazardvest,
|
||||
/obj/item/weapon/tank/emergency_oxygen,
|
||||
/obj/item/weapon/tank/emergency_oxygen,
|
||||
/obj/item/weapon/tank/emergency_oxygen,
|
||||
/obj/item/weapon/tank/emergency_oxygen,
|
||||
/obj/item/weapon/tank/emergency_oxygen,
|
||||
/obj/item/clothing/suit/storage/vest,
|
||||
/obj/item/clothing/suit/storage/vest,
|
||||
/obj/item/weapon/tank/emergency_oxygen/engi,
|
||||
/obj/item/weapon/tank/emergency_oxygen/engi,
|
||||
/obj/item/weapon/tank/emergency_oxygen/engi,
|
||||
/obj/item/weapon/tank/emergency_oxygen/engi,
|
||||
/obj/item/clothing/suit/space/emergency,
|
||||
/obj/item/clothing/suit/space/emergency,
|
||||
/obj/item/clothing/suit/space/emergency,
|
||||
/obj/item/clothing/suit/space/emergency,
|
||||
/obj/item/clothing/head/helmet/space/emergency,
|
||||
/obj/item/clothing/head/helmet/space/emergency,
|
||||
/obj/item/clothing/head/helmet/space/emergency,
|
||||
/obj/item/clothing/head/helmet/space/emergency,
|
||||
/obj/item/clothing/mask/gas,
|
||||
/obj/item/clothing/mask/gas,
|
||||
/obj/item/clothing/mask/gas,
|
||||
/obj/item/clothing/mask/gas,
|
||||
/obj/item/clothing/mask/gas)
|
||||
cost = 35
|
||||
cost = 45
|
||||
containertype = /obj/structure/closet/crate/internals
|
||||
containername = "Emergency crate"
|
||||
group = "Atmospherics"
|
||||
|
||||
|
||||
/datum/supply_packs/inflatable
|
||||
name = "Inflatable barriers"
|
||||
contains = list(/obj/item/weapon/storage/briefcase/inflatable,
|
||||
@@ -257,6 +266,8 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/datum/supply_packs/hydroponics // -- Skie
|
||||
name = "Hydroponics Supply Crate"
|
||||
contains = list(/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/weapon/reagent_containers/glass/bottle/ammonia,
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/ammonia,
|
||||
@@ -689,6 +700,8 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/weapon/gun/energy/laser,
|
||||
/obj/item/weapon/gun/energy/taser,
|
||||
/obj/item/weapon/gun/energy/taser,
|
||||
/obj/item/weapon/gun/projectile/sec,
|
||||
/obj/item/weapon/gun/projectile/sec,
|
||||
/obj/item/weapon/storage/box/flashbangs,
|
||||
/obj/item/weapon/storage/box/flashbangs)
|
||||
cost = 30
|
||||
@@ -697,6 +710,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
access = access_security
|
||||
group = "Security"
|
||||
|
||||
|
||||
/datum/supply_packs/eweapons
|
||||
name = "Experimental weapons crate"
|
||||
contains = list(/obj/item/weapon/gun/energy/xray,
|
||||
@@ -711,18 +725,28 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
access = access_heads
|
||||
group = "Security"
|
||||
|
||||
/datum/supply_packs/armor
|
||||
/datum/supply_packs/randomised/armor
|
||||
num_contained = 5
|
||||
contains = list(/obj/item/clothing/suit/storage/vest,
|
||||
/obj/item/clothing/suit/storage/vest/officer,
|
||||
/obj/item/clothing/suit/storage/vest/warden,
|
||||
/obj/item/clothing/suit/storage/vest/hos,
|
||||
/obj/item/clothing/suit/storage/vest/pcrc,
|
||||
/obj/item/clothing/suit/storage/vest/detective,
|
||||
/obj/item/clothing/suit/storage/vest/heavy,
|
||||
/obj/item/clothing/suit/storage/vest/heavy/officer,
|
||||
/obj/item/clothing/suit/storage/vest/heavy/warden,
|
||||
/obj/item/clothing/suit/storage/vest/heavy/hos,
|
||||
/obj/item/clothing/suit/storage/vest/heavy/pcrc)
|
||||
|
||||
name = "Armor crate"
|
||||
contains = list(/obj/item/clothing/head/helmet,
|
||||
/obj/item/clothing/head/helmet,
|
||||
/obj/item/clothing/suit/armor/vest,
|
||||
/obj/item/clothing/suit/armor/vest)
|
||||
cost = 15
|
||||
cost = 40
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Armor crate"
|
||||
access = access_security
|
||||
group = "Security"
|
||||
|
||||
|
||||
/datum/supply_packs/riot
|
||||
name = "Riot gear crate"
|
||||
contains = list(/obj/item/weapon/melee/baton,
|
||||
@@ -731,9 +755,6 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/weapon/shield/riot,
|
||||
/obj/item/weapon/shield/riot,
|
||||
/obj/item/weapon/shield/riot,
|
||||
/obj/item/weapon/storage/box/flashbangs,
|
||||
/obj/item/weapon/storage/box/flashbangs,
|
||||
/obj/item/weapon/storage/box/flashbangs,
|
||||
/obj/item/weapon/handcuffs,
|
||||
/obj/item/weapon/handcuffs,
|
||||
/obj/item/weapon/handcuffs,
|
||||
@@ -742,23 +763,37 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/clothing/head/helmet/riot,
|
||||
/obj/item/clothing/suit/armor/riot,
|
||||
/obj/item/clothing/head/helmet/riot,
|
||||
/obj/item/clothing/suit/armor/riot)
|
||||
/obj/item/clothing/suit/armor/riot,
|
||||
/obj/item/weapon/storage/box/flashbangs,
|
||||
/obj/item/weapon/storage/box/beanbags,
|
||||
/obj/item/weapon/storage/box/handcuffs)
|
||||
cost = 60
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Riot gear crate"
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
/datum/supply_packs/energyweapons
|
||||
name = "Energy weapons crate"
|
||||
contains = list(/obj/item/weapon/gun/energy/laser,
|
||||
/obj/item/weapon/gun/energy/laser,
|
||||
/obj/item/weapon/gun/energy/gun)
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "energy weapons crate"
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
/datum/supply_packs/ballistic
|
||||
name = "Ballistic gear crate"
|
||||
/datum/supply_packs/shotgun
|
||||
name = "Shotgun crate"
|
||||
contains = list(/obj/item/clothing/suit/armor/bulletproof,
|
||||
/obj/item/clothing/suit/armor/bulletproof,
|
||||
/obj/item/weapon/gun/projectile/shotgun/pump/combat,
|
||||
/obj/item/weapon/storage/box/shotgunammo,
|
||||
/obj/item/weapon/gun/projectile/shotgun/pump,
|
||||
/obj/item/weapon/gun/projectile/shotgun/pump/combat)
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Ballistic gear crate"
|
||||
containername = "Shotgun crate"
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
@@ -768,20 +803,43 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/clothing/suit/armor/laserproof,
|
||||
/obj/item/weapon/gun/energy/sniperrifle,
|
||||
/obj/item/weapon/gun/energy/sniperrifle)
|
||||
cost = 50
|
||||
cost = 90
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Energy marksman crate"
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
/datum/supply_packs/shotgunammo
|
||||
name = "Shotgun shells"
|
||||
name = "Ballistic ammunition crate"
|
||||
contains = list(/obj/item/weapon/storage/box/shotgunammo,
|
||||
/obj/item/weapon/storage/box/shotgunammo,
|
||||
/obj/item/weapon/storage/box/shotgunammo)
|
||||
/obj/item/weapon/storage/box/shotgunshells,
|
||||
/obj/item/weapon/storage/box/shotgunshells)
|
||||
cost = 60
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Shotgun shells"
|
||||
containername = "ballistic ammunition crate"
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
/datum/supply_packs/ionweapons
|
||||
name = "Electromagnetic weapons crate"
|
||||
contains = list(/obj/item/weapon/gun/energy/ionrifle,
|
||||
/obj/item/weapon/gun/energy/ionrifle,
|
||||
/obj/item/weapon/storage/box/emps)
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "electromagnetic weapons crate"
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
/datum/supply_packs/randomised/automatic
|
||||
name = "Automatic weapon crate"
|
||||
num_contained = 2
|
||||
contains = list(/obj/item/weapon/gun/projectile/automatic/wt550,
|
||||
/obj/item/weapon/gun/projectile/automatic/z8)
|
||||
cost = 90
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Automatic weapon crate"
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
@@ -887,10 +945,9 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/weapon/reagent_containers/glass/paint/green,
|
||||
/obj/item/weapon/reagent_containers/glass/paint/blue,
|
||||
/obj/item/weapon/reagent_containers/glass/paint/yellow,
|
||||
/obj/item/weapon/reagent_containers/glass/paint/violet,
|
||||
/obj/item/weapon/reagent_containers/glass/paint/purple,
|
||||
/obj/item/weapon/reagent_containers/glass/paint/black,
|
||||
/obj/item/weapon/reagent_containers/glass/paint/white,
|
||||
/obj/item/weapon/reagent_containers/glass/paint/remover,
|
||||
/obj/item/weapon/contraband/poster,
|
||||
/obj/item/weapon/wrapping_paper,
|
||||
/obj/item/weapon/wrapping_paper,
|
||||
@@ -955,8 +1012,13 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
name = "Sterile equipment crate"
|
||||
contains = list(/obj/item/clothing/under/rank/medical/green,
|
||||
/obj/item/clothing/under/rank/medical/green,
|
||||
/obj/item/clothing/head/surgery/green,
|
||||
/obj/item/clothing/head/surgery/green,
|
||||
/obj/item/weapon/storage/box/masks,
|
||||
/obj/item/weapon/storage/box/gloves)
|
||||
/obj/item/weapon/storage/box/gloves,
|
||||
/obj/item/weapon/storage/belt/medical,
|
||||
/obj/item/weapon/storage/belt/medical,
|
||||
/obj/item/weapon/storage/belt/medical)
|
||||
cost = 15
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "Sterile equipment crate"
|
||||
@@ -1234,14 +1296,6 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/clothing/glasses/sunglasses/sechud/tactical,
|
||||
/obj/item/weapon/storage/belt/security/tactical,
|
||||
/obj/item/clothing/shoes/jackboots,
|
||||
/obj/item/clothing/gloves/black,
|
||||
/obj/item/clothing/under/tactical,
|
||||
/obj/item/clothing/suit/armor/tactical,
|
||||
/obj/item/clothing/head/helmet/tactical,
|
||||
/obj/item/clothing/mask/balaclava/tactical,
|
||||
/obj/item/clothing/glasses/sunglasses/sechud/tactical,
|
||||
/obj/item/weapon/storage/belt/security/tactical,
|
||||
/obj/item/clothing/shoes/jackboots,
|
||||
/obj/item/clothing/gloves/black)
|
||||
|
||||
/datum/supply_packs/carpet
|
||||
@@ -1379,10 +1433,10 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/datum/supply_packs/randomised/webbing
|
||||
name = "Webbing crate"
|
||||
num_contained = 1
|
||||
contains = list(/obj/item/clothing/tie/holster,
|
||||
/obj/item/clothing/tie/storage/brown_vest,
|
||||
/obj/item/clothing/tie/storage/webbing,
|
||||
/obj/item/clothing/tie/storage)
|
||||
contains = list(/obj/item/clothing/accessory/holster,
|
||||
/obj/item/clothing/accessory/storage/brown_vest,
|
||||
/obj/item/clothing/accessory/storage/webbing,
|
||||
/obj/item/clothing/accessory/storage)
|
||||
cost = 15
|
||||
containertype = /obj/structure/closet/crate
|
||||
containername = "Webbing crate"
|
||||
@@ -1417,5 +1471,16 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/clothing/under/dress/dress_saloon)
|
||||
group = "Miscellaneous"
|
||||
|
||||
/datum/supply_packs/painters
|
||||
name = "Station Painting Supplies"
|
||||
cost = 10
|
||||
containername = "station painting supplies crate"
|
||||
containertype = /obj/structure/closet/crate
|
||||
group = "Engineering"
|
||||
contains = list(/obj/item/device/pipe_painter,
|
||||
/obj/item/device/pipe_painter,
|
||||
/obj/item/device/floor_painter,
|
||||
/obj/item/device/floor_painter)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ var/const/AALARM_WIRE_AALARM = 16
|
||||
|
||||
/datum/wires/alarm/CanUse(var/mob/living/L)
|
||||
var/obj/machinery/alarm/A = holder
|
||||
if(A.wiresexposed)
|
||||
if(A.wiresexposed && A.buildstage == 2)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -46,7 +46,7 @@ var/const/AALARM_WIRE_AALARM = 16
|
||||
//world << "Syphon Wire Cut"
|
||||
|
||||
if(AALARM_WIRE_AALARM)
|
||||
if (A.alarm_area.atmosalert(2))
|
||||
if (A.alarm_area.atmosalert(2, A))
|
||||
A.post_alert(2)
|
||||
A.update_icon()
|
||||
|
||||
@@ -88,6 +88,6 @@ var/const/AALARM_WIRE_AALARM = 16
|
||||
|
||||
if(AALARM_WIRE_AALARM)
|
||||
// world << "Aalarm wire pulsed"
|
||||
if (A.alarm_area.atmosalert(0))
|
||||
if (A.alarm_area.atmosalert(0, A))
|
||||
A.post_alert(0)
|
||||
A.update_icon()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define CAT_HIDDEN 2 // Also in code/game/machinery/vending.dm
|
||||
|
||||
/datum/wires/vending
|
||||
holder_type = /obj/machinery/vending
|
||||
wire_count = 4
|
||||
@@ -17,17 +19,12 @@ var/const/VENDING_WIRE_IDSCAN = 8
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/wires/vending/Interact(var/mob/living/user)
|
||||
if(CanUse(user))
|
||||
var/obj/machinery/vending/V = holder
|
||||
V.attack_hand(user)
|
||||
|
||||
/datum/wires/vending/GetInteractWindow()
|
||||
var/obj/machinery/vending/V = holder
|
||||
. += ..()
|
||||
. += "<BR>The orange light is [V.seconds_electrified ? "off" : "on"].<BR>"
|
||||
. += "The red light is [V.shoot_inventory ? "off" : "blinking"].<BR>"
|
||||
. += "The green light is [V.extended_inventory ? "on" : "off"].<BR>"
|
||||
. += "The green light is [(V.categories & CAT_HIDDEN) ? "on" : "off"].<BR>"
|
||||
. += "The [V.scan_id ? "purple" : "yellow"] light is on.<BR>"
|
||||
|
||||
/datum/wires/vending/UpdatePulsed(var/index)
|
||||
@@ -36,7 +33,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
|
||||
if(VENDING_WIRE_THROW)
|
||||
V.shoot_inventory = !V.shoot_inventory
|
||||
if(VENDING_WIRE_CONTRABAND)
|
||||
V.extended_inventory = !V.extended_inventory
|
||||
V.categories ^= CAT_HIDDEN
|
||||
if(VENDING_WIRE_ELECTRIFY)
|
||||
V.seconds_electrified = 30
|
||||
if(VENDING_WIRE_IDSCAN)
|
||||
@@ -48,7 +45,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
|
||||
if(VENDING_WIRE_THROW)
|
||||
V.shoot_inventory = !mended
|
||||
if(VENDING_WIRE_CONTRABAND)
|
||||
V.extended_inventory = 0
|
||||
V.categories &= ~CAT_HIDDEN
|
||||
if(VENDING_WIRE_ELECTRIFY)
|
||||
if(mended)
|
||||
V.seconds_electrified = 0
|
||||
|
||||
+57
-13
@@ -24,17 +24,6 @@
|
||||
var/mode = 1
|
||||
w_class = 3.0
|
||||
|
||||
/obj/item/weapon/bananapeel
|
||||
name = "banana peel"
|
||||
desc = "A peel from a banana."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "banana_peel"
|
||||
item_state = "banana_peel"
|
||||
w_class = 2.0
|
||||
throwforce = 0
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
/obj/item/weapon/soap
|
||||
name = "soap"
|
||||
desc = "A cheap bar of soap. Doesn't smell."
|
||||
@@ -67,7 +56,7 @@
|
||||
icon_state = "bike_horn"
|
||||
item_state = "bike_horn"
|
||||
throwforce = 3
|
||||
w_class = 1.0
|
||||
w_class = 2
|
||||
throw_speed = 3
|
||||
throw_range = 15
|
||||
attack_verb = list("HONKED")
|
||||
@@ -84,7 +73,6 @@
|
||||
throw_speed = 4
|
||||
throw_range = 5
|
||||
|
||||
|
||||
/obj/item/weapon/cane
|
||||
name = "cane"
|
||||
desc = "A cane used by a true gentlemen. Or a clown."
|
||||
@@ -98,6 +86,46 @@
|
||||
matter = list("metal" = 50)
|
||||
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
|
||||
|
||||
/obj/item/weapon/cane/concealed
|
||||
var/concealed_blade
|
||||
|
||||
/obj/item/weapon/cane/concealed/New()
|
||||
..()
|
||||
concealed_blade = new/obj/item/weapon/butterfly/switchblade(src)
|
||||
|
||||
/obj/item/weapon/cane/concealed/attack_self(mob/user)
|
||||
if(concealed_blade)
|
||||
user.visible_message("<span class='warning'>[user] has unsheathed \a [concealed_blade] from \his [src]!</span>", "You unsheathe \the [concealed_blade] from \the [src].")
|
||||
// Calling drop/put in hands to properly call item drop/pickup procs
|
||||
playsound(user.loc, 'sound/weapons/flipblade.ogg', 50, 1)
|
||||
user.drop_from_inventory(src)
|
||||
user.put_in_hands(concealed_blade)
|
||||
user.put_in_hands(src)
|
||||
concealed_blade = null
|
||||
update_icon()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/cane/concealed/attackby(var/obj/item/weapon/butterfly/W, var/mob/user)
|
||||
if(!src.concealed_blade && istype(W))
|
||||
user.visible_message("<span class='warning'>[user] has sheathed \a [W] into \his [src]!</span>", "You sheathe \the [W] into \the [src].")
|
||||
user.drop_from_inventory(W)
|
||||
W.loc = src
|
||||
src.concealed_blade = W
|
||||
update_icon()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/cane/concealed/update_icon()
|
||||
if(concealed_blade)
|
||||
name = initial(name)
|
||||
icon_state = initial(icon_state)
|
||||
item_state = initial(icon_state)
|
||||
else
|
||||
name = "cane shaft"
|
||||
icon_state = "nullrod"
|
||||
item_state = "foldcane"
|
||||
|
||||
/obj/item/weapon/disk
|
||||
name = "disk"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
@@ -395,6 +423,22 @@
|
||||
|
||||
///////////////////////////////////////Stock Parts /////////////////////////////////
|
||||
|
||||
/obj/item/weapon/storage/part_replacer
|
||||
name = "rapid part exchange device"
|
||||
desc = "Special mechanical module made to store, sort, and apply standard machine parts."
|
||||
icon_state = "RPED"
|
||||
item_state = "RPED"
|
||||
w_class = 5
|
||||
can_hold = list("/obj/item/weapon/stock_parts")
|
||||
storage_slots = 50
|
||||
use_to_pickup = 1
|
||||
allow_quick_gather = 1
|
||||
allow_quick_empty = 1
|
||||
collection_mode = 1
|
||||
display_contents_with_number = 1
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 100
|
||||
|
||||
/obj/item/weapon/stock_parts
|
||||
name = "stock part"
|
||||
desc = "What?"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
var/tmp/message_title = new_title ? new_title : title
|
||||
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
|
||||
|
||||
message = html_encode(message)
|
||||
message = trim_strip_html_properly(message)
|
||||
message_title = html_encode(message_title)
|
||||
|
||||
Message(message, message_title)
|
||||
|
||||
@@ -94,6 +94,11 @@ var/list/ghostteleportlocs = list()
|
||||
return 1
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
||||
/////////
|
||||
//SPACE//
|
||||
/////////
|
||||
|
||||
/area/space
|
||||
name = "\improper Space"
|
||||
icon_state = "space"
|
||||
@@ -105,7 +110,13 @@ var/list/ghostteleportlocs = list()
|
||||
power_environ = 0
|
||||
ambience = list('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg')
|
||||
|
||||
/area/space/firealert()
|
||||
area/space/atmosalert()
|
||||
return
|
||||
|
||||
/area/space/fire_alert()
|
||||
return
|
||||
|
||||
/area/space/fire_reset()
|
||||
return
|
||||
|
||||
/area/space/readyalert()
|
||||
@@ -113,8 +124,7 @@ var/list/ghostteleportlocs = list()
|
||||
|
||||
/area/space/partyalert()
|
||||
return
|
||||
/area/engine/
|
||||
ambience = list('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg')
|
||||
|
||||
/area/turret_protected/
|
||||
|
||||
/area/arrival
|
||||
@@ -130,9 +140,12 @@ var/list/ghostteleportlocs = list()
|
||||
|
||||
|
||||
|
||||
//These are shuttle areas, they must contain two areas in a subgroup if you want to move a shuttle from one
|
||||
////////////
|
||||
//SHUTTLES//
|
||||
////////////
|
||||
//shuttle areas must contain at least two areas in a subgroup if you want to move a shuttle from one
|
||||
//place to another. Look at escape shuttle for example.
|
||||
//All shuttles show now be under shuttle since we have smooth-wall code.
|
||||
//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.
|
||||
requires_power = 0
|
||||
@@ -627,11 +640,9 @@ var/list/ghostteleportlocs = list()
|
||||
name = "Prison Cell Block C"
|
||||
icon_state = "brig"
|
||||
|
||||
//STATION13
|
||||
|
||||
/area/atmos
|
||||
name = "Atmospherics"
|
||||
icon_state = "atmos"
|
||||
////////////////////
|
||||
//SPACE STATION 13//
|
||||
////////////////////
|
||||
|
||||
//Maintenance
|
||||
|
||||
@@ -997,9 +1008,6 @@ var/list/ghostteleportlocs = list()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/area/holodeck
|
||||
name = "\improper Holodeck"
|
||||
icon_state = "Holodeck"
|
||||
@@ -1026,6 +1034,10 @@ var/list/ghostteleportlocs = list()
|
||||
/area/holodeck/source_thunderdomecourt
|
||||
name = "\improper Holodeck - Thunderdome Court"
|
||||
|
||||
/area/holodeck/source_courtroom
|
||||
name = "\improper Holodeck - Courtroom"
|
||||
icon_state = "Holodeck"
|
||||
|
||||
/area/holodeck/source_beach
|
||||
name = "\improper Holodeck - Beach"
|
||||
icon_state = "Holodeck" // Lazy.
|
||||
@@ -1058,89 +1070,77 @@ var/list/ghostteleportlocs = list()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Engineering
|
||||
|
||||
/area/engine
|
||||
/area/engineering/
|
||||
name = "\improper Engineering"
|
||||
icon_state = "engineering"
|
||||
ambience = list('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg')
|
||||
|
||||
drone_fabrication
|
||||
name = "\improper Drone Fabrication"
|
||||
icon_state = "engine"
|
||||
/area/engineering/atmos
|
||||
name = "\improper Atmospherics"
|
||||
icon_state = "atmos"
|
||||
|
||||
engine_smes
|
||||
name = "Engineering SMES"
|
||||
icon_state = "engine_smes"
|
||||
// requires_power = 0//This area only covers the batteries and they deal with their own power
|
||||
/area/engineering/atmos/monitoring
|
||||
name = "\improper Atmospherics Monitoring Room"
|
||||
icon_state = "atmos_monitoring"
|
||||
|
||||
engine_room
|
||||
name = "\improper Engine Room"
|
||||
icon_state = "engine"
|
||||
/area/engineering/atmos/storage
|
||||
name = "\improper Atmospherics Storage"
|
||||
icon_state = "atmos_storage"
|
||||
|
||||
engine_airlock
|
||||
name = "\improper Engine Room Airlock"
|
||||
icon_state = "engine"
|
||||
/area/engineering/drone_fabrication
|
||||
name = "\improper Drone Fabrication"
|
||||
icon_state = "drone_fab"
|
||||
|
||||
engine_monitoring
|
||||
name = "\improper Engine Monitoring Room"
|
||||
icon_state = "engine_monitoring"
|
||||
/area/engineering/engine_smes
|
||||
name = "\improper Engineering SMES"
|
||||
icon_state = "engine_smes"
|
||||
|
||||
engine_waste
|
||||
name = "\improper Engine Waste Handling"
|
||||
icon_state = "engine_waste"
|
||||
/area/engineering/engine_room
|
||||
name = "\improper Engine Room"
|
||||
icon_state = "engine"
|
||||
|
||||
engineering_monitoring
|
||||
name = "\improper Engineering Monitoring Room"
|
||||
icon_state = "engine_monitoring"
|
||||
/area/engineering/engine_airlock
|
||||
name = "\improper Engine Room Airlock"
|
||||
icon_state = "engine"
|
||||
|
||||
atmos_monitoring
|
||||
name = "\improper Atmospherics Monitoring Room"
|
||||
icon_state = "engine_monitoring"
|
||||
/area/engineering/engine_monitoring
|
||||
name = "\improper Engine Monitoring Room"
|
||||
icon_state = "engine_monitoring"
|
||||
|
||||
engineering
|
||||
name = "Engineering"
|
||||
icon_state = "engine_smes"
|
||||
/area/engineering/engine_waste
|
||||
name = "\improper Engine Waste Handling"
|
||||
icon_state = "engine_waste"
|
||||
|
||||
engineering_foyer
|
||||
name = "\improper Engineering Foyer"
|
||||
icon_state = "engine"
|
||||
/area/engineering/engineering_monitoring
|
||||
name = "\improper Engineering Monitoring Room"
|
||||
icon_state = "engine_monitoring"
|
||||
|
||||
engineering_supply
|
||||
name = "Engineering Supply"
|
||||
icon_state = "engine_supply"
|
||||
/area/engineering/foyer
|
||||
name = "\improper Engineering Foyer"
|
||||
icon_state = "engineering_foyer"
|
||||
|
||||
break_room
|
||||
name = "\improper Engineering Break Room"
|
||||
icon_state = "engine"
|
||||
/area/engineering/storage
|
||||
name = "\improper Engineering Storage"
|
||||
icon_state = "engineering_storage"
|
||||
|
||||
hallway
|
||||
name = "\improper Engineering Hallway"
|
||||
icon_state = "engine_hallway"
|
||||
/area/engineering/break_room
|
||||
name = "\improper Engineering Break Room"
|
||||
icon_state = "engineering_break"
|
||||
|
||||
engine_hallway
|
||||
name = "\improper Engine Room Hallway"
|
||||
icon_state = "engine_hallway"
|
||||
/area/engineering/engine_eva
|
||||
name = "\improper Engine EVA"
|
||||
icon_state = "engine_eva"
|
||||
|
||||
engine_eva
|
||||
name = "\improper Engine EVA"
|
||||
icon_state = "engine_eva"
|
||||
/area/engineering/locker_room
|
||||
name = "\improper Engineering Locker Room"
|
||||
icon_state = "engineering_locker"
|
||||
|
||||
engine_eva_maintenance
|
||||
name = "\improper Engine EVA Maintenance"
|
||||
icon_state = "engine_eva"
|
||||
/area/engineering/workshop
|
||||
name = "\improper Engineering Workshop"
|
||||
icon_state = "engineering_workshop"
|
||||
|
||||
workshop
|
||||
name = "\improper Engineering Workshop"
|
||||
icon_state = "engine_storage"
|
||||
|
||||
locker_room
|
||||
name = "\improper Engineering Locker Room"
|
||||
icon_state = "engine_storage"
|
||||
|
||||
|
||||
//Solars
|
||||
@@ -2124,7 +2124,6 @@ var/list/the_station_areas = list (
|
||||
/area/shuttle/prison/station,
|
||||
/area/shuttle/administration/station,
|
||||
/area/shuttle/specops/station,
|
||||
/area/atmos,
|
||||
/area/maintenance,
|
||||
/area/hallway,
|
||||
/area/bridge,
|
||||
@@ -2134,7 +2133,7 @@ var/list/the_station_areas = list (
|
||||
/area/library,
|
||||
/area/chapel,
|
||||
/area/lawoffice,
|
||||
/area/engine,
|
||||
/area/engineering,
|
||||
/area/solar,
|
||||
/area/assembly,
|
||||
/area/teleporter,
|
||||
|
||||
+42
-96
@@ -30,37 +30,14 @@
|
||||
power_change() // all machines set to current power level, also updates lighting icon
|
||||
InitializeLighting()
|
||||
|
||||
/area/proc/get_cameras()
|
||||
var/list/cameras = list()
|
||||
for (var/area/RA in related)
|
||||
for (var/obj/machinery/camera/C in RA)
|
||||
cameras += C
|
||||
return cameras
|
||||
|
||||
/area/proc/poweralert(var/state, var/obj/source as obj)
|
||||
if (state != poweralm)
|
||||
poweralm = state
|
||||
if(istype(source)) //Only report power alarms on the z-level where the source is located.
|
||||
var/list/cameras = list()
|
||||
for (var/area/RA in related)
|
||||
for (var/obj/machinery/camera/C in RA)
|
||||
cameras += C
|
||||
if(state == 1)
|
||||
C.network.Remove("Power Alarms")
|
||||
else
|
||||
C.network.Add("Power Alarms")
|
||||
for (var/mob/living/silicon/aiPlayer in player_list)
|
||||
if(aiPlayer.z == source.z)
|
||||
if (state == 1)
|
||||
aiPlayer.cancelAlarm("Power", src, source)
|
||||
else
|
||||
aiPlayer.triggerAlarm("Power", src, cameras, source)
|
||||
for(var/obj/machinery/computer/station_alert/a in machines)
|
||||
if(a.z == source.z)
|
||||
if(state == 1)
|
||||
a.cancelAlarm("Power", src, source)
|
||||
else
|
||||
a.triggerAlarm("Power", src, cameras, source)
|
||||
return
|
||||
|
||||
/area/proc/atmosalert(danger_level, var/set_firelocks=1)
|
||||
// if(type==/area) //No atmos alarms in space
|
||||
// return 0 //redudant
|
||||
|
||||
/area/proc/atmosalert(danger_level, var/alarm_source)
|
||||
//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)
|
||||
@@ -68,32 +45,16 @@
|
||||
danger_level = max(danger_level, AA.danger_level)
|
||||
|
||||
if(danger_level != atmosalm)
|
||||
if (set_firelocks && danger_level < 1 && atmosalm >= 1)
|
||||
if (danger_level < 1 && atmosalm >= 1)
|
||||
//closing the doors on red and opening on green provides a bit of hysteresis that will hopefully prevent fire doors from opening and closing repeatedly due to noise
|
||||
air_doors_open()
|
||||
else if (danger_level >= 2 && atmosalm < 2)
|
||||
air_doors_close()
|
||||
|
||||
if (danger_level < 2 && atmosalm >= 2)
|
||||
for(var/area/RA in related)
|
||||
for(var/obj/machinery/camera/C in RA)
|
||||
C.network.Remove("Atmosphere Alarms")
|
||||
for(var/mob/living/silicon/aiPlayer in player_list)
|
||||
aiPlayer.cancelAlarm("Atmosphere", src, src)
|
||||
for(var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.cancelAlarm("Atmosphere", src, src)
|
||||
|
||||
if (danger_level >= 2 && atmosalm < 2)
|
||||
var/list/cameras = list()
|
||||
for(var/area/RA in related)
|
||||
//updateicon()
|
||||
for(var/obj/machinery/camera/C in RA)
|
||||
cameras += C
|
||||
C.network.Add("Atmosphere Alarms")
|
||||
for(var/mob/living/silicon/aiPlayer in player_list)
|
||||
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
|
||||
for(var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.triggerAlarm("Atmosphere", src, cameras, src)
|
||||
if (set_firelocks)
|
||||
air_doors_close()
|
||||
if (danger_level == 0)
|
||||
atmosphere_alarm.clearAlarm(master, alarm_source)
|
||||
else
|
||||
atmosphere_alarm.triggerAlarm(master, alarm_source, severity = danger_level)
|
||||
|
||||
atmosalm = danger_level
|
||||
for(var/area/RA in related)
|
||||
@@ -107,9 +68,9 @@
|
||||
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(!E:blocked)
|
||||
if(!E.blocked)
|
||||
if(E.operating)
|
||||
E:nextstate = CLOSED
|
||||
E.nextstate = CLOSED
|
||||
else if(!E.density)
|
||||
spawn(0)
|
||||
E.close()
|
||||
@@ -118,21 +79,21 @@
|
||||
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(!E:blocked)
|
||||
if(!E.blocked)
|
||||
if(E.operating)
|
||||
E:nextstate = OPEN
|
||||
E.nextstate = OPEN
|
||||
else if(E.density)
|
||||
spawn(0)
|
||||
E.open()
|
||||
|
||||
|
||||
/area/proc/firealert()
|
||||
if(name == "Space") //no fire alarms in space
|
||||
return
|
||||
if( !fire )
|
||||
fire = 1
|
||||
master.fire = 1 //used for firedoor checks
|
||||
updateicon()
|
||||
/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()
|
||||
mouse_opacity = 0
|
||||
for(var/obj/machinery/door/firedoor/D in all_doors)
|
||||
if(!D.blocked)
|
||||
@@ -141,22 +102,15 @@
|
||||
else if(!D.density)
|
||||
spawn()
|
||||
D.close()
|
||||
var/list/cameras = list()
|
||||
for(var/area/RA in related)
|
||||
for (var/obj/machinery/camera/C in RA)
|
||||
cameras.Add(C)
|
||||
C.network.Add("Fire Alarms")
|
||||
for (var/mob/living/silicon/ai/aiPlayer in player_list)
|
||||
aiPlayer.triggerAlarm("Fire", src, cameras, src)
|
||||
for (var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.triggerAlarm("Fire", src, cameras, src)
|
||||
|
||||
/area/proc/firereset()
|
||||
/area/proc/fire_reset()
|
||||
if (fire)
|
||||
fire = 0
|
||||
master.fire = 0 //used for firedoor checks
|
||||
master.fire = 0 //used for firedoor checks
|
||||
master.updateicon()
|
||||
for(var/area/A in related)
|
||||
A.fire = 0
|
||||
A.updateicon()
|
||||
mouse_opacity = 0
|
||||
updateicon()
|
||||
for(var/obj/machinery/door/firedoor/D in all_doors)
|
||||
if(!D.blocked)
|
||||
if(D.operating)
|
||||
@@ -164,13 +118,6 @@
|
||||
else if(D.density)
|
||||
spawn(0)
|
||||
D.open()
|
||||
for(var/area/RA in related)
|
||||
for (var/obj/machinery/camera/C in RA)
|
||||
C.network.Remove("Fire Alarms")
|
||||
for (var/mob/living/silicon/ai/aiPlayer in player_list)
|
||||
aiPlayer.cancelAlarm("Fire", src, src)
|
||||
for (var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.cancelAlarm("Fire", src, src)
|
||||
|
||||
/area/proc/readyalert()
|
||||
if(!eject)
|
||||
@@ -348,20 +295,19 @@ var/list/mob/living/forced_ambiance_list = new
|
||||
M.make_floating(1)
|
||||
|
||||
/area/proc/thunk(mob)
|
||||
if(istype(mob,/mob/living/carbon/human/)) // Only humans can wear magboots, so we give them a chance to.
|
||||
if((istype(mob:shoes, /obj/item/clothing/shoes/magboots) && (mob:shoes.flags & NOSLIP)))
|
||||
return
|
||||
|
||||
if(istype(get_turf(mob), /turf/space)) // Can't fall onto nothing.
|
||||
return
|
||||
|
||||
if((istype(mob,/mob/living/carbon/human/)) && (mob:m_intent == "run")) // Only clumbsy humans can fall on their asses.
|
||||
mob:AdjustStunned(5)
|
||||
mob:AdjustWeakened(5)
|
||||
if(istype(mob,/mob/living/carbon/human/))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
if(istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.flags & NOSLIP))
|
||||
return
|
||||
|
||||
else if (istype(mob,/mob/living/carbon/human/))
|
||||
mob:AdjustStunned(2)
|
||||
mob:AdjustWeakened(2)
|
||||
|
||||
mob << "Gravity!"
|
||||
if(H.m_intent == "run")
|
||||
H.AdjustStunned(2)
|
||||
H.AdjustWeakened(2)
|
||||
else
|
||||
H.AdjustStunned(1)
|
||||
H.AdjustWeakened(1)
|
||||
mob << "<span class='notice'>The sudden appearance of gravity makes you fall to the floor!</span>"
|
||||
|
||||
|
||||
+1
-3
@@ -202,9 +202,6 @@ its easier to just keep the beam vertical.
|
||||
|
||||
user << "\icon[src] That's [f_name] [suffix]"
|
||||
|
||||
if(desc)
|
||||
user << desc
|
||||
|
||||
return distance == -1 || (get_dist(src, user) <= distance)
|
||||
|
||||
// called by mobs when e.g. having the atom as their machine, pulledby, loc (AKA mob being inside the atom) or buckled var set.
|
||||
@@ -409,6 +406,7 @@ its easier to just keep the beam vertical.
|
||||
|
||||
|
||||
/atom/proc/clean_blood()
|
||||
src.color = initial(src.color) //paint
|
||||
src.germ_level = 0
|
||||
if(istype(blood_DNA, /list))
|
||||
del(blood_DNA)
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
newtraitor << "\red <B>No time like the present.</B> \black It's time to take matters into your own hands..."
|
||||
newtraitor << "<B>You are now a traitor.</B>"
|
||||
newtraitor.mind.special_role = "traitor"
|
||||
newtraitor.hud_updateflag |= 1 << SPECIALROLE_HUD
|
||||
BITSET(newtraitor.hud_updateflag, SPECIALROLE_HUD)
|
||||
newtraitor << "<i>You have been selected this round as an antagonist!</i>"
|
||||
show_objectives(newtraitor.mind)
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
recommended_enemies = 4
|
||||
|
||||
uplink_welcome = "Nar-Sie Uplink Console:"
|
||||
uplink_uses = 10
|
||||
|
||||
var/datum/mind/sacrifice_target = null
|
||||
var/finished = 0
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
// BIOMASS (Note that this code is very similar to Space Vine code)
|
||||
/obj/effect/biomass
|
||||
name = "biomass"
|
||||
desc = "Space barf from another dimension. It just keeps spreading!"
|
||||
icon = 'icons/obj/biomass.dmi'
|
||||
icon_state = "stage1"
|
||||
anchored = 1
|
||||
density = 0
|
||||
layer = 5
|
||||
pass_flags = PASSTABLE | PASSGRILLE
|
||||
var/energy = 0
|
||||
var/obj/effect/biomass_controller/master = null
|
||||
|
||||
New()
|
||||
return
|
||||
|
||||
Del()
|
||||
if(master)
|
||||
master.vines -= src
|
||||
master.growth_queue -= src
|
||||
..()
|
||||
|
||||
/obj/effect/biomass/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (!W || !user || !W.type) return
|
||||
switch(W.type)
|
||||
if(/obj/item/weapon/circular_saw) del src
|
||||
if(/obj/item/weapon/kitchen/utensil/knife) del src
|
||||
if(/obj/item/weapon/scalpel) del src
|
||||
if(/obj/item/weapon/twohanded/fireaxe) del src
|
||||
if(/obj/item/weapon/hatchet) del src
|
||||
if(/obj/item/weapon/melee/energy) del src
|
||||
if(/obj/item/weapon/pickaxe/plasmacutter) del src
|
||||
|
||||
//less effective weapons
|
||||
if(/obj/item/weapon/wirecutters)
|
||||
if(prob(25)) del src
|
||||
if(/obj/item/weapon/shard)
|
||||
if(prob(25)) del src
|
||||
|
||||
else //weapons with subtypes
|
||||
if(istype(W, /obj/item/weapon/melee/energy/sword)) del src
|
||||
else if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user)) del src
|
||||
else
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/effect/biomass_controller
|
||||
var/list/obj/effect/biomass/vines = list()
|
||||
var/list/growth_queue = list()
|
||||
var/reached_collapse_size
|
||||
var/reached_slowdown_size
|
||||
//What this does is that instead of having the grow minimum of 1, required to start growing, the minimum will be 0,
|
||||
//meaning if you get the biomasssss..s' size to something less than 20 plots, it won't grow anymore.
|
||||
|
||||
New()
|
||||
if(!istype(src.loc,/turf/simulated/floor))
|
||||
del(src)
|
||||
|
||||
spawn_biomass_piece(src.loc)
|
||||
processing_objects.Add(src)
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
proc/spawn_biomass_piece(var/turf/location)
|
||||
var/obj/effect/biomass/BM = new(location)
|
||||
growth_queue += BM
|
||||
vines += BM
|
||||
BM.master = src
|
||||
|
||||
process()
|
||||
if(!vines)
|
||||
del(src) //space vines exterminated. Remove the controller
|
||||
return
|
||||
if(!growth_queue)
|
||||
del(src) //Sanity check
|
||||
return
|
||||
if(vines.len >= 250 && !reached_collapse_size)
|
||||
reached_collapse_size = 1
|
||||
if(vines.len >= 30 && !reached_slowdown_size )
|
||||
reached_slowdown_size = 1
|
||||
|
||||
var/maxgrowth = 0
|
||||
if(reached_collapse_size)
|
||||
maxgrowth = 0
|
||||
else if(reached_slowdown_size)
|
||||
if(prob(25))
|
||||
maxgrowth = 1
|
||||
else
|
||||
maxgrowth = 0
|
||||
else
|
||||
maxgrowth = 4
|
||||
var/length = min( 30 , vines.len / 5 )
|
||||
var/i = 0
|
||||
var/growth = 0
|
||||
var/list/obj/effect/biomass/queue_end = list()
|
||||
|
||||
for( var/obj/effect/biomass/BM in growth_queue )
|
||||
i++
|
||||
queue_end += BM
|
||||
growth_queue -= BM
|
||||
if(BM.energy < 2) //If tile isn't fully grown
|
||||
if(prob(20))
|
||||
BM.grow()
|
||||
|
||||
if(BM.spread())
|
||||
growth++
|
||||
if(growth >= maxgrowth)
|
||||
break
|
||||
if(i >= length)
|
||||
break
|
||||
|
||||
growth_queue = growth_queue + queue_end
|
||||
|
||||
/obj/effect/biomass/proc/grow()
|
||||
if(!energy)
|
||||
src.icon_state = "stage2"
|
||||
energy = 1
|
||||
src.opacity = 0
|
||||
src.density = 0
|
||||
layer = 5
|
||||
else
|
||||
src.icon_state = "stage3"
|
||||
src.opacity = 0
|
||||
src.density = 1
|
||||
energy = 2
|
||||
|
||||
/obj/effect/biomass/proc/spread()
|
||||
var/direction = pick(cardinal)
|
||||
var/step = get_step(src,direction)
|
||||
if(istype(step,/turf/simulated/floor))
|
||||
var/turf/simulated/floor/F = step
|
||||
if(!locate(/obj/effect/biomass,F))
|
||||
if(F.Enter(src))
|
||||
if(master)
|
||||
master.spawn_biomass_piece( F )
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/effect/biomass/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(90))
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/effect/biomass/fire_act(null, temp, volume) //hotspots kill biomass
|
||||
del src
|
||||
|
||||
|
||||
/proc/biomass_infestation()
|
||||
|
||||
spawn() //to stop the secrets panel hanging
|
||||
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
|
||||
for(var/areapath in typesof(/area/hallway))
|
||||
var/area/A = locate(areapath)
|
||||
for(var/area/B in A.related)
|
||||
for(var/turf/simulated/floor/F in B.contents)
|
||||
if(!F.contents.len)
|
||||
turfs += F
|
||||
|
||||
if(turfs.len) //Pick a turf to spawn at if we can
|
||||
var/turf/simulated/floor/T = pick(turfs)
|
||||
new/obj/effect/biomass_controller(T) //spawn a controller at turf
|
||||
message_admins("\blue Event: Biomass spawned at [T.loc.loc] ([T.x],[T.y],[T.z])")
|
||||
@@ -1,16 +0,0 @@
|
||||
//Carn: Spacevines random event.
|
||||
/proc/spacevine_infestation()
|
||||
|
||||
spawn() //to stop the secrets panel hanging
|
||||
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
|
||||
for(var/areapath in typesof(/area/hallway))
|
||||
var/area/A = locate(areapath)
|
||||
for(var/area/B in A.related)
|
||||
for(var/turf/simulated/floor/F in B.contents)
|
||||
if(!F.contents.len)
|
||||
turfs += F
|
||||
|
||||
if(turfs.len) //Pick a turf to spawn at if we can
|
||||
var/turf/simulated/floor/T = pick(turfs)
|
||||
new/obj/effect/plant_controller(T) //spawn a controller at turf
|
||||
message_admins("\blue Event: Spacevines spawned at [T.loc] ([T.x],[T.y],[T.z])")
|
||||
@@ -119,7 +119,7 @@
|
||||
operative_notes = "We'd like to remind our operatives to keep it professional. You are not here to have a good time, you are here to accomplish your objectives. These vile communists must be stopped at all costs. You may collaborate with any friends of the Syndicate coalition, but keep an eye on any of those Tiger punks if they do show up. You are completely free to accomplish your objectives any way you see fit."
|
||||
|
||||
uplink_contents = {"Highly Visible and Dangerous Weapons;
|
||||
/obj/item/weapon/gun/projectile:6:Revolver;
|
||||
/obj/item/weapon/gun/projectile/revolver:6:Revolver;
|
||||
/obj/item/ammo_magazine/a357:2:Ammo-357;
|
||||
/obj/item/weapon/gun/energy/crossbow:5:Energy Crossbow;
|
||||
/obj/item/weapon/melee/energy/sword:4:Energy Sword;
|
||||
|
||||
@@ -30,50 +30,80 @@
|
||||
var/newscaster_announcements = null
|
||||
var/ert_disabled = 0
|
||||
var/uplink_welcome = "Illegal Uplink Console:"
|
||||
var/uplink_uses = 10
|
||||
var/uplink_uses = 12
|
||||
var/list/datum/uplink_item/uplink_items = list(
|
||||
"Ammunition" = list(
|
||||
new/datum/uplink_item(/obj/item/ammo_magazine/a357, 2, ".357", "RA"),
|
||||
new/datum/uplink_item(/obj/item/ammo_magazine/mc9mm, 2, "9mm", "R9"),
|
||||
new/datum/uplink_item(/obj/item/ammo_magazine/chemdart, 2, "Darts", "AD"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/sniperammo, 3, "14.5mm", "RA")
|
||||
),
|
||||
"Highly Visible and Dangerous Weapons" = list(
|
||||
new/datum/uplink_item(/obj/item/weapon/gun/projectile, 6, "Revolver", "RE"),
|
||||
new/datum/uplink_item(/obj/item/ammo_magazine/a357, 2, "Ammo-357", "RA"),
|
||||
new/datum/uplink_item(/obj/item/weapon/gun/energy/crossbow, 5, "Energy Crossbow", "XB"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/emps, 3, "5 EMP Grenades", "EM"),
|
||||
new/datum/uplink_item(/obj/item/weapon/melee/energy/sword, 4, "Energy Sword", "ES"),
|
||||
new/datum/uplink_item(/obj/item/weapon/gun/projectile/dartgun, 5, "Dart Gun", "DG"),
|
||||
new/datum/uplink_item(/obj/item/weapon/gun/energy/crossbow, 5, "Energy Crossbow", "XB"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/g9mm, 5, "Silenced 9mm", "S9"),
|
||||
new/datum/uplink_item(/obj/item/mecha_parts/mecha_equipment/weapon/energy/riggedlaser, 6, "Exosuit Rigged Laser", "RL"),
|
||||
new/datum/uplink_item(/obj/item/weapon/gun/projectile/revolver, 6, "Revolver", "RE"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndicate, 10, "Mercenary Bundle", "BU"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/emps, 3, "5 EMP Grenades", "EM")
|
||||
new/datum/uplink_item(/obj/item/weapon/gun/projectile/heavysniper, 12, "PTRS Rifle", "BU")
|
||||
),
|
||||
"Stealthy and Inconspicuous Weapons" = list(
|
||||
new/datum/uplink_item(/obj/item/weapon/pen/paralysis, 3, "Paralysis Pen", "PP"),
|
||||
new/datum/uplink_item(/obj/item/weapon/soap/syndie, 1, "Subversive Soap", "SP"),
|
||||
new/datum/uplink_item(/obj/item/weapon/cartridge/syndicate, 3, "Detomatix PDA Cartridge", "DC")
|
||||
new/datum/uplink_item(/obj/item/weapon/cane/concealed, 2, "Concealed Cane Sword", "CC"),
|
||||
new/datum/uplink_item(/obj/item/weapon/cartridge/syndicate, 3, "Detomatix PDA Cartridge", "DC"),
|
||||
new/datum/uplink_item(/obj/item/weapon/pen/paralysis, 3, "Paralysis Pen", "PP"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/cigarette, 4, "Cigarette Kit", "BH"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/toxin, 4, "Random Toxin - Beaker", "RT")
|
||||
),
|
||||
"Stealth and Camouflage Items" = list(
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"),
|
||||
new/datum/uplink_item(/obj/item/clothing/shoes/syndigaloshes, 2, "No-Slip Shoes", "SH"),
|
||||
new/datum/uplink_item(/obj/item/weapon/card/id/syndicate, 2, "Agent ID card", "AC"),
|
||||
new/datum/uplink_item(/obj/item/clothing/shoes/syndigaloshes, 2, "No-Slip Shoes", "SH"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/spy, 2, "Bug Kit", "BK"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"),
|
||||
new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP"),
|
||||
new/datum/uplink_item(/obj/item/clothing/mask/gas/voice, 4, "Voice Changer", "VC"),
|
||||
new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP")
|
||||
new/datum/uplink_item(/obj/item/weapon/disk/file/cameras/syndicate, 6, "Camera Network Access - Floppy", "SF")
|
||||
),
|
||||
"Devices and Tools" = list(
|
||||
new/datum/uplink_item(/obj/item/weapon/card/emag, 3, "Cryptographic Sequencer", "EC"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/toolbox/syndicate, 1, "Fully Loaded Toolbox", "ST"),
|
||||
new/datum/uplink_item(/obj/item/weapon/plastique, 2, "C-4 (Destroys walls)", "C4"),
|
||||
new/datum/uplink_item(/obj/item/device/encryptionkey/syndicate, 2, "Encrypted Radio Channel Key", "ER"),
|
||||
new/datum/uplink_item(/obj/item/device/encryptionkey/binary, 3, "Binary Translator Key", "BT"),
|
||||
new/datum/uplink_item(/obj/item/weapon/card/emag, 3, "Cryptographic Sequencer", "EC"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/clerical, 3, "Morphic Clerical Kit", "CK"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/space, 3, "Space Suit", "SS"),
|
||||
new/datum/uplink_item(/obj/item/clothing/glasses/thermal/syndi, 3, "Thermal Imaging Glasses", "TM"),
|
||||
new/datum/uplink_item(/obj/item/device/encryptionkey/binary, 3, "Binary Translator Key", "BT"),
|
||||
new/datum/uplink_item(/obj/item/clothing/suit/storage/vest/heavy/merc, 4, "Heavy Armor Vest", "HAV"),
|
||||
new/datum/uplink_item(/obj/item/weapon/aiModule/syndicate, 7, "Hacked AI Upload Module", "AI"),
|
||||
new/datum/uplink_item(/obj/item/weapon/plastique, 2, "C-4 (Destroys walls)", "C4"),
|
||||
new/datum/uplink_item(/obj/item/device/powersink, 5, "Powersink (DANGER!)", "PS",),
|
||||
new/datum/uplink_item(/obj/item/device/radio/beacon/syndicate, 7, "Singularity Beacon (DANGER!)", "SB"),
|
||||
new/datum/uplink_item(/obj/item/weapon/circuitboard/teleporter, 20, "Teleporter Circuit Board", "TP")
|
||||
),
|
||||
"Implants" = list(
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_freedom, 3, "Freedom Implant", "FI"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_uplink, 10, "Uplink Implant (Contains 5 Telecrystals)", "UI"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_compress, 4, "Compressed Matter Implant", "CI"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_explosive, 6, "Explosive Implant (DANGER!)", "EI"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_compress, 4, "Compressed Matter Implant", "CI")
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_uplink, 10, "Uplink Implant (Contains 5 Telecrystals)", "UI")
|
||||
),
|
||||
"Medical" = list(
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/donkpockets, 1, "Box of Sin-Pockets", "DP"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/firstaid/surgery, 5, "Surgery kit", "SK"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/firstaid/combat, 5, "Combat medical kit", "CM")
|
||||
),
|
||||
"Hardsuit Modules" = list(
|
||||
new/datum/uplink_item(/obj/item/rig_module/vision/thermal, 2, "Thermal Scanner", "RTS"),
|
||||
new/datum/uplink_item(/obj/item/rig_module/fabricator/energy_net, 3, "Net Projector", "REN"),
|
||||
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/ewar_voice, 4, "Electrowarfare Suite and Voice Synthesiser", "REV"),
|
||||
new/datum/uplink_item(/obj/item/rig_module/maneuvering_jets, 4, "Maneuvering Jets", "RMJ"),
|
||||
new/datum/uplink_item(/obj/item/rig_module/mounted/egun, 6, "Mounted Energy Gun", "REG"),
|
||||
new/datum/uplink_item(/obj/item/rig_module/power_sink, 6, "Power Sink", "RPS"),
|
||||
new/datum/uplink_item(/obj/item/rig_module/mounted, 8, "Mounted Laser Cannon", "RLC")
|
||||
),
|
||||
"(Pointless) Badassery" = list(
|
||||
new/datum/uplink_item(/obj/item/toy/syndicateballoon, 10, "For showing that You Are The BOSS (Useless Balloon)", "BS")
|
||||
new/datum/uplink_item(/obj/item/toy/syndicateballoon, 10, "For showing that You Are The BOSS (Useless Balloon)", "BS"),
|
||||
new/datum/uplink_item(/obj/item/toy/nanotrasenballoon, 10, "For showing that you love NT SOO much (Useless Balloon)", "NT")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -240,16 +270,6 @@
|
||||
special_role == "Head Revolutionary" && prob(30))
|
||||
suspects += man
|
||||
|
||||
// If they're a traitor or likewise, give them extra TC in exchange.
|
||||
var/obj/item/device/uplink/hidden/suplink = man.mind.find_syndicate_uplink()
|
||||
if(suplink)
|
||||
var/extra = 4
|
||||
suplink.uses += extra
|
||||
man << "\red We have received notice that enemy intelligence suspects you to be linked with us. We have thus invested significant resources to increase your uplink's capacity."
|
||||
else
|
||||
// Give them a warning!
|
||||
man << "\red They are on to you!"
|
||||
|
||||
// Some poor people who were just in the wrong place at the wrong time..
|
||||
else if(prob(10))
|
||||
suspects += man
|
||||
|
||||
@@ -185,7 +185,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
cinematic.mouse_opacity = 0
|
||||
cinematic.screen_loc = "1,0"
|
||||
|
||||
var/obj/structure/stool/bed/temp_buckle = new(src)
|
||||
var/obj/structure/bed/temp_buckle = new(src)
|
||||
//Incredibly hackish. It creates a bed within the gameticker (lol) to stop mobs running around
|
||||
if(station_missed)
|
||||
for(var/mob/living/M in living_mob_list)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
recommended_enemies = 1
|
||||
|
||||
uplink_welcome = "Crazy AI Uplink Console:"
|
||||
uplink_uses = 10
|
||||
|
||||
var/const/waittime_l = 600
|
||||
var/const/waittime_h = 1800 // started at 1800
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
votable = 0
|
||||
|
||||
uplink_welcome = "EVIL METEOR Uplink Console:"
|
||||
uplink_uses = 10
|
||||
|
||||
|
||||
/datum/game_mode/meteor/announce()
|
||||
|
||||
@@ -85,6 +85,9 @@
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/hits = 1
|
||||
var/detonation_chance = 15
|
||||
var/power = 4
|
||||
var/power_step = 1
|
||||
var/dest
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
@@ -92,6 +95,7 @@
|
||||
name = "small meteor"
|
||||
icon_state = "smallf"
|
||||
pass_flags = PASSTABLE | PASSGRILLE
|
||||
power = 2
|
||||
|
||||
/obj/effect/meteor/Bump(atom/A)
|
||||
spawn(0)
|
||||
@@ -105,8 +109,8 @@
|
||||
//Changing emitter and generator ex_act would result in them being bomb and C4 proof.
|
||||
if(!istype(A,/obj/machinery/power/emitter) && \
|
||||
!istype(A,/obj/machinery/field_generator) && \
|
||||
prob(15))
|
||||
explosion(src.loc, 4, 5, 6, 7, 0)
|
||||
prob(detonation_chance))
|
||||
explosion(loc, power, power + power_step, power + power_step * 2, power + power_step * 3, 0)
|
||||
del(src)
|
||||
return
|
||||
|
||||
@@ -120,6 +124,7 @@
|
||||
/obj/effect/meteor/big
|
||||
name = "big meteor"
|
||||
hits = 5
|
||||
power = 1
|
||||
|
||||
ex_act(severity)
|
||||
return
|
||||
@@ -143,8 +148,8 @@
|
||||
explosion(src.loc, 0, 1, 2, 3, 0)
|
||||
|
||||
if (--src.hits <= 0)
|
||||
if(prob(15) && !istype(A, /obj/structure/grille))
|
||||
explosion(src.loc, 1, 2, 3, 4, 0)
|
||||
if(prob(detonation_chance) && !istype(A, /obj/structure/grille))
|
||||
explosion(loc, power, power + power_step, power + power_step * 2, power + power_step * 3, 0)
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -27,18 +27,15 @@
|
||||
ninja.special_role = "Ninja"
|
||||
ninja.original = ninja.current
|
||||
|
||||
/*if(ninjastart.len == 0)
|
||||
ninja.current << "<B>\red A proper starting location for you could not be found, please report this bug!</B>"
|
||||
ninja.current << "<B>\red Attempting to place at a carpspawn.</B>"*/
|
||||
if(ninjastart.len == 0)
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "carpspawn")
|
||||
ninjastart.Add(L)
|
||||
|
||||
//Until such a time as people want to place ninja spawn points, carpspawn will do fine.
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "carpspawn")
|
||||
ninjastart.Add(L)
|
||||
if(ninjastart.len == 0 && latejoin.len > 0)
|
||||
ninja.current << "<B>\red No spawneable locations could be found. Defaulting to latejoin.</B>"
|
||||
return 1
|
||||
else if (ninjastart.len == 0)
|
||||
else
|
||||
ninja.current << "<B>\red No spawneable locations could be found. Aborting.</B>"
|
||||
return 0
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
if(rev_mind in revolutionaries)
|
||||
revolutionaries -= rev_mind
|
||||
rev_mind.special_role = null
|
||||
rev_mind.current.hud_updateflag |= 1 << SPECIALROLE_HUD
|
||||
BITSET(rev_mind.current.hud_updateflag, SPECIALROLE_HUD)
|
||||
|
||||
if(beingborged)
|
||||
rev_mind.current << "\red <FONT size = 3><B>The frame's firmware detects and deletes your neural reprogramming! You remember nothing from the moment you were flashed until now.</B></FONT>"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
recommended_enemies = 3
|
||||
|
||||
uplink_welcome = "AntagCorp Uplink Console:"
|
||||
uplink_uses = 5
|
||||
uplink_uses = 7
|
||||
|
||||
newscaster_announcements = /datum/news_announcement/revolution_inciting_event
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
rev_mind.special_role = "Revolutionary"
|
||||
show_objectives(rev_mind)
|
||||
update_rev_icons_added(rev_mind)
|
||||
H.hud_updateflag |= 1 << SPECIALROLE_HUD
|
||||
BITSET(H.hud_updateflag, SPECIALROLE_HUD)
|
||||
return 1
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
|
||||
uplink_welcome = "AntagCorp Portable Teleportation Relay:"
|
||||
uplink_uses = 10
|
||||
|
||||
var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds)
|
||||
var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/obj/effect/rend
|
||||
name = "Tear in the fabric of reality"
|
||||
desc = "You should run now"
|
||||
icon = 'icons/obj/biomass.dmi'
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "rift"
|
||||
density = 1
|
||||
unacidable = 1
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if("revolver")
|
||||
new /obj/item/weapon/gun/projectile(get_turf(H))
|
||||
if("detective")
|
||||
new /obj/item/weapon/gun/projectile/detective(get_turf(H))
|
||||
new /obj/item/weapon/gun/projectile/revolver/detective(get_turf(H))
|
||||
if("smg")
|
||||
new /obj/item/weapon/gun/projectile/automatic/c20r(get_turf(H))
|
||||
if("nuclear")
|
||||
@@ -49,7 +49,7 @@
|
||||
if("combatshotgun")
|
||||
new /obj/item/weapon/gun/projectile/shotgun/pump/combat(get_turf(H))
|
||||
if("mateba")
|
||||
new /obj/item/weapon/gun/projectile/mateba(get_turf(H))
|
||||
new /obj/item/weapon/gun/projectile/revolver/mateba(get_turf(H))
|
||||
if("smg")
|
||||
new /obj/item/weapon/gun/projectile/automatic(get_turf(H))
|
||||
if("uzi")
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
selection_color = "#dddddd"
|
||||
access = list() //See /datum/job/assistant/get_access()
|
||||
minimal_access = list() //See /datum/job/assistant/get_access()
|
||||
alt_titles = list("Technical Assistant","Medical Intern","Research Assistant","Security Cadet")
|
||||
alt_titles = list("Technical Assistant","Medical Intern","Research Assistant","Security Cadet","Visitor")
|
||||
|
||||
/datum/job/assistant/equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
|
||||
@@ -24,7 +24,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
var/obj/item/clothing/under/U = new /obj/item/clothing/under/rank/captain(H)
|
||||
if(H.age>49)
|
||||
U.hastie = new /obj/item/clothing/tie/medal/gold/captain(U)
|
||||
U.accessories += new /obj/item/clothing/accessory/medal/gold/captain(U)
|
||||
H.equip_to_slot_or_del(U, slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/captain(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
|
||||
@@ -110,3 +110,6 @@
|
||||
if(H.r_store)
|
||||
H.r_store.add_fingerprint(H,1)
|
||||
return 1
|
||||
|
||||
/datum/job/proc/is_position_available()
|
||||
return (current_positions < total_positions) || (total_positions == -1)
|
||||
|
||||
@@ -196,3 +196,44 @@
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit)
|
||||
|
||||
|
||||
/datum/job/Paramedic
|
||||
title = "Paramedic"
|
||||
flag = PARAMEDIC
|
||||
department_flag = MEDSCI
|
||||
faction = "Station"
|
||||
total_positions = 2
|
||||
spawn_positions = 2
|
||||
supervisors = "the chief medical officer"
|
||||
selection_color = "#ffeef0"
|
||||
access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_eva, access_maint_tunnels, access_external_airlocks, access_psychiatrist)
|
||||
minimal_access = list(access_medical, access_morgue, access_eva, access_maint_tunnels, access_external_airlocks)
|
||||
alt_titles = list("Emergency Medical Technician")
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(H), slot_l_hand)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
|
||||
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
|
||||
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
if (H.mind.role_alt_title)
|
||||
switch(H.mind.role_alt_title)
|
||||
if("Emergency Medical Technician")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical/fluff/short(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/fr_jacket(H), slot_wear_suit)
|
||||
if("Paramedic")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical/black(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/fr_jacket(H), slot_wear_suit)
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/medical/emt(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_l_store)
|
||||
if(H.backbag == 1)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand)
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack)
|
||||
return 1
|
||||
|
||||
@@ -42,13 +42,13 @@
|
||||
flag = SCIENTIST
|
||||
department_flag = MEDSCI
|
||||
faction = "Station"
|
||||
total_positions = 6
|
||||
total_positions = 5
|
||||
spawn_positions = 3
|
||||
supervisors = "the research director"
|
||||
selection_color = "#ffeeff"
|
||||
access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_xenoarch)
|
||||
minimal_access = list(access_tox, access_tox_storage, access_research, access_xenoarch)
|
||||
alt_titles = list("Xenoarcheologist", "Anomalist", "Phoron Researcher", "Xenobotanist")
|
||||
alt_titles = list("Xenoarcheologist", "Anomalist", "Phoron Researcher")
|
||||
|
||||
minimal_player_age = 14
|
||||
|
||||
@@ -74,12 +74,13 @@
|
||||
flag = XENOBIOLOGIST
|
||||
department_flag = MEDSCI
|
||||
faction = "Station"
|
||||
total_positions = 2
|
||||
total_positions = 3
|
||||
spawn_positions = 2
|
||||
supervisors = "the research director"
|
||||
selection_color = "#ffeeff"
|
||||
access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology)
|
||||
minimal_access = list(access_research, access_xenobiology)
|
||||
alt_titles = list("Xenobotanist")
|
||||
|
||||
minimal_player_age = 14
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
flag = AI
|
||||
department_flag = ENGSEC
|
||||
faction = "Station"
|
||||
total_positions = 0
|
||||
total_positions = 0 // Not used for AI, see is_position_available below and modules/mob/living/silicon/ai/latejoin.dm
|
||||
spawn_positions = 1
|
||||
selection_color = "#ccffcc"
|
||||
supervisors = "your laws"
|
||||
@@ -14,6 +14,8 @@
|
||||
if(!H) return 0
|
||||
return 1
|
||||
|
||||
/datum/job/ai/is_position_available()
|
||||
return (empty_playable_ai_cores.len != 0)
|
||||
|
||||
|
||||
/datum/job/cyborg
|
||||
|
||||
@@ -421,7 +421,7 @@ var/global/datum/controller/occupations/job_master
|
||||
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
|
||||
H.loc = S.loc
|
||||
// Moving wheelchair if they have one
|
||||
if(H.buckled && istype(H.buckled, /obj/structure/stool/bed/chair/wheelchair))
|
||||
if(H.buckled && istype(H.buckled, /obj/structure/bed/chair/wheelchair))
|
||||
H.buckled.loc = H.loc
|
||||
H.buckled.set_dir(H.dir)
|
||||
|
||||
@@ -463,7 +463,9 @@ var/global/datum/controller/occupations/job_master
|
||||
switch(rank)
|
||||
if("Cyborg")
|
||||
return H.Robotize()
|
||||
if("AI","Clown") //don't need bag preference stuff!
|
||||
if("AI")
|
||||
return H
|
||||
if("Clown") //don't need bag preference stuff!
|
||||
else
|
||||
switch(H.backbag) //BS12 EDIT
|
||||
if(1)
|
||||
@@ -514,7 +516,7 @@ var/global/datum/controller/occupations/job_master
|
||||
var/datum/organ/external/l_foot = H.get_organ("l_foot")
|
||||
var/datum/organ/external/r_foot = H.get_organ("r_foot")
|
||||
if((!l_foot || l_foot.status & ORGAN_DESTROYED) && (!r_foot || r_foot.status & ORGAN_DESTROYED))
|
||||
var/obj/structure/stool/bed/chair/wheelchair/W = new /obj/structure/stool/bed/chair/wheelchair(H.loc)
|
||||
var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc)
|
||||
H.buckled = W
|
||||
H.update_canmove()
|
||||
W.set_dir(H.dir)
|
||||
@@ -538,9 +540,9 @@ var/global/datum/controller/occupations/job_master
|
||||
G.prescription = 1
|
||||
// H.update_icons()
|
||||
|
||||
H.hud_updateflag |= (1 << ID_HUD)
|
||||
H.hud_updateflag |= (1 << IMPLOYAL_HUD)
|
||||
H.hud_updateflag |= (1 << SPECIALROLE_HUD)
|
||||
BITSET(H.hud_updateflag, ID_HUD)
|
||||
BITSET(H.hud_updateflag, IMPLOYAL_HUD)
|
||||
BITSET(H.hud_updateflag, SPECIALROLE_HUD)
|
||||
return H
|
||||
|
||||
|
||||
@@ -648,4 +650,4 @@ var/global/datum/controller/occupations/job_master
|
||||
else level4++ //not selected
|
||||
|
||||
tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|YOUNG=[level6]|-"
|
||||
feedback_add_details("job_preferences",tmp_str)
|
||||
feedback_add_details("job_preferences",tmp_str)
|
||||
|
||||
@@ -25,6 +25,7 @@ var/const/VIROLOGIST =(1<<6)
|
||||
var/const/PSYCHIATRIST =(1<<7)
|
||||
var/const/ROBOTICIST =(1<<8)
|
||||
var/const/XENOBIOLOGIST =(1<<9)
|
||||
var/const/PARAMEDIC =(1<<10)
|
||||
|
||||
|
||||
var/const/CIVILIAN =(1<<2)
|
||||
|
||||
+196
-336
@@ -117,19 +117,6 @@
|
||||
|
||||
first_run()
|
||||
|
||||
/obj/machinery/alarm/Del()
|
||||
//If there's an active alarm, clear it after minute so that alarms don't keep going forver
|
||||
delayed_reset()
|
||||
..()
|
||||
|
||||
//needed to cancel the alarm after it is deleted
|
||||
/obj/machinery/alarm/proc/delayed_reset()
|
||||
var/area/A = alarm_area
|
||||
src = null
|
||||
spawn(600)
|
||||
//It makes sense not to touch firelocks here. The alarm itself is gone, we have no idea what the atmos is like.
|
||||
A.atmosalert(0, set_firelocks=0)
|
||||
|
||||
/obj/machinery/alarm/proc/first_run()
|
||||
alarm_area = get_area(src)
|
||||
if (alarm_area.master)
|
||||
@@ -195,7 +182,6 @@
|
||||
if(RCON_YES)
|
||||
remote_control = 1
|
||||
|
||||
updateDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/alarm/proc/handle_heating_cooling(var/datum/gas_mixture/environment)
|
||||
@@ -442,7 +428,7 @@
|
||||
send_signal(device_id, list("power"= 0) )
|
||||
|
||||
/obj/machinery/alarm/proc/apply_danger_level(var/new_danger_level)
|
||||
if (report_danger_level && alarm_area.atmosalert(new_danger_level))
|
||||
if (report_danger_level && alarm_area.atmosalert(new_danger_level, src))
|
||||
post_alert(new_danger_level)
|
||||
|
||||
update_icon()
|
||||
@@ -468,7 +454,7 @@
|
||||
frequency.post_signal(src, alert_signal)
|
||||
|
||||
/obj/machinery/alarm/attack_ai(mob/user)
|
||||
return interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/alarm/attack_hand(mob/user)
|
||||
. = ..()
|
||||
@@ -477,311 +463,179 @@
|
||||
return interact(user)
|
||||
|
||||
/obj/machinery/alarm/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
ui_interact(user)
|
||||
wires.Interact(user)
|
||||
|
||||
if(buildstage!=2)
|
||||
return
|
||||
/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/custom_state = null)
|
||||
var/data[0]
|
||||
var/remote_connection = 0
|
||||
var/remote_access = 0
|
||||
if(custom_state)
|
||||
var/list/state = custom_state.href_list(user)
|
||||
remote_connection = state["remote_connection"] // Remote connection means we're non-adjacent/connecting from another computer
|
||||
remote_access = state["remote_access"] // Remote access means we also have the privilege to alter the air alarm.
|
||||
|
||||
if((get_dist(src, user) > 1 ))
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=air_alarm")
|
||||
user << browse(null, "window=AAlarmwires")
|
||||
return
|
||||
data["locked"] = locked && !user.isSilicon()
|
||||
data["remote_connection"] = remote_connection
|
||||
data["remote_access"] = remote_access
|
||||
data["rcon"] = rcon_setting
|
||||
data["screen"] = screen
|
||||
|
||||
populate_status(data)
|
||||
|
||||
else if (istype(user, /mob/living/silicon) && aidisabled)
|
||||
user << "AI control for this Air Alarm interface has been disabled."
|
||||
user << browse(null, "window=air_alarm")
|
||||
return
|
||||
if(!(locked && !remote_connection) || remote_access || user.isSilicon())
|
||||
populate_controls(data)
|
||||
|
||||
if(wiresexposed && (!istype(user, /mob/living/silicon/ai)))
|
||||
wires.Interact(user)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "air_alarm.tmpl", src.name, 625, 625, master_ui = master_ui, custom_state = custom_state)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
if(!shorted)
|
||||
user << browse(return_text(user),"window=air_alarm")
|
||||
onclose(user, "air_alarm")
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/alarm/proc/return_text(mob/user)
|
||||
if(!(istype(user, /mob/living/silicon)) && locked)
|
||||
return "<html><head><title>\The [src]</title></head><body>[return_status()]<hr>[rcon_text()]<hr><i>(Swipe ID card to unlock interface)</i></body></html>"
|
||||
else
|
||||
return "<html><head><title>\The [src]</title></head><body>[return_status()]<hr>[rcon_text()]<hr>[return_controls()]</body></html>"
|
||||
|
||||
/obj/machinery/alarm/proc/return_status()
|
||||
/obj/machinery/alarm/proc/populate_status(var/data)
|
||||
var/turf/location = get_turf(src)
|
||||
var/datum/gas_mixture/environment = location.return_air()
|
||||
var/total = environment.total_moles
|
||||
var/output = "<b>Air Status:</b><br>"
|
||||
|
||||
if(total == 0)
|
||||
output += "<font color='red'><b>Warning: Cannot obtain air sample for analysis.</b></font>"
|
||||
return output
|
||||
var/list/environment_data = new
|
||||
data["has_environment"] = total
|
||||
if(total)
|
||||
var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume
|
||||
|
||||
output += {"
|
||||
<style>
|
||||
.dl0 { color: green; }
|
||||
.dl1 { color: orange; }
|
||||
.dl2 { color: red; font-weght: bold;}
|
||||
</style>
|
||||
"}
|
||||
var/list/current_settings = TLV["pressure"]
|
||||
var/pressure = environment.return_pressure()
|
||||
var/pressure_danger = get_danger_level(pressure, current_settings)
|
||||
environment_data[++environment_data.len] = list("name" = "Pressure", "value" = pressure, "unit" = "kPa", "danger_level" = pressure_danger)
|
||||
data["total_danger"] = pressure_danger
|
||||
|
||||
var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume
|
||||
current_settings = TLV["oxygen"]
|
||||
var/oxygen_danger = get_danger_level(environment.gas["oxygen"]*partial_pressure, current_settings)
|
||||
environment_data[++environment_data.len] = list("name" = "Oxygen", "value" = environment.gas["oxygen"] / total * 100, "unit" = "%", "danger_level" = oxygen_danger)
|
||||
data["total_danger"] = max(oxygen_danger, data["total_danger"])
|
||||
|
||||
var/list/current_settings = TLV["pressure"]
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
var/pressure_dangerlevel = get_danger_level(environment_pressure, current_settings)
|
||||
current_settings = TLV["carbon dioxide"]
|
||||
var/carbon_dioxide_danger = get_danger_level(environment.gas["carbon dioxide"]*partial_pressure, current_settings)
|
||||
environment_data[++environment_data.len] = list("name" = "Carbon dioxide", "value" = environment.gas["carbon dioxide"] / total * 100, "unit" = "%", "danger_level" = carbon_dioxide_danger)
|
||||
data["total_danger"] = max(carbon_dioxide_danger, data["total_danger"])
|
||||
|
||||
current_settings = TLV["oxygen"]
|
||||
var/oxygen_dangerlevel = get_danger_level(environment.gas["oxygen"]*partial_pressure, current_settings)
|
||||
var/oxygen_percent = round(environment.gas["oxygen"] / total * 100, 2)
|
||||
current_settings = TLV["phoron"]
|
||||
var/phoron_danger = get_danger_level(environment.gas["phoron"]*partial_pressure, current_settings)
|
||||
environment_data[++environment_data.len] = list("name" = "Toxins", "value" = environment.gas["phoron"] / total * 100, "unit" = "%", "danger_level" = phoron_danger)
|
||||
data["total_danger"] = max(phoron_danger, data["total_danger"])
|
||||
|
||||
current_settings = TLV["carbon dioxide"]
|
||||
var/co2_dangerlevel = get_danger_level(environment.gas["carbon_dioxide"]*partial_pressure, current_settings)
|
||||
var/co2_percent = round(environment.gas["carbon_dioxide"] / total * 100, 2)
|
||||
current_settings = TLV["temperature"]
|
||||
var/temperature_danger = get_danger_level(environment.temperature, current_settings)
|
||||
environment_data[++environment_data.len] = list("name" = "Temperature", "value" = environment.temperature, "unit" = "K ([round(environment.temperature - T0C, 0.1)]C)", "danger_level" = temperature_danger)
|
||||
data["total_danger"] = max(temperature_danger, data["total_danger"])
|
||||
|
||||
current_settings = TLV["phoron"]
|
||||
var/phoron_dangerlevel = get_danger_level(environment.gas["phoron"]*partial_pressure, current_settings)
|
||||
var/phoron_percent = round(environment.gas["phoron"] / total * 100, 2)
|
||||
|
||||
//current_settings = TLV["other"]
|
||||
//var/other_moles = 0.0
|
||||
//for(var/datum/gas/G in environment.trace_gases)
|
||||
// other_moles+=G.moles
|
||||
//var/other_dangerlevel = get_danger_level(other_moles*partial_pressure, current_settings)
|
||||
|
||||
current_settings = TLV["temperature"]
|
||||
var/temperature_dangerlevel = get_danger_level(environment.temperature, current_settings)
|
||||
|
||||
output += {"
|
||||
Pressure: <span class='dl[pressure_dangerlevel]'>[environment_pressure]</span>kPa<br>
|
||||
Oxygen: <span class='dl[oxygen_dangerlevel]'>[oxygen_percent]</span>%<br>
|
||||
Carbon dioxide: <span class='dl[co2_dangerlevel]'>[co2_percent]</span>%<br>
|
||||
Toxins: <span class='dl[phoron_dangerlevel]'>[phoron_percent]</span>%<br>
|
||||
"}
|
||||
//if (other_dangerlevel==2)
|
||||
// output += "Notice: <span class='dl2'>High Concentration of Unknown Particles Detected</span><br>"
|
||||
//else if (other_dangerlevel==1)
|
||||
// output += "Notice: <span class='dl1'>Low Concentration of Unknown Particles Detected</span><br>"
|
||||
|
||||
output += "Temperature: <span class='dl[temperature_dangerlevel]'>[environment.temperature]</span>K ([round(environment.temperature - T0C, 0.1)]C)<br>"
|
||||
|
||||
//'Local Status' should report the LOCAL status, damnit.
|
||||
output += "Local Status: "
|
||||
switch(max(pressure_dangerlevel,oxygen_dangerlevel,co2_dangerlevel,phoron_dangerlevel,other_dangerlevel,temperature_dangerlevel))
|
||||
if(2)
|
||||
output += "<span class='dl2'>DANGER: Internals Required</span><br>"
|
||||
if(1)
|
||||
output += "<span class='dl1'>Caution</span><br>"
|
||||
if(0)
|
||||
output += "<span class='dl0'>Optimal</span><br>"
|
||||
|
||||
output += "Area Status: "
|
||||
if(alarm_area.atmosalm)
|
||||
output += "<span class='dl1'>Atmos alert in area</span>"
|
||||
else if (alarm_area.fire)
|
||||
output += "<span class='dl1'>Fire alarm in area</span>"
|
||||
else
|
||||
output += "No alerts"
|
||||
|
||||
return output
|
||||
|
||||
/obj/machinery/alarm/proc/rcon_text()
|
||||
var/dat = "<table width=\"100%\"><td align=\"center\"><b>Remote Control:</b><br>"
|
||||
if(rcon_setting == RCON_NO)
|
||||
dat += "<b>Off</b>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];rcon=[RCON_NO]'>Off</a>"
|
||||
dat += " | "
|
||||
if(rcon_setting == RCON_AUTO)
|
||||
dat += "<b>Auto</b>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];rcon=[RCON_AUTO]'>Auto</a>"
|
||||
dat += " | "
|
||||
if(rcon_setting == RCON_YES)
|
||||
dat += "<b>On</b>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];rcon=[RCON_YES]'>On</a></td>"
|
||||
|
||||
//Hackish, I know. I didn't feel like bothering to rework all of this.
|
||||
dat += "<td align=\"center\"><b>Thermostat:</b><br><a href='?src=\ref[src];temperature=1'>[target_temperature - T0C]C</a></td></table>"
|
||||
|
||||
return dat
|
||||
|
||||
/obj/machinery/alarm/proc/return_controls(var/source = src)
|
||||
var/output = ""//"<B>[alarm_zone] Air [name]</B><HR>"
|
||||
data["environment"] = environment_data
|
||||
data["atmos_alarm"] = alarm_area.atmosalm
|
||||
data["fire_alarm"] = alarm_area.fire != null
|
||||
data["target_temperature"] = "[target_temperature - T0C]C"
|
||||
|
||||
/obj/machinery/alarm/proc/populate_controls(var/list/data)
|
||||
switch(screen)
|
||||
if (AALARM_SCREEN_MAIN)
|
||||
if(alarm_area.atmosalm)
|
||||
output += "<a href='?src=\ref[source];atmos_reset=1'>Reset - Area Atmospheric Alarm</a><hr>"
|
||||
else
|
||||
output += "<a href='?src=\ref[source];atmos_alarm=1'>Activate - Area Atmospheric Alarm</a><hr>"
|
||||
if(AALARM_SCREEN_MAIN)
|
||||
data["mode"] = mode
|
||||
if(AALARM_SCREEN_VENT)
|
||||
var/vents[0]
|
||||
for(var/id_tag in alarm_area.air_vent_names)
|
||||
var/long_name = alarm_area.air_vent_names[id_tag]
|
||||
var/list/info = alarm_area.air_vent_info[id_tag]
|
||||
if(!info)
|
||||
continue
|
||||
vents[++vents.len] = list(
|
||||
"id_tag" = id_tag,
|
||||
"long_name" = sanitize(long_name),
|
||||
"power" = info["power"],
|
||||
"checks" = info["checks"],
|
||||
"direction" = info["direction"],
|
||||
"external" = info["external"]
|
||||
)
|
||||
data["vents"] = vents
|
||||
if(AALARM_SCREEN_SCRUB)
|
||||
var/scrubbers[0]
|
||||
for(var/id_tag in alarm_area.air_scrub_names)
|
||||
var/long_name = alarm_area.air_scrub_names[id_tag]
|
||||
var/list/info = alarm_area.air_scrub_info[id_tag]
|
||||
if(!info)
|
||||
continue
|
||||
scrubbers[++scrubbers.len] = list(
|
||||
"id_tag" = id_tag,
|
||||
"long_name" = sanitize(long_name),
|
||||
"power" = info["power"],
|
||||
"scrubbing" = info["scrubbing"],
|
||||
"panic" = info["panic"],
|
||||
"filters" = list()
|
||||
)
|
||||
scrubbers[scrubbers.len]["filters"] += list(list("name" = "Oxygen", "command" = "o2_scrub", "val" = info["filter_o2"]))
|
||||
scrubbers[scrubbers.len]["filters"] += list(list("name" = "Nitrogen", "command" = "n2_scrub", "val" = info["filter_n2"]))
|
||||
scrubbers[scrubbers.len]["filters"] += list(list("name" = "Carbon Dioxide", "command" = "co2_scrub","val" = info["filter_co2"]))
|
||||
scrubbers[scrubbers.len]["filters"] += list(list("name" = "Toxin" , "command" = "tox_scrub","val" = info["filter_phoron"]))
|
||||
scrubbers[scrubbers.len]["filters"] += list(list("name" = "Nitrous Oxide", "command" = "n2o_scrub","val" = info["filter_n2o"]))
|
||||
data["scrubbers"] = scrubbers
|
||||
if(AALARM_SCREEN_MODE)
|
||||
var/modes[0]
|
||||
modes[++modes.len] = list("name" = "Filtering - Scrubs out contaminants", "mode" = AALARM_MODE_SCRUBBING, "selected" = mode == AALARM_MODE_SCRUBBING, "danger" = 0)
|
||||
modes[++modes.len] = list("name" = "Replace Air - Siphons out air while replacing", "mode" = AALARM_MODE_REPLACEMENT, "selected" = mode == AALARM_MODE_REPLACEMENT, "danger" = 0)
|
||||
modes[++modes.len] = list("name" = "Panic - Siphons air out of the room", "mode" = AALARM_MODE_PANIC, "selected" = mode == AALARM_MODE_PANIC, "danger" = 1)
|
||||
modes[++modes.len] = list("name" = "Cycle - Siphons air before replacing", "mode" = AALARM_MODE_CYCLE, "selected" = mode == AALARM_MODE_CYCLE, "danger" = 1)
|
||||
modes[++modes.len] = list("name" = "Fill - Shuts off scrubbers and opens vents", "mode" = AALARM_MODE_FILL, "selected" = mode == AALARM_MODE_FILL, "danger" = 0)
|
||||
modes[++modes.len] = list("name" = "Off - Shuts off vents and scrubbers", "mode" = AALARM_MODE_OFF, "selected" = mode == AALARM_MODE_OFF, "danger" = 0)
|
||||
data["modes"] = modes
|
||||
data["mode"] = mode
|
||||
if(AALARM_SCREEN_SENSORS)
|
||||
var/list/selected
|
||||
var/thresholds[0]
|
||||
|
||||
output += {"
|
||||
<a href='?src=\ref[source];screen=[AALARM_SCREEN_SCRUB]'>Scrubbers Control</a><br>
|
||||
<a href='?src=\ref[source];screen=[AALARM_SCREEN_VENT]'>Vents Control</a><br>
|
||||
<a href='?src=\ref[source];screen=[AALARM_SCREEN_MODE]'>Set environmentals mode</a><br>
|
||||
<a href='?src=\ref[source];screen=[AALARM_SCREEN_SENSORS]'>Sensor Settings</a><br>
|
||||
<HR>
|
||||
"}
|
||||
if (mode==AALARM_MODE_PANIC)
|
||||
output += "<font color='red'><B>PANIC SYPHON ACTIVE</B></font><br><A href='?src=\ref[source];mode=[AALARM_MODE_SCRUBBING]'>Turn syphoning off</A>"
|
||||
else
|
||||
output += "<A href='?src=\ref[source];mode=[AALARM_MODE_PANIC]'><font color='red'>ACTIVATE PANIC SYPHON IN AREA</font></A>"
|
||||
|
||||
|
||||
if (AALARM_SCREEN_VENT)
|
||||
var/sensor_data = ""
|
||||
if(alarm_area.air_vent_names.len)
|
||||
for(var/id_tag in alarm_area.air_vent_names)
|
||||
var/long_name = alarm_area.air_vent_names[id_tag]
|
||||
var/list/data = alarm_area.air_vent_info[id_tag]
|
||||
if(!data)
|
||||
continue;
|
||||
var/state = ""
|
||||
|
||||
sensor_data += {"
|
||||
<B>[long_name]</B>[state]<BR>
|
||||
<B>Operating:</B>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=power;val=[!data["power"]]'>[data["power"]?"on":"off"]</A>
|
||||
<BR>
|
||||
<B>Pressure checks:</B>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=checks;val=[data["checks"]^1]' [(data["checks"]&1)?"style='font-weight:bold;'":""]>external</A>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=checks;val=[data["checks"]^2]' [(data["checks"]&2)?"style='font-weight:bold;'":""]>internal</A>
|
||||
<BR>
|
||||
<B>External pressure bound:</B>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=adjust_external_pressure;val=-1000'>-</A>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=adjust_external_pressure;val=-100'>-</A>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=adjust_external_pressure;val=-10'>-</A>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=adjust_external_pressure;val=-1'>-</A>
|
||||
[data["external"]]
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=adjust_external_pressure;val=+1'>+</A>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=adjust_external_pressure;val=+10'>+</A>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=adjust_external_pressure;val=+100'>+</A>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=adjust_external_pressure;val=+1000'>+</A>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=set_external_pressure;val=[ONE_ATMOSPHERE]'> (reset) </A>
|
||||
<BR>
|
||||
"}
|
||||
if (data["direction"] == "siphon")
|
||||
sensor_data += {"
|
||||
<B>Direction:</B>
|
||||
siphoning
|
||||
<BR>
|
||||
"}
|
||||
sensor_data += {"<HR>"}
|
||||
else
|
||||
sensor_data = "No vents connected.<BR>"
|
||||
output = {"<a href='?src=\ref[source];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>[sensor_data]"}
|
||||
if (AALARM_SCREEN_SCRUB)
|
||||
var/sensor_data = ""
|
||||
if(alarm_area.air_scrub_names.len)
|
||||
for(var/id_tag in alarm_area.air_scrub_names)
|
||||
var/long_name = alarm_area.air_scrub_names[id_tag]
|
||||
var/list/data = alarm_area.air_scrub_info[id_tag]
|
||||
if(!data)
|
||||
continue;
|
||||
var/state = ""
|
||||
|
||||
sensor_data += {"
|
||||
<B>[long_name]</B>[state]<BR>
|
||||
<B>Operating:</B>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=power;val=[!data["power"]]'>[data["power"]?"on":"off"]</A><BR>
|
||||
<B>Type:</B>
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=scrubbing;val=[!data["scrubbing"]]'>[data["scrubbing"]?"scrubbing":"syphoning"]</A><BR>
|
||||
"}
|
||||
|
||||
if(data["scrubbing"])
|
||||
sensor_data += {"
|
||||
<B>Filtering:</B>
|
||||
Carbon Dioxide
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=co2_scrub;val=[!data["filter_co2"]]'>[data["filter_co2"]?"on":"off"]</A>;
|
||||
Toxins
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=tox_scrub;val=[!data["filter_phoron"]]'>[data["filter_phoron"]?"on":"off"]</A>;
|
||||
Nitrous Oxide
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=n2o_scrub;val=[!data["filter_n2o"]]'>[data["filter_n2o"]?"on":"off"]</A>
|
||||
<BR>
|
||||
"}
|
||||
sensor_data += {"
|
||||
<B>Panic syphon:</B> [data["panic"]?"<font color='red'><B>PANIC SYPHON ACTIVATED</B></font>":""]
|
||||
<A href='?src=\ref[source];id_tag=[id_tag];command=panic_siphon;val=[!data["panic"]]'><font color='[(data["panic"]?"blue'>Dea":"red'>A")]ctivate</font></A><BR>
|
||||
<HR>
|
||||
"}
|
||||
else
|
||||
sensor_data = "No scrubbers connected.<BR>"
|
||||
output = {"<a href='?src=\ref[source];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>[sensor_data]"}
|
||||
|
||||
if (AALARM_SCREEN_MODE)
|
||||
output += "<a href='?src=\ref[source];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br><b>Air machinery mode for the area:</b><ul>"
|
||||
var/list/modes = list(AALARM_MODE_SCRUBBING = "Filtering - Scrubs out contaminants",\
|
||||
AALARM_MODE_REPLACEMENT = "<font color='blue'>Replace Air - Siphons out air while replacing</font>",\
|
||||
AALARM_MODE_PANIC = "<font color='red'>Panic - Siphons air out of the room</font>",\
|
||||
AALARM_MODE_CYCLE = "<font color='red'>Cycle - Siphons air before replacing</font>",\
|
||||
AALARM_MODE_FILL = "<font color='green'>Fill - Shuts off scrubbers and opens vents</font>",\
|
||||
AALARM_MODE_OFF = "<font color='blue'>Off - Shuts off vents and scrubbers</font>",)
|
||||
for (var/m=1,m<=modes.len,m++)
|
||||
if (mode==m)
|
||||
output += "<li><A href='?src=\ref[source];mode=[m]'><b>[modes[m]]</b></A> (selected)</li>"
|
||||
else
|
||||
output += "<li><A href='?src=\ref[source];mode=[m]'>[modes[m]]</A></li>"
|
||||
output += "</ul>"
|
||||
|
||||
if (AALARM_SCREEN_SENSORS)
|
||||
output += {"
|
||||
<a href='?src=\ref[source];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>
|
||||
<b>Alarm thresholds:</b><br>
|
||||
Partial pressure for gases
|
||||
<style>/* some CSS woodoo here. Does not work perfect in ie6 but who cares? */
|
||||
table td { border-left: 1px solid black; border-top: 1px solid black;}
|
||||
table tr:first-child th { border-left: 1px solid black;}
|
||||
table th:first-child { border-top: 1px solid black; font-weight: normal;}
|
||||
table tr:first-child th:first-child { border: none;}
|
||||
.dl0 { color: green; }
|
||||
.dl1 { color: orange; }
|
||||
.dl2 { color: red; font-weght: bold;}
|
||||
</style>
|
||||
<table cellspacing=0>
|
||||
<TR><th></th><th class=dl2>min2</th><th class=dl1>min1</th><th class=dl1>max1</th><th class=dl2>max2</th></TR>
|
||||
"}
|
||||
var/list/gases = list(
|
||||
var/list/gas_names = list(
|
||||
"oxygen" = "O<sub>2</sub>",
|
||||
"carbon dioxide" = "CO<sub>2</sub>",
|
||||
"phoron" = "Toxin",
|
||||
"other" = "Other",)
|
||||
|
||||
var/list/selected
|
||||
for (var/g in gases)
|
||||
output += "<TR><th>[gases[g]]</th>"
|
||||
"other" = "Other")
|
||||
for (var/g in gas_names)
|
||||
thresholds[++thresholds.len] = list("name" = gas_names[g], "settings" = list())
|
||||
selected = TLV[g]
|
||||
for(var/i = 1, i <= 4, i++)
|
||||
output += "<td><A href='?src=\ref[source];command=set_threshold;env=[g];var=[i]'>[selected[i] >= 0 ? selected[i] :"OFF"]</A></td>"
|
||||
output += "</TR>"
|
||||
thresholds[thresholds.len]["settings"] += list(list("env" = g, "val" = i, "selected" = selected[i]))
|
||||
|
||||
selected = TLV["pressure"]
|
||||
output += " <TR><th>Pressure</th>"
|
||||
thresholds[++thresholds.len] = list("name" = "Pressure", "settings" = list())
|
||||
for(var/i = 1, i <= 4, i++)
|
||||
output += "<td><A href='?src=\ref[source];command=set_threshold;env=pressure;var=[i]'>[selected[i] >= 0 ? selected[i] :"OFF"]</A></td>"
|
||||
output += "</TR>"
|
||||
thresholds[thresholds.len]["settings"] += list(list("env" = "pressure", "val" = i, "selected" = selected[i]))
|
||||
|
||||
selected = TLV["temperature"]
|
||||
output += "<TR><th>Temperature</th>"
|
||||
thresholds[++thresholds.len] = list("name" = "Temperature", "settings" = list())
|
||||
for(var/i = 1, i <= 4, i++)
|
||||
output += "<td><A href='?src=\ref[source];command=set_threshold;env=temperature;var=[i]'>[selected[i] >= 0 ? selected[i] :"OFF"]</A></td>"
|
||||
output += "</TR></table>"
|
||||
thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = i, "selected" = selected[i]))
|
||||
|
||||
return output
|
||||
|
||||
/obj/machinery/alarm/Topic(href, href_list, var/nowindow = 0, var/remote = 0)
|
||||
if(..(href, href_list, nowindow, !remote) || !( Adjacent(usr) || nowindow || istype(usr, /mob/living/silicon)) ) // dont forget calling super in machine Topics -walter0o
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=air_alarm")
|
||||
usr << browse(null, "window=AAlarmwires")
|
||||
return
|
||||
data["thresholds"] = thresholds
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
/obj/machinery/alarm/CanUseTopic(var/mob/user, href_list, var/datum/topic_state/custom_state)
|
||||
if(buildstage != 2)
|
||||
return STATUS_CLOSE
|
||||
|
||||
if(aidisabled && user.isAI())
|
||||
user << "<span class='warning'>AI control for \the [src] interface has been disabled.</span>"
|
||||
return STATUS_CLOSE
|
||||
|
||||
. = shorted ? STATUS_DISABLED : STATUS_INTERACTIVE
|
||||
|
||||
if(. == STATUS_INTERACTIVE)
|
||||
var/extra_href = custom_state.href_list(usr)
|
||||
// Prevent remote users from altering RCON settings unless they already have access (I realize the risks)
|
||||
if(href_list["rcon"] && extra_href["remote_connection"] && !extra_href["remote_access"])
|
||||
. = STATUS_UPDATE
|
||||
|
||||
//TODO: Move the rest of if(!locked || extra_href["remote_access"] || usr.isAI()) and hrefs here
|
||||
|
||||
return min(..(), .)
|
||||
|
||||
/obj/machinery/alarm/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/custom_state)
|
||||
if(..(href, href_list, nowindow, custom_state))
|
||||
return 1
|
||||
|
||||
// hrefs that can always be called -walter0o
|
||||
if(href_list["rcon"])
|
||||
@@ -794,29 +648,41 @@ table tr:first-child th:first-child { border: none;}
|
||||
rcon_setting = RCON_AUTO
|
||||
if(RCON_YES)
|
||||
rcon_setting = RCON_YES
|
||||
else
|
||||
return
|
||||
return 1
|
||||
|
||||
if(href_list["temperature"])
|
||||
var/list/selected = TLV["temperature"]
|
||||
var/max_temperature = min(selected[3] - T0C, MAX_TEMPERATURE)
|
||||
var/min_temperature = max(selected[2] - T0C, MIN_TEMPERATURE)
|
||||
var/input_temperature = input("What temperature would you like the system to mantain? (Capped between [min_temperature]C and [max_temperature]C)", "Thermostat Controls") as num|null
|
||||
if(!input_temperature || input_temperature > max_temperature || input_temperature < min_temperature)
|
||||
usr << "Temperature must be between [min_temperature]C and [max_temperature]C"
|
||||
else
|
||||
target_temperature = input_temperature + T0C
|
||||
var/input_temperature = input("What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C) as num|null
|
||||
if(isnum(input_temperature))
|
||||
if(input_temperature > max_temperature || input_temperature < min_temperature)
|
||||
usr << "Temperature must be between [min_temperature]C and [max_temperature]C"
|
||||
else
|
||||
target_temperature = input_temperature + T0C
|
||||
return 1
|
||||
|
||||
// hrefs that need the AA unlocked -walter0o
|
||||
if(!locked || remote || istype(usr, /mob/living/silicon))
|
||||
|
||||
var/extra_href = custom_state.href_list(usr)
|
||||
if(!(locked && !extra_href["remote_connection"]) || extra_href["remote_access"] || usr.isSilicon())
|
||||
if(href_list["command"])
|
||||
var/device_id = href_list["id_tag"]
|
||||
switch(href_list["command"])
|
||||
if("set_external_pressure")
|
||||
var/input_pressure = input("What pressure you like the system to mantain?", "Pressure Controls") as num|null
|
||||
if(isnum(input_pressure))
|
||||
send_signal(device_id, list(href_list["command"] = input_pressure))
|
||||
return 1
|
||||
|
||||
if("reset_external_pressure")
|
||||
send_signal(device_id, list(href_list["command"] = ONE_ATMOSPHERE))
|
||||
return 1
|
||||
|
||||
if( "power",
|
||||
"adjust_external_pressure",
|
||||
"set_external_pressure",
|
||||
"checks",
|
||||
"o2_scrub",
|
||||
"n2_scrub",
|
||||
"co2_scrub",
|
||||
"tox_scrub",
|
||||
"n2o_scrub",
|
||||
@@ -824,6 +690,7 @@ table tr:first-child th:first-child { border: none;}
|
||||
"scrubbing")
|
||||
|
||||
send_signal(device_id, list(href_list["command"] = text2num(href_list["val"]) ) )
|
||||
return 1
|
||||
|
||||
if("set_threshold")
|
||||
var/env = href_list["env"]
|
||||
@@ -832,7 +699,7 @@ table tr:first-child th:first-child { border: none;}
|
||||
var/list/thresholds = list("lower bound", "low warning", "high warning", "upper bound")
|
||||
var/newval = input("Enter [thresholds[threshold]] for [env]", "Alarm triggers", selected[threshold]) as null|num
|
||||
if (isnull(newval))
|
||||
return
|
||||
return 1
|
||||
if (newval<0)
|
||||
selected[threshold] = -1.0
|
||||
else if (env=="temperature" && newval>5000)
|
||||
@@ -874,9 +741,11 @@ table tr:first-child th:first-child { border: none;}
|
||||
selected[3] = selected[4]
|
||||
|
||||
apply_mode()
|
||||
return 1
|
||||
|
||||
if(href_list["screen"])
|
||||
screen = text2num(href_list["screen"])
|
||||
return 1
|
||||
|
||||
if(href_list["atmos_unlock"])
|
||||
switch(href_list["atmos_unlock"])
|
||||
@@ -884,24 +753,24 @@ table tr:first-child th:first-child { border: none;}
|
||||
alarm_area.air_doors_close()
|
||||
if("1")
|
||||
alarm_area.air_doors_open()
|
||||
return 1
|
||||
|
||||
if(href_list["atmos_alarm"])
|
||||
if (alarm_area.atmosalert(2))
|
||||
if (alarm_area.atmosalert(2, src))
|
||||
apply_danger_level(2)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
if(href_list["atmos_reset"])
|
||||
if (alarm_area.atmosalert(0))
|
||||
if (alarm_area.atmosalert(0, src))
|
||||
apply_danger_level(0)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
if(href_list["mode"])
|
||||
mode = text2num(href_list["mode"])
|
||||
apply_mode()
|
||||
|
||||
if(!nowindow)
|
||||
updateUsrDialog()
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
@@ -915,8 +784,13 @@ table tr:first-child th:first-child { border: none;}
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if (wiresexposed && ((istype(W, /obj/item/device/multitool) || istype(W, /obj/item/weapon/wirecutters))))
|
||||
return attack_hand(user)
|
||||
if (wiresexposed && istype(W, /obj/item/weapon/wirecutters))
|
||||
user.visible_message("<span class='warning'>[user] has cut the wires inside \the [src]!</span>", "You have cut the wires inside \the [src].")
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
new/obj/item/stack/cable_coil(get_turf(src), 5)
|
||||
buildstage = 1
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))// trying to unlock the interface with an ID card
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
@@ -926,7 +800,6 @@ table tr:first-child th:first-child { border: none;}
|
||||
if(allowed(usr) && !wires.IsIndexCut(AALARM_WIRE_IDSCAN))
|
||||
locked = !locked
|
||||
user << "\blue You [ locked ? "lock" : "unlock"] the Air Alarm interface."
|
||||
updateUsrDialog()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
@@ -1061,7 +934,6 @@ FIRE ALARM
|
||||
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
|
||||
|
||||
/obj/machinery/firealarm/update_icon()
|
||||
|
||||
if(wiresexposed)
|
||||
switch(buildstage)
|
||||
if(2)
|
||||
@@ -1095,7 +967,8 @@ FIRE ALARM
|
||||
return src.alarm()
|
||||
|
||||
/obj/machinery/firealarm/emp_act(severity)
|
||||
if(prob(50/severity)) alarm()
|
||||
if(prob(50/severity))
|
||||
alarm(rand(30/severity, 60/severity))
|
||||
..()
|
||||
|
||||
/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
|
||||
@@ -1194,6 +1067,7 @@ FIRE ALARM
|
||||
var/d2
|
||||
if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon))
|
||||
A = A.loc
|
||||
A = A.master
|
||||
|
||||
if (A.fire)
|
||||
d1 = text("<A href='?src=\ref[];reset=1'>Reset - Lockdown</A>", src)
|
||||
@@ -1259,26 +1133,26 @@ FIRE ALARM
|
||||
/obj/machinery/firealarm/proc/reset()
|
||||
if (!( src.working ))
|
||||
return
|
||||
var/area/A = src.loc
|
||||
A = A.loc
|
||||
if (!( istype(A, /area) ))
|
||||
return
|
||||
A.firereset()
|
||||
var/area/area = get_area(src)
|
||||
for(var/area/A in area.related)
|
||||
for(var/obj/machinery/firealarm/FA in A)
|
||||
fire_alarm.clearAlarm(loc, FA)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/firealarm/proc/alarm()
|
||||
if (!( src.working ))
|
||||
/obj/machinery/firealarm/proc/alarm(var/duration = 0)
|
||||
if (!( src.working))
|
||||
return
|
||||
var/area/A = src.loc
|
||||
A = A.loc
|
||||
if (!( istype(A, /area) ))
|
||||
return
|
||||
A.firealert()
|
||||
var/area/area = get_area(src)
|
||||
for(var/area/A in area.related)
|
||||
for(var/obj/machinery/firealarm/FA in A)
|
||||
fire_alarm.triggerAlarm(loc, FA, duration)
|
||||
update_icon()
|
||||
//playsound(src.loc, 'sound/ambience/signal.ogg', 75, 0)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/firealarm/New(loc, dir, building)
|
||||
..()
|
||||
|
||||
@@ -1294,20 +1168,6 @@ FIRE ALARM
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
|
||||
|
||||
/obj/machinery/firealarm/Del()
|
||||
//so fire alarms don't keep going forever
|
||||
delayed_reset()
|
||||
..()
|
||||
|
||||
//needed to cancel the alarm after it is deleted
|
||||
/obj/machinery/firealarm/proc/delayed_reset()
|
||||
var/area/A = get_area(src)
|
||||
if (!A) return
|
||||
|
||||
src = null
|
||||
spawn(600)
|
||||
A.firereset()
|
||||
|
||||
/obj/machinery/firealarm/initialize()
|
||||
if(z in config.contact_levels)
|
||||
if(security_level)
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
canister_color = "blue"
|
||||
can_label = 0
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/oxygen/prechilled
|
||||
name = "Canister: \[O2 (Cryo)\]"
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/phoron
|
||||
name = "Canister \[Phoron\]"
|
||||
icon_state = "orange"
|
||||
@@ -221,6 +224,9 @@ update_flag
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
return
|
||||
|
||||
if(Proj.damage)
|
||||
src.health -= round(Proj.damage / 2)
|
||||
healthcheck()
|
||||
@@ -371,6 +377,14 @@ update_flag
|
||||
src.update_icon()
|
||||
return 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/oxygen/prechilled/New()
|
||||
..()
|
||||
|
||||
src.air_contents.adjust_gas("oxygen", MolesForPressure())
|
||||
src.air_contents.temperature = 80
|
||||
src.update_icon()
|
||||
return 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/sleeping_agent/New()
|
||||
..()
|
||||
|
||||
|
||||
@@ -13,14 +13,30 @@
|
||||
var/list/storage_capacity = list("metal" = 0, "glass" = 0)
|
||||
var/show_category = "All"
|
||||
|
||||
var/panel_open = 0
|
||||
var/hacked = 0
|
||||
var/disabled = 0
|
||||
var/shocked = 0
|
||||
var/busy = 0
|
||||
|
||||
var/mat_efficiency = 1
|
||||
var/build_time = 50
|
||||
|
||||
var/datum/wires/autolathe/wires = null
|
||||
|
||||
/obj/machinery/autolathe/New()
|
||||
|
||||
..()
|
||||
wires = new(src)
|
||||
//Create parts for lathe.
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/autolathe/proc/update_recipe_list()
|
||||
if(!machine_recipes)
|
||||
machine_recipes = autolathe_recipes
|
||||
@@ -33,8 +49,8 @@
|
||||
user << "<span class='danger'>\The [src] is disabled!</span>"
|
||||
return
|
||||
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if(shocked)
|
||||
shock(user, 50)
|
||||
|
||||
var/dat = "<center><h1>Autolathe Control Panel</h1><hr/>"
|
||||
|
||||
@@ -65,16 +81,16 @@
|
||||
else
|
||||
//Make sure it's buildable and list requires resources.
|
||||
for(var/material in R.resources)
|
||||
var/sheets = round(stored_material[material]/R.resources[material])
|
||||
var/sheets = round(stored_material[material]/round(R.resources[material]*mat_efficiency))
|
||||
if(isnull(max_sheets) || max_sheets > sheets)
|
||||
max_sheets = sheets
|
||||
if(!isnull(stored_material[material]) && stored_material[material] < R.resources[material])
|
||||
if(!isnull(stored_material[material]) && stored_material[material] < round(R.resources[material]*mat_efficiency))
|
||||
can_make = 0
|
||||
if(!comma)
|
||||
comma = 1
|
||||
else
|
||||
material_string += ", "
|
||||
material_string += "[R.resources[material]] [material]"
|
||||
material_string += "[round(R.resources[material] * mat_efficiency)] [material]"
|
||||
material_string += ".<br></td>"
|
||||
//Build list of multipliers for sheets.
|
||||
if(R.is_stack)
|
||||
@@ -99,31 +115,27 @@
|
||||
|
||||
/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
if (stat)
|
||||
return
|
||||
|
||||
if (busy)
|
||||
if(busy)
|
||||
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/weapon/screwdriver))
|
||||
panel_open = !panel_open
|
||||
icon_state = (panel_open ? "autolathe_t": "autolathe")
|
||||
user << "You [panel_open ? "open" : "close"] the maintenance hatch of [src]."
|
||||
if(default_deconstruction_screwdriver(user, O))
|
||||
updateUsrDialog()
|
||||
return
|
||||
if(default_deconstruction_crowbar(user, O))
|
||||
return
|
||||
if(default_part_replacement(user, O))
|
||||
return
|
||||
|
||||
if (panel_open)
|
||||
if(stat)
|
||||
return
|
||||
|
||||
if(panel_open)
|
||||
//Don't eat multitools or wirecutters used on an open lathe.
|
||||
if(istype(O, /obj/item/device/multitool) || istype(O, /obj/item/weapon/wirecutters))
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
//Dismantle the frame.
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
dismantle()
|
||||
return
|
||||
|
||||
if(O.loc != user && !(istype(O,/obj/item/stack)))
|
||||
return 0
|
||||
|
||||
@@ -170,11 +182,11 @@
|
||||
else
|
||||
user << "You fill \the [src] with \the [eating]."
|
||||
|
||||
flick("autolathe_o",src) // Plays metal insertion animation. Work out a good way to work out a fitting animation. ~Z
|
||||
flick("autolathe_o", src) // Plays metal insertion animation. Work out a good way to work out a fitting animation. ~Z
|
||||
|
||||
if(istype(eating,/obj/item/stack))
|
||||
var/obj/item/stack/stack = eating
|
||||
stack.use(max(1,round(total_used/mass_per_sheet))) // Always use at least 1 to prevent infinite materials.
|
||||
stack.use(max(1, round(total_used/mass_per_sheet))) // Always use at least 1 to prevent infinite materials.
|
||||
else
|
||||
user.drop_item(O)
|
||||
del(O)
|
||||
@@ -227,18 +239,18 @@
|
||||
//Check if we still have the materials.
|
||||
for(var/material in making.resources)
|
||||
if(!isnull(stored_material[material]))
|
||||
if(stored_material[material] < (making.resources[material]*multiplier))
|
||||
if(stored_material[material] < round(making.resources[material] * mat_efficiency) * multiplier)
|
||||
return
|
||||
|
||||
//Consume materials.
|
||||
for(var/material in making.resources)
|
||||
if(!isnull(stored_material[material]))
|
||||
stored_material[material] = max(0,stored_material[material]-(making.resources[material]*multiplier))
|
||||
stored_material[material] = max(0, stored_material[material] - round(making.resources[material] * mat_efficiency) * multiplier)
|
||||
|
||||
//Fancy autolathe animation.
|
||||
flick("autolathe_n",src)
|
||||
flick("autolathe_n", src)
|
||||
|
||||
sleep(50)
|
||||
sleep(build_time)
|
||||
|
||||
busy = 0
|
||||
|
||||
@@ -247,39 +259,31 @@
|
||||
|
||||
//Create the desired item.
|
||||
var/obj/item/I = new making.path(get_step(loc, get_dir(src,usr)))
|
||||
if(multiplier>1 && istype(I,/obj/item/stack))
|
||||
if(multiplier > 1 && istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
S.amount = multiplier
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
/obj/machinery/autolathe/New()
|
||||
|
||||
..()
|
||||
wires = new(src)
|
||||
//Create parts for lathe.
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
RefreshParts()
|
||||
/obj/machinery/autolathe/update_icon()
|
||||
icon_state = (panel_open ? "autolathe_t" : "autolathe")
|
||||
|
||||
//Updates overall lathe storage size.
|
||||
/obj/machinery/autolathe/RefreshParts()
|
||||
..()
|
||||
var/tot_rating = 0
|
||||
var/mb_rating = 0
|
||||
var/man_rating = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/MB in component_parts)
|
||||
tot_rating += MB.rating
|
||||
mb_rating += MB.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
man_rating += M.rating
|
||||
|
||||
storage_capacity["metal"] = tot_rating * 25000
|
||||
storage_capacity["glass"] = tot_rating * 12500
|
||||
storage_capacity["metal"] = mb_rating * 25000
|
||||
storage_capacity["glass"] = mb_rating * 12500
|
||||
build_time = 50 / man_rating
|
||||
mat_efficiency = 1.1 - man_rating * 0.1// Normally, price is 1.25 the amount of material, so this shouldn't go higher than 0.8. Maximum rating of parts is 3
|
||||
|
||||
/obj/machinery/autolathe/dismantle()
|
||||
..()
|
||||
var/list/sheets = list("metal" = /obj/item/stack/sheet/metal, "glass" = /obj/item/stack/sheet/glass)
|
||||
|
||||
for(var/mat in stored_material)
|
||||
@@ -288,3 +292,4 @@
|
||||
if(stored_material[mat] > S.perunit)
|
||||
S.amount = round(stored_material[mat] / S.perunit)
|
||||
S.loc = loc
|
||||
..()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
if(I.matter && !recipe.resources) //This can be overidden in the datums.
|
||||
recipe.resources = list()
|
||||
for(var/material in I.matter)
|
||||
recipe.resources[material] = round(I.matter[material]*1.25) // More expensive to produce than they are to recycle.
|
||||
recipe.resources[material] = I.matter[material]*1.25 // More expensive to produce than they are to recycle.
|
||||
del(I)
|
||||
|
||||
/datum/autolathe/recipe
|
||||
@@ -201,8 +201,13 @@
|
||||
path = /obj/item/weapon/reagent_containers/syringe
|
||||
category = "Medical"
|
||||
|
||||
/datum/autolathe/recipe/syringegun_ammo
|
||||
name = "syringe"
|
||||
path = /obj/item/weapon/syringe_cartridge
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/shotgun_blanks
|
||||
name = "ammunition (shotgun, blanks)"
|
||||
name = "ammunition (shotgun, blank)"
|
||||
path = /obj/item/ammo_casing/shotgun/blank
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
@@ -211,9 +216,24 @@
|
||||
path = /obj/item/ammo_casing/shotgun/beanbag
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/shotgun_flash
|
||||
name = "ammunition (shotgun, flash)"
|
||||
path = /obj/item/ammo_casing/shotgun/flash
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/magazine_rubber
|
||||
name = "ammunition (rubber)"
|
||||
path = /obj/item/ammo_magazine/c45r
|
||||
name = "ammunition (.45, rubber)"
|
||||
path = /obj/item/ammo_magazine/c45m/rubber
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/magazine_flash
|
||||
name = "ammunition (.45, flash)"
|
||||
path = /obj/item/ammo_magazine/c45m/flash
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/magazine_smg_rubber
|
||||
name = "ammunition (9mm rubber top mounted)"
|
||||
path = /obj/item/ammo_magazine/mc9mmt/rubber
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/consolescreen
|
||||
@@ -284,15 +304,51 @@
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/magazine_stetchkin
|
||||
name = "ammunition (9mm)"
|
||||
path = /obj/item/ammo_magazine/mc9mm
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/magazine_stetchkin_flash
|
||||
name = "ammunition (9mm, flash)"
|
||||
path = /obj/item/ammo_magazine/mc9mm/flash
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/magazine_c20r
|
||||
name = "ammunition (12mm)"
|
||||
path = /obj/item/ammo_magazine/a12mm
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/magazine_smg
|
||||
name = "ammunition (9mm top mounted)"
|
||||
path = /obj/item/ammo_magazine/mc9mmt
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/magazine_carbine
|
||||
name = "ammunition (5.56)"
|
||||
path = /obj/item/ammo_magazine/a556
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/shotgun
|
||||
name = "ammunition (shell, shotgun)"
|
||||
name = "ammunition (slug, shotgun)"
|
||||
path = /obj/item/ammo_casing/shotgun
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/shotgun_dart
|
||||
name = "ammunition (dart, shotgun)"
|
||||
path = /obj/item/ammo_casing/shotgun/dart
|
||||
/datum/autolathe/recipe/shotgun_pellet
|
||||
name = "ammunition (shell, shotgun)"
|
||||
path = /obj/item/ammo_casing/shotgun/pellet
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
/datum/autolathe/recipe/stunshell
|
||||
name = "ammunition (stun cartridge, shotgun)"
|
||||
path = /obj/item/ammo_casing/shotgun/stunshell
|
||||
hidden = 1
|
||||
category = "Arms and Ammunition"
|
||||
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
/obj/machinery/biogenerator
|
||||
name = "Biogenerator"
|
||||
desc = ""
|
||||
icon = 'icons/obj/biogenerator.dmi'
|
||||
icon_state = "biogen-stand"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 40
|
||||
var/processing = 0
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/points = 0
|
||||
var/menustat = "menu"
|
||||
var/build_eff = 1
|
||||
var/eat_eff = 1
|
||||
|
||||
/obj/machinery/biogenerator/New()
|
||||
..()
|
||||
var/datum/reagents/R = new/datum/reagents(1000)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
beaker = new /obj/item/weapon/reagent_containers/glass/bottle(src)
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/biogenerator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/biogenerator/on_reagent_change() //When the reagents change, change the icon as well.
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/biogenerator/update_icon()
|
||||
if(!beaker)
|
||||
icon_state = "biogen-empty"
|
||||
else if(!processing)
|
||||
icon_state = "biogen-stand"
|
||||
else
|
||||
icon_state = "biogen-work"
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(default_deconstruction_screwdriver(user, O))
|
||||
return
|
||||
if(default_deconstruction_crowbar(user, O))
|
||||
return
|
||||
if(default_part_replacement(user, O))
|
||||
return
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/glass))
|
||||
if(beaker)
|
||||
user << "<span class='notice'>]The [src] is already loaded.</span>"
|
||||
else
|
||||
user.before_take_item(O)
|
||||
O.loc = src
|
||||
beaker = O
|
||||
updateUsrDialog()
|
||||
else if(processing)
|
||||
user << "<span class='notice'>\The [src] is currently processing.</span>"
|
||||
else if(istype(O, /obj/item/weapon/storage/bag/plants))
|
||||
var/i = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
|
||||
i++
|
||||
if(i >= 10)
|
||||
user << "<span class='notice'>\The [src] is already full! Activate it.</span>"
|
||||
else
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents)
|
||||
G.loc = src
|
||||
i++
|
||||
if(i >= 10)
|
||||
user << "<span class='notice'>You fill \the [src] to its capacity.</span>"
|
||||
break
|
||||
if(i < 10)
|
||||
user << "<span class='notice'>You empty \the [O] into \the [src].</span>"
|
||||
|
||||
else if(!istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
user << "<span class='notice'>You cannot put this in \the [src].</span>"
|
||||
else
|
||||
var/i = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
|
||||
i++
|
||||
if(i >= 10)
|
||||
user << "<span class='notice'>\The [src] is full! Activate it.</span>"
|
||||
else
|
||||
user.before_take_item(O)
|
||||
O.loc = src
|
||||
user << "<span class='notice'>You put \the [O] in \the [src]</span>"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/interact(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = "<TITLE>Biogenerator</TITLE>Biogenerator:<BR>"
|
||||
if (processing)
|
||||
dat += "<FONT COLOR=red>Biogenerator is processing! Please wait...</FONT>"
|
||||
else
|
||||
dat += "Biomass: [points] points.<HR>"
|
||||
switch(menustat)
|
||||
if("menu")
|
||||
if (beaker)
|
||||
dat += "<A href='?src=\ref[src];action=activate'>Activate Biogenerator!</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=detach'>Detach Container</A><BR><BR>"
|
||||
dat += "Food<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=milk;cost=20'>10 milk</A> <FONT COLOR=blue>([round(20/build_eff)])</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=meat;cost=50'>Slab of meat</A> <FONT COLOR=blue>([round(50/build_eff)])</FONT><BR>"
|
||||
dat += "Nutrient<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=ez;cost=10'>E-Z-Nutrient</A> <FONT COLOR=blue>([round(10/build_eff)])</FONT> | <A href='?src=\ref[src];action=create;item=ez5;cost=50'>x5</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=l4z;cost=20'>Left 4 Zed</A> <FONT COLOR=blue>([round(20/build_eff)])</FONT> | <A href='?src=\ref[src];action=create;item=l4z5;cost=100'>x5</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=rh;cost=25'>Robust Harvest</A> <FONT COLOR=blue>([round(25/build_eff)])</FONT> | <A href='?src=\ref[src];action=create;item=rh5;cost=125'>x5</A><BR>"
|
||||
dat += "Leather<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=wallet;cost=100'>Wallet</A> <FONT COLOR=blue>([round(100/build_eff)])</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=gloves;cost=250'>Botanical gloves</A> <FONT COLOR=blue>([round(250/build_eff)])</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=tbelt;cost=300'>Utility belt</A> <FONT COLOR=blue>([round(300/build_eff)])</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=satchel;cost=400'>Leather Satchel</A> <FONT COLOR=blue>([round(400/build_eff)])</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=cashbag;cost=400'>Cash Bag</A> <FONT COLOR=blue>([round(400/build_eff)])</FONT><BR>"
|
||||
//dat += "Other<BR>"
|
||||
//dat += "<A href='?src=\ref[src];action=create;item=monkey;cost=500'>Monkey</A> <FONT COLOR=blue>(500)</FONT><BR>"
|
||||
else
|
||||
dat += "<BR><FONT COLOR=red>No beaker inside. Please insert a beaker.</FONT><BR>"
|
||||
if("nopoints")
|
||||
dat += "You do not have biomass to create products.<BR>Please, put growns into reactor and activate it.<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
if("complete")
|
||||
dat += "Operation complete.<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
if("void")
|
||||
dat += "<FONT COLOR=red>Error: No growns inside.</FONT><BR>Please, put growns into reactor.<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
user << browse(dat, "window=biogenerator")
|
||||
onclose(user, "biogenerator")
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/attack_hand(mob/user as mob)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/biogenerator/proc/activate()
|
||||
if (usr.stat)
|
||||
return
|
||||
if (stat) //NOPOWER etc
|
||||
return
|
||||
if(processing)
|
||||
usr << "<span class='notice'>The biogenerator is in the process of working.</span>"
|
||||
return
|
||||
var/S = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/I in contents)
|
||||
S += 5
|
||||
if(I.reagents.get_reagent_amount("nutriment") < 0.1)
|
||||
points += 1
|
||||
else points += I.reagents.get_reagent_amount("nutriment") * 10 * eat_eff
|
||||
del(I)
|
||||
if(S)
|
||||
processing = 1
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
playsound(src.loc, 'sound/machines/blender.ogg', 50, 1)
|
||||
use_power(S * 30)
|
||||
sleep((S + 15) / eat_eff)
|
||||
processing = 0
|
||||
update_icon()
|
||||
else
|
||||
menustat = "void"
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/proc/create_product(var/item, var/cost)
|
||||
cost = round(cost/build_eff)
|
||||
if(cost > points)
|
||||
menustat = "nopoints"
|
||||
return 0
|
||||
processing = 1
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
points -= cost
|
||||
sleep(30)
|
||||
switch(item)
|
||||
if("milk")
|
||||
beaker.reagents.add_reagent("milk", 10)
|
||||
if("meat")
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/meat(loc)
|
||||
if("ez")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(loc)
|
||||
if("l4z")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(loc)
|
||||
if("rh")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(loc)
|
||||
if("ez5") //It's not an elegant method, but it's safe and easy. -Cheridan
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(loc)
|
||||
if("l4z5")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(loc)
|
||||
if("rh5")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(loc)
|
||||
if("wallet")
|
||||
new/obj/item/weapon/storage/wallet(loc)
|
||||
if("gloves")
|
||||
new/obj/item/clothing/gloves/botanic_leather(loc)
|
||||
if("tbelt")
|
||||
new/obj/item/weapon/storage/belt/utility(loc)
|
||||
if("satchel")
|
||||
new/obj/item/weapon/storage/backpack/satchel(loc)
|
||||
if("cashbag")
|
||||
new/obj/item/weapon/storage/bag/cash(loc)
|
||||
if("monkey")
|
||||
new/mob/living/carbon/monkey(loc)
|
||||
processing = 0
|
||||
menustat = "complete"
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/machinery/biogenerator/Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
switch(href_list["action"])
|
||||
if("activate")
|
||||
activate()
|
||||
if("detach")
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
update_icon()
|
||||
if("create")
|
||||
create_product(href_list["item"], text2num(href_list["cost"]))
|
||||
if("menu")
|
||||
menustat = "menu"
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/biogenerator/RefreshParts()
|
||||
..()
|
||||
var/man_rating = 0
|
||||
var/bin_rating = 0
|
||||
|
||||
for(var/obj/item/weapon/stock_parts/P in component_parts)
|
||||
if(istype(P, /obj/item/weapon/stock_parts/matter_bin))
|
||||
bin_rating += P.rating
|
||||
if(istype(P, /obj/item/weapon/stock_parts/manipulator))
|
||||
man_rating += P.rating
|
||||
|
||||
build_eff = man_rating
|
||||
eat_eff = bin_rating
|
||||
@@ -81,6 +81,8 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/bot/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
return
|
||||
health -= Proj.damage
|
||||
..()
|
||||
healthcheck()
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
var/obj/item/weapon/gun/energy/taser/G = new /obj/item/weapon/gun/energy/taser(Tsec)
|
||||
G.power_supply.charge = 0
|
||||
else if(lasercolor == "b")
|
||||
var/obj/item/weapon/gun/energy/laser/bluetag/G = new /obj/item/weapon/gun/energy/laser/bluetag(Tsec)
|
||||
var/obj/item/weapon/gun/energy/lasertag/blue/G = new (Tsec)
|
||||
G.power_supply.charge = 0
|
||||
else if(lasercolor == "r")
|
||||
var/obj/item/weapon/gun/energy/laser/redtag/G = new /obj/item/weapon/gun/energy/laser/redtag(Tsec)
|
||||
var/obj/item/weapon/gun/energy/lasertag/red/G = new (Tsec)
|
||||
G.power_supply.charge = 0
|
||||
if (prob(50))
|
||||
new /obj/item/robot_parts/l_leg(Tsec)
|
||||
@@ -137,11 +137,11 @@
|
||||
if(7)
|
||||
switch(lasercolor)
|
||||
if("b")
|
||||
if( !istype(W, /obj/item/weapon/gun/energy/laser/bluetag) )
|
||||
if( !istype(W, /obj/item/weapon/gun/energy/lasertag/blue) )
|
||||
return
|
||||
name = "bluetag ED-209 assembly"
|
||||
if("r")
|
||||
if( !istype(W, /obj/item/weapon/gun/energy/laser/redtag) )
|
||||
if( !istype(W, /obj/item/weapon/gun/energy/lasertag/red) )
|
||||
return
|
||||
name = "redtag ED-209 assembly"
|
||||
if("")
|
||||
|
||||
@@ -281,9 +281,6 @@
|
||||
src.speak(message)
|
||||
src.visible_message("<b>[src]</b> points at [C.name]!")
|
||||
src.last_newpatient_speak = world.time
|
||||
if(declare_treatment)
|
||||
var/area/location = get_area(src)
|
||||
broadcast_medical_hud_message("[src.name] is treating <b>[C]</b> in <b>[location]</b>", src)
|
||||
break
|
||||
else
|
||||
continue
|
||||
@@ -438,6 +435,10 @@
|
||||
src.patient.reagents.add_reagent(reagent_id,src.injection_amount)
|
||||
visible_message("\red <B>[src] injects [src.patient] with the syringe!</B>")
|
||||
|
||||
if(declare_treatment)
|
||||
var/area/location = get_area(src)
|
||||
broadcast_medical_hud_message("[src.name] is treating <b>[C]</b> in <b>[location]</b>", src)
|
||||
|
||||
src.icon_state = "medibot[src.on]"
|
||||
src.currently_healing = 0
|
||||
return
|
||||
@@ -454,7 +455,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/bot/medbot/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag == "taser")
|
||||
if(Proj.taser_effect)
|
||||
src.stunned = min(stunned+10,20)
|
||||
..()
|
||||
|
||||
|
||||
@@ -134,11 +134,11 @@
|
||||
unload(0)
|
||||
switch(severity)
|
||||
if(2)
|
||||
wires &= ~(1 << rand(0,9))
|
||||
wires &= ~(1 << rand(0,9))
|
||||
wires &= ~(1 << rand(0,9))
|
||||
BITRESET(wires, rand(0,9))
|
||||
BITRESET(wires, rand(0,9))
|
||||
BITRESET(wires, rand(0,9))
|
||||
if(3)
|
||||
wires &= ~(1 << rand(0,9))
|
||||
BITRESET(wires, rand(0,9))
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
@@ -702,10 +702,10 @@ Auto Patrol: []"},
|
||||
switch(lasercolor)
|
||||
if("b")
|
||||
target_suit = /obj/item/clothing/suit/redtag
|
||||
target_weapon = /obj/item/weapon/gun/energy/laser/redtag
|
||||
target_weapon = /obj/item/weapon/gun/energy/lasertag/red
|
||||
if("r")
|
||||
target_suit = /obj/item/clothing/suit/bluetag
|
||||
target_weapon = /obj/item/weapon/gun/energy/laser/bluetag
|
||||
target_weapon = /obj/item/weapon/gun/energy/lasertag/blue
|
||||
|
||||
if((istype(perp.r_hand, target_weapon)) || (istype(perp.l_hand, target_weapon)))
|
||||
threat += 4
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/obj/machinery/driver_button
|
||||
name = "mass driver button"
|
||||
/obj/machinery/button
|
||||
name = "button"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "launcherbtt"
|
||||
desc = "A remote control switch for a mass driver."
|
||||
desc = "A remote control switch for something."
|
||||
var/id = null
|
||||
var/active = 0
|
||||
anchored = 1.0
|
||||
@@ -10,38 +10,10 @@
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/machinery/ignition_switch
|
||||
name = "ignition switch"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "launcherbtt"
|
||||
desc = "A remote control switch for a mounted igniter."
|
||||
var/id = null
|
||||
var/active = 0
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
/obj/machinery/button/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/flasher_button
|
||||
name = "flasher button"
|
||||
desc = "A remote control switch for a mounted flasher."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "launcherbtt"
|
||||
var/id = null
|
||||
var/active = 0
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/machinery/crema_switch
|
||||
desc = "Burn baby burn!"
|
||||
name = "crematorium igniter"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "crema_switch"
|
||||
anchored = 1.0
|
||||
req_access = list(access_crematorium)
|
||||
var/on = 0
|
||||
var/area/area = null
|
||||
var/otherarea = null
|
||||
var/id = 1
|
||||
/obj/machinery/button/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/detective_scanner))
|
||||
return
|
||||
return src.attack_hand(user)
|
||||
@@ -13,7 +13,6 @@
|
||||
var/c_tag_order = 999
|
||||
var/status = 1
|
||||
anchored = 1.0
|
||||
var/panel_open = 0 // 0 = Closed / 1 = Open
|
||||
var/invuln = null
|
||||
var/bugged = 0
|
||||
var/obj/item/weapon/camera_assembly/assembly = null
|
||||
@@ -54,13 +53,6 @@
|
||||
ASSERT(src.network.len > 0)
|
||||
..()
|
||||
|
||||
/obj/machinery/camera/Del()
|
||||
if(!alarm_on)
|
||||
triggerCameraAlarm()
|
||||
|
||||
cancelCameraAlarm()
|
||||
..()
|
||||
|
||||
/obj/machinery/camera/emp_act(severity)
|
||||
if(!isEmpProof())
|
||||
if(prob(100/severity))
|
||||
@@ -68,9 +60,9 @@
|
||||
stat |= EMPED
|
||||
SetLuminosity(0)
|
||||
kick_viewers()
|
||||
triggerCameraAlarm()
|
||||
triggerCameraAlarm(10 * severity)
|
||||
update_icon()
|
||||
|
||||
|
||||
spawn(900)
|
||||
stat &= ~EMPED
|
||||
cancelCameraAlarm()
|
||||
@@ -85,11 +77,11 @@
|
||||
/obj/machinery/camera/ex_act(severity)
|
||||
if(src.invuln)
|
||||
return
|
||||
|
||||
|
||||
//camera dies if an explosion touches it!
|
||||
if(severity <= 2 || prob(50))
|
||||
destroy()
|
||||
|
||||
|
||||
..() //and give it the regular chance of being deleted outright
|
||||
|
||||
|
||||
@@ -174,7 +166,7 @@
|
||||
if (S.current == src)
|
||||
O << "[U] holds \a [itemname] up to one of the cameras ..."
|
||||
O << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", itemname, info), text("window=[]", itemname))
|
||||
|
||||
|
||||
else if (istype(W, /obj/item/weapon/camera_bug))
|
||||
if (!src.can_use())
|
||||
user << "\blue Camera non-functional"
|
||||
@@ -185,7 +177,7 @@
|
||||
else
|
||||
user << "\blue Camera bugged."
|
||||
src.bugged = 1
|
||||
|
||||
|
||||
else if(W.damtype == BRUTE || W.damtype == BURN) //bashing cameras
|
||||
if (W.force >= src.toughness)
|
||||
visible_message("<span class='warning'><b>[src] has been [pick(W.attack_verb)] with [W] by [user]!</b></span>")
|
||||
@@ -194,7 +186,7 @@
|
||||
if (I.hitsound)
|
||||
playsound(loc, I.hitsound, 50, 1, -1)
|
||||
take_damage(W.force)
|
||||
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -221,14 +213,14 @@
|
||||
if (force >= toughness && (force > toughness*4 || prob(25)))
|
||||
destroy()
|
||||
|
||||
//Used when someone breaks a camera
|
||||
//Used when someone breaks a camera
|
||||
/obj/machinery/camera/proc/destroy()
|
||||
invalidateCameraCache()
|
||||
stat |= BROKEN
|
||||
kick_viewers()
|
||||
triggerCameraAlarm()
|
||||
update_icon()
|
||||
|
||||
|
||||
//sparks
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, loc)
|
||||
@@ -262,22 +254,16 @@
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/machinery/camera/proc/triggerCameraAlarm()
|
||||
/obj/machinery/camera/proc/triggerCameraAlarm(var/duration = 0)
|
||||
alarm_on = 1
|
||||
if(!get_area(src))
|
||||
return
|
||||
|
||||
for(var/mob/living/silicon/S in mob_list)
|
||||
S.triggerAlarm("Camera", get_area(src), list(src), src)
|
||||
|
||||
camera_alarm.triggerAlarm(loc, src, duration)
|
||||
|
||||
/obj/machinery/camera/proc/cancelCameraAlarm()
|
||||
alarm_on = 0
|
||||
if(!get_area(src))
|
||||
if(wires.IsIndexCut(CAMERA_WIRE_ALARM))
|
||||
return
|
||||
|
||||
for(var/mob/living/silicon/S in mob_list)
|
||||
S.cancelAlarm("Camera", get_area(src), src)
|
||||
|
||||
alarm_on = 0
|
||||
camera_alarm.clearAlarm(loc, src)
|
||||
|
||||
//if false, then the camera is listed as DEACTIVATED and cannot be used
|
||||
/obj/machinery/camera/proc/can_use()
|
||||
@@ -355,10 +341,20 @@
|
||||
/obj/machinery/camera/interact(mob/living/user as mob)
|
||||
if(!panel_open || istype(user, /mob/living/silicon/ai))
|
||||
return
|
||||
|
||||
|
||||
if(stat & BROKEN)
|
||||
user << "<span class='warning'>\The [src] is broken.</span>"
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
wires.Interact(user)
|
||||
|
||||
/obj/machinery/camera/proc/nano_structure()
|
||||
var/cam[0]
|
||||
cam["name"] = sanitize(c_tag)
|
||||
cam["deact"] = !can_use()
|
||||
cam["camera"] = "\ref[src]"
|
||||
cam["x"] = x
|
||||
cam["y"] = y
|
||||
cam["z"] = z
|
||||
return cam
|
||||
|
||||
@@ -45,8 +45,7 @@
|
||||
if (!status || (stat & NOPOWER))
|
||||
return 0
|
||||
if (detectTime == -1)
|
||||
for (var/mob/living/silicon/aiPlayer in player_list)
|
||||
aiPlayer.cancelAlarm("Motion", get_area(src), src)
|
||||
motion_alarm.clearAlarm(loc, src)
|
||||
detectTime = 0
|
||||
return 1
|
||||
|
||||
@@ -54,8 +53,7 @@
|
||||
if (!status || (stat & NOPOWER))
|
||||
return 0
|
||||
if (!detectTime) return 0
|
||||
for (var/mob/living/silicon/aiPlayer in player_list)
|
||||
aiPlayer.triggerAlarm("Motion", get_area(src), list(src), src)
|
||||
motion_alarm.triggerAlarm(loc, src)
|
||||
detectTime = -1
|
||||
return 1
|
||||
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
#define TRACKING_POSSIBLE 0
|
||||
#define TRACKING_NO_COVERAGE 1
|
||||
#define TRACKING_TERMINATE 2
|
||||
|
||||
/mob/living/silicon/ai/var/max_locations = 10
|
||||
/mob/living/silicon/ai/var/stored_locations[0]
|
||||
|
||||
/mob/living/silicon/ai/proc/InvalidTurf(turf/T as turf)
|
||||
if(!T)
|
||||
return 1
|
||||
if(T.z == 2)
|
||||
return 1
|
||||
if(T.z > 6)
|
||||
return 1
|
||||
return 0
|
||||
/proc/InvalidPlayerTurf(turf/T as turf)
|
||||
return !(T && T.z in config.player_levels)
|
||||
|
||||
/mob/living/silicon/ai/proc/get_camera_list()
|
||||
|
||||
if(src.stat == 2)
|
||||
return
|
||||
|
||||
@@ -64,7 +61,7 @@
|
||||
return
|
||||
|
||||
var/L = src.eyeobj.getLoc()
|
||||
if (InvalidTurf(get_turf(L)))
|
||||
if (InvalidPlayerTurf(get_turf(L)))
|
||||
src << "\red Unable to store this location"
|
||||
return
|
||||
|
||||
@@ -107,38 +104,14 @@
|
||||
var/list/cameras = list()
|
||||
|
||||
/mob/living/silicon/ai/proc/trackable_mobs()
|
||||
|
||||
if(usr.stat == 2)
|
||||
return list()
|
||||
|
||||
var/datum/trackable/TB = new()
|
||||
for(var/mob/living/M in mob_list)
|
||||
// Easy checks first.
|
||||
// Don't detect mobs on Centcom. Since the wizard den is on Centcomm, we only need this.
|
||||
if(InvalidTurf(get_turf(M)))
|
||||
continue
|
||||
if(M == usr)
|
||||
continue
|
||||
if(M.invisibility)//cloaked
|
||||
continue
|
||||
if(M.digitalcamo)
|
||||
continue
|
||||
|
||||
// Human check
|
||||
var/human = 0
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
human = 1
|
||||
var/mob/living/carbon/human/H = M
|
||||
//Cameras can't track people wearing an agent card or a ninja hood.
|
||||
if(H.wear_id && istype(H.wear_id.GetID(), /obj/item/weapon/card/id/syndicate))
|
||||
continue
|
||||
if(istype(H.head, /obj/item/clothing/head/helmet/space/rig))
|
||||
var/obj/item/clothing/head/helmet/space/rig/helmet = H.head
|
||||
if(helmet.prevent_track())
|
||||
continue
|
||||
|
||||
// Now, are they viewable by a camera? (This is last because it's the most intensive check)
|
||||
if(!near_camera(M))
|
||||
if(M.tracking_status() != TRACKING_POSSIBLE)
|
||||
continue
|
||||
|
||||
var/name = M.name
|
||||
@@ -148,7 +121,7 @@
|
||||
else
|
||||
TB.names.Add(name)
|
||||
TB.namecounts[name] = 1
|
||||
if(human)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
TB.humans[name] = M
|
||||
else
|
||||
TB.others[name] = M
|
||||
@@ -177,6 +150,7 @@
|
||||
return
|
||||
|
||||
src << "Follow camera mode [forced ? "terminated" : "ended"]."
|
||||
cameraFollow.tracking_cancelled()
|
||||
cameraFollow = null
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_actual_track(mob/living/target as mob)
|
||||
@@ -185,33 +159,21 @@
|
||||
|
||||
U.cameraFollow = target
|
||||
U << "Now tracking [target.name] on camera."
|
||||
target.tracking_initiated()
|
||||
|
||||
spawn (0)
|
||||
while (U.cameraFollow == target)
|
||||
if (U.cameraFollow == null)
|
||||
return
|
||||
if (istype(target, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.wear_id && istype(H.wear_id.GetID(), /obj/item/weapon/card/id/syndicate))
|
||||
|
||||
switch(target.tracking_status())
|
||||
if(TRACKING_NO_COVERAGE)
|
||||
U << "Target is not near any active cameras."
|
||||
sleep(100)
|
||||
continue
|
||||
if(TRACKING_TERMINATE)
|
||||
U.ai_cancel_tracking(1)
|
||||
return
|
||||
if(istype(H.head, /obj/item/clothing/head/helmet/space/rig))
|
||||
var/obj/item/clothing/head/helmet/space/rig/helmet = H.head
|
||||
if(helmet.prevent_track())
|
||||
U.ai_cancel_tracking(1)
|
||||
return
|
||||
if(H.digitalcamo)
|
||||
U.ai_cancel_tracking(1)
|
||||
return
|
||||
|
||||
if(istype(target.loc,/obj/effect/dummy))
|
||||
U.ai_cancel_tracking()
|
||||
return
|
||||
|
||||
if (!trackable(target))
|
||||
U << "Target is not near any active cameras."
|
||||
sleep(100)
|
||||
continue
|
||||
|
||||
if(U.eyeobj)
|
||||
U.eyeobj.setLoc(get_turf(target), 0)
|
||||
@@ -220,24 +182,6 @@
|
||||
return
|
||||
sleep(10)
|
||||
|
||||
/proc/near_camera(var/mob/living/M)
|
||||
if (!isturf(M.loc))
|
||||
return 0
|
||||
if(isrobot(M))
|
||||
var/mob/living/silicon/robot/R = M
|
||||
if(!(R.camera && R.camera.can_use()) && !cameranet.checkCameraVis(M))
|
||||
return 0
|
||||
else if(!cameranet.checkCameraVis(M))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/proc/trackable(var/mob/living/M)
|
||||
var/turf/T = get_turf(M)
|
||||
if(T && (T.z in config.station_levels) && hassensorlevel(M, SUIT_SENSOR_TRACKING))
|
||||
return 1
|
||||
|
||||
return near_camera(M)
|
||||
|
||||
/obj/machinery/camera/attack_ai(var/mob/living/silicon/ai/user as mob)
|
||||
if (!istype(user))
|
||||
return
|
||||
@@ -248,3 +192,87 @@
|
||||
|
||||
/mob/living/silicon/ai/attack_ai(var/mob/user as mob)
|
||||
ai_camera_list()
|
||||
|
||||
/proc/camera_sort(list/L)
|
||||
var/obj/machinery/camera/a
|
||||
var/obj/machinery/camera/b
|
||||
|
||||
for (var/i = L.len, i > 0, i--)
|
||||
for (var/j = 1 to i - 1)
|
||||
a = L[j]
|
||||
b = L[j + 1]
|
||||
if (a.c_tag_order != b.c_tag_order)
|
||||
if (a.c_tag_order > b.c_tag_order)
|
||||
L.Swap(j, j + 1)
|
||||
else
|
||||
if (sorttext(a.c_tag, b.c_tag) < 0)
|
||||
L.Swap(j, j + 1)
|
||||
return L
|
||||
|
||||
|
||||
mob/living/proc/near_camera()
|
||||
if (!isturf(loc))
|
||||
return 0
|
||||
else if(!cameranet.checkCameraVis(src))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/proc/tracking_status()
|
||||
// Easy checks first.
|
||||
// Don't detect mobs on Centcom. Since the wizard den is on Centcomm, we only need this.
|
||||
if(InvalidPlayerTurf(get_turf(src)))
|
||||
return TRACKING_TERMINATE
|
||||
if(invisibility >= INVISIBILITY_LEVEL_ONE) //cloaked
|
||||
return TRACKING_TERMINATE
|
||||
if(digitalcamo)
|
||||
return TRACKING_TERMINATE
|
||||
if(istype(loc,/obj/effect/dummy))
|
||||
return TRACKING_TERMINATE
|
||||
|
||||
// Now, are they viewable by a camera? (This is last because it's the most intensive check)
|
||||
return near_camera() ? TRACKING_POSSIBLE : TRACKING_NO_COVERAGE
|
||||
|
||||
/mob/living/silicon/robot/tracking_status()
|
||||
. = ..()
|
||||
if(. == TRACKING_NO_COVERAGE)
|
||||
return camera && camera.can_use() ? TRACKING_POSSIBLE : TRACKING_NO_COVERAGE
|
||||
|
||||
/mob/living/silicon/robot/syndicate/tracking_status()
|
||||
return TRACKING_TERMINATE
|
||||
|
||||
/mob/living/carbon/human/tracking_status()
|
||||
//Cameras can't track people wearing an agent card or a ninja hood.
|
||||
if(wear_id && istype(wear_id.GetID(), /obj/item/weapon/card/id/syndicate))
|
||||
return TRACKING_TERMINATE
|
||||
if(istype(head, /obj/item/clothing/head/helmet/space/rig))
|
||||
var/obj/item/clothing/head/helmet/space/rig/helmet = head
|
||||
if(helmet.prevent_track())
|
||||
return TRACKING_TERMINATE
|
||||
|
||||
. = ..()
|
||||
if(. == TRACKING_TERMINATE)
|
||||
return
|
||||
|
||||
if(. == TRACKING_NO_COVERAGE)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T && (T.z in config.station_levels) && hassensorlevel(src, SUIT_SENSOR_TRACKING))
|
||||
return TRACKING_POSSIBLE
|
||||
|
||||
mob/living/proc/tracking_initiated()
|
||||
|
||||
mob/living/silicon/robot/tracking_initiated()
|
||||
tracking_entities++
|
||||
if(tracking_entities == 1 && has_zeroth_law())
|
||||
src << "<span class='warning'>Internal camera is currently being accessed.</span>"
|
||||
|
||||
mob/living/proc/tracking_cancelled()
|
||||
|
||||
mob/living/silicon/robot/tracking_initiated()
|
||||
tracking_entities--
|
||||
if(!tracking_entities && has_zeroth_law())
|
||||
src << "<span class='notice'>Internal camera is no longer being accessed.</span>"
|
||||
|
||||
|
||||
#undef TRACKING_POSSIBLE
|
||||
#undef TRACKING_NO_COVERAGE
|
||||
#undef TRACKING_TERMINATE
|
||||
|
||||
+390
-352
@@ -3,18 +3,41 @@
|
||||
|
||||
//Potential replacement for genetics revives or something I dunno (?)
|
||||
|
||||
//Find a dead mob with a brain and client.
|
||||
/proc/find_dead_player(var/find_key)
|
||||
if(isnull(find_key))
|
||||
return
|
||||
|
||||
var/mob/selected = null
|
||||
for(var/mob/living/M in player_list)
|
||||
//Dead people only thanks!
|
||||
if((M.stat != 2) || (!M.client))
|
||||
continue
|
||||
//They need a brain!
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.has_organ["brain"] && !H.has_brain())
|
||||
continue
|
||||
if(M.ckey == find_key)
|
||||
selected = M
|
||||
break
|
||||
return selected
|
||||
|
||||
#define CLONE_BIOMASS 150
|
||||
|
||||
/obj/machinery/clonepod
|
||||
anchored = 1
|
||||
name = "cloning pod"
|
||||
desc = "An electronically-lockable pod for growing organic tissue."
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/cloning.dmi'
|
||||
icon_state = "pod_0"
|
||||
req_access = list(access_genetics) //For premature unlocking.
|
||||
|
||||
var/mob/living/occupant
|
||||
var/heal_level = 90 //The clone is released once its health reaches this level.
|
||||
var/heal_level = 20 //The clone is released once its health reaches this level.
|
||||
var/heal_rate = 1
|
||||
var/notoxin = 0
|
||||
var/locked = 0
|
||||
var/obj/machinery/computer/cloning/connected = null //So we remember the connected clone machine.
|
||||
var/mess = 0 //Need to clean out it if it's full of exploded clone.
|
||||
@@ -22,6 +45,366 @@
|
||||
var/eject_wait = 0 //Don't eject them as soon as they are created fuckkk
|
||||
var/biomass = CLONE_BIOMASS * 3
|
||||
|
||||
/obj/machinery/clonepod/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/clonepod(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 2)
|
||||
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/clonepod/attack_ai(mob/user as mob)
|
||||
add_hiddenprint(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/clonepod/attack_hand(mob/user as mob)
|
||||
if((isnull(occupant)) || (stat & NOPOWER))
|
||||
return
|
||||
if((!isnull(occupant)) && (occupant.stat != 2))
|
||||
var/completion = (100 * ((occupant.health + 50) / (heal_level + 100))) // Clones start at -150 health
|
||||
user << "Current clone cycle is [round(completion)]% complete."
|
||||
return
|
||||
|
||||
//Clonepod
|
||||
|
||||
//Start growing a human clone in the pod!
|
||||
/obj/machinery/clonepod/proc/growclone(var/datum/dna2/record/R)
|
||||
if(mess || attempting)
|
||||
return 0
|
||||
var/datum/mind/clonemind = locate(R.mind)
|
||||
if(!istype(clonemind, /datum/mind)) //not a mind
|
||||
return 0
|
||||
if(clonemind.current && clonemind.current.stat != DEAD) //mind is associated with a non-dead body
|
||||
return 0
|
||||
if(clonemind.active) //somebody is using that mind
|
||||
if(ckey(clonemind.key) != R.ckey)
|
||||
return 0
|
||||
else
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(G.ckey == R.ckey)
|
||||
if(G.can_reenter_corpse)
|
||||
break
|
||||
else
|
||||
return 0
|
||||
|
||||
attempting = 1 //One at a time!!
|
||||
locked = 1
|
||||
|
||||
eject_wait = 1
|
||||
spawn(30)
|
||||
eject_wait = 0
|
||||
|
||||
var/mob/living/carbon/human/H = new /mob/living/carbon/human(src, R.dna.species)
|
||||
occupant = H
|
||||
|
||||
if(!R.dna.real_name) //to prevent null names
|
||||
R.dna.real_name = "clone ([rand(0,999)])"
|
||||
H.real_name = R.dna.real_name
|
||||
|
||||
icon_state = "pod_1"
|
||||
//Get the clone body ready
|
||||
H.adjustCloneLoss(150) // New damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite
|
||||
H.adjustBrainLoss(80) // Even if healed to full health, it will have some brain damage
|
||||
H.Paralyse(4)
|
||||
|
||||
//Here let's calculate their health so the pod doesn't immediately eject them!!!
|
||||
H.updatehealth()
|
||||
|
||||
clonemind.transfer_to(H)
|
||||
H.ckey = R.ckey
|
||||
H << "<span class='notice'><b>Consciousness slowly creeps over you as your body regenerates.</b><br><i>So this is what cloning feels like?</i></span>"
|
||||
|
||||
// -- Mode/mind specific stuff goes here
|
||||
callHook("clone", list(H))
|
||||
|
||||
switch(ticker.mode.name)
|
||||
if("revolution")
|
||||
if((H.mind in ticker.mode:revolutionaries) || (H.mind in ticker.mode:head_revolutionaries))
|
||||
ticker.mode.update_all_rev_icons() //So the icon actually appears
|
||||
if("mercenary")
|
||||
if(H.mind in ticker.mode.syndicates)
|
||||
ticker.mode.update_all_synd_icons()
|
||||
if("cult")
|
||||
if(H.mind in ticker.mode.cult)
|
||||
ticker.mode.add_cultist(occupant.mind)
|
||||
ticker.mode.update_all_cult_icons() //So the icon actually appears
|
||||
|
||||
// -- End mode specific stuff
|
||||
|
||||
if(!R.dna)
|
||||
H.dna = new /datum/dna()
|
||||
H.dna.real_name = H.real_name
|
||||
else
|
||||
H.dna = R.dna
|
||||
H.UpdateAppearance()
|
||||
if(heal_level < 60)
|
||||
randmutb(H) //Sometimes the clones come out wrong.
|
||||
H.dna.UpdateSE()
|
||||
H.dna.UpdateUI()
|
||||
|
||||
H.set_cloned_appearance()
|
||||
|
||||
for(var/datum/language/L in R.languages)
|
||||
H.add_language(L.name)
|
||||
H.flavor_texts = R.flavor.Copy()
|
||||
H.suiciding = 0
|
||||
attempting = 0
|
||||
return 1
|
||||
|
||||
//Grow clones to maturity then kick them out. FREELOADERS
|
||||
/obj/machinery/clonepod/process()
|
||||
|
||||
if(stat & NOPOWER) //Autoeject if power is lost
|
||||
if(occupant)
|
||||
locked = 0
|
||||
go_out()
|
||||
return
|
||||
|
||||
if((occupant) && (occupant.loc == src))
|
||||
if((occupant.stat == DEAD) || (occupant.suiciding) || !occupant.key) //Autoeject corpses and suiciding dudes.
|
||||
locked = 0
|
||||
go_out()
|
||||
connected_message("Clone Rejected: Deceased.")
|
||||
return
|
||||
|
||||
else if(occupant.health < heal_level && occupant.getCloneLoss() > 0)
|
||||
occupant.Paralyse(4)
|
||||
|
||||
//Slowly get that clone healed and finished.
|
||||
occupant.adjustCloneLoss(-2 * heal_rate)
|
||||
|
||||
//Premature clones may have brain damage.
|
||||
occupant.adjustBrainLoss(-1 * heal_rate)
|
||||
|
||||
//So clones don't die of oxyloss in a running pod.
|
||||
if(occupant.reagents.get_reagent_amount("inaprovaline") < 30)
|
||||
occupant.reagents.add_reagent("inaprovaline", 60)
|
||||
|
||||
//So clones will remain asleep for long enough to get them into cryo (Bay RP edit)
|
||||
if(occupant.reagents.get_reagent_amount("stoxin") < 10)
|
||||
occupant.reagents.add_reagent("stoxin", 5)
|
||||
if(occupant.reagents.get_reagent_amount("chloralhydrate") < 1)
|
||||
occupant.reagents.add_reagent("chloralhydrate", 1)
|
||||
|
||||
//Also heal some oxyloss ourselves because inaprovaline is so bad at preventing it!!
|
||||
occupant.adjustOxyLoss(-4)
|
||||
if(notoxin)
|
||||
occupant.adjustToxLoss(-2) // If sufficiently upgraded - remove toxin damage from chloral
|
||||
|
||||
use_power(7500) //This might need tweaking.
|
||||
return
|
||||
|
||||
else if((occupant.health >= heal_level) && (!eject_wait))
|
||||
connected_message("Cloning Process Complete.")
|
||||
locked = 0
|
||||
go_out()
|
||||
return
|
||||
|
||||
else if((!occupant) || (occupant.loc != src))
|
||||
occupant = null
|
||||
if(locked)
|
||||
locked = 0
|
||||
if(!mess)
|
||||
icon_state = "pod_0"
|
||||
//use_power(200)
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
//Let's unlock this early I guess. Might be too early, needs tweaking.
|
||||
/obj/machinery/clonepod/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(isnull(occupant))
|
||||
if(default_deconstruction_screwdriver(user, W))
|
||||
return
|
||||
if(default_deconstruction_crowbar(user, W))
|
||||
return
|
||||
if(default_part_replacement(user, W))
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if(!check_access(W))
|
||||
user << "<span class='warning'>Access Denied.</span>"
|
||||
return
|
||||
if((!locked) || (isnull(occupant)))
|
||||
return
|
||||
if((occupant.health < -20) && (occupant.stat != 2))
|
||||
user << "<span class='warning'>Access Refused.</span>"
|
||||
return
|
||||
else
|
||||
locked = 0
|
||||
user << "System unlocked."
|
||||
else if(istype(W, /obj/item/weapon/card/emag))
|
||||
if(isnull(occupant))
|
||||
return
|
||||
user << "You force an emergency ejection."
|
||||
locked = 0
|
||||
go_out()
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
|
||||
user << "<span class='notice'>\The [src] processes \the [W].</span>"
|
||||
biomass += 50
|
||||
user.drop_item()
|
||||
del(W)
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
if(locked && (anchored || occupant))
|
||||
user << "<span class='warning'>Can not do that while [src] is in use.</span>"
|
||||
else
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
connected.pod1 = null
|
||||
connected = null
|
||||
else
|
||||
anchored = 1
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
if(anchored)
|
||||
user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.")
|
||||
else
|
||||
user.visible_message("[user] unsecures [src] from the floor.", "You unsecure [src] from the floor.")
|
||||
else
|
||||
..()
|
||||
|
||||
//Put messages in the connected computer's temp var for display.
|
||||
/obj/machinery/clonepod/proc/connected_message(var/message)
|
||||
if((isnull(connected)) || (!istype(connected, /obj/machinery/computer/cloning)))
|
||||
return 0
|
||||
if(!message)
|
||||
return 0
|
||||
|
||||
connected.temp = message
|
||||
connected.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
/obj/machinery/clonepod/RefreshParts()
|
||||
..()
|
||||
var/rating = 0
|
||||
for(var/obj/item/weapon/stock_parts/P in component_parts)
|
||||
if(istype(P, /obj/item/weapon/stock_parts/scanning_module) || istype(P, /obj/item/weapon/stock_parts/manipulator))
|
||||
rating += P.rating
|
||||
|
||||
heal_level = rating * 10 - 20
|
||||
heal_rate = round(rating / 4)
|
||||
if(rating >= 8)
|
||||
notoxin = 1
|
||||
else
|
||||
notoxin = 0
|
||||
|
||||
/obj/machinery/clonepod/verb/eject()
|
||||
set name = "Eject Cloner"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/proc/go_out()
|
||||
if(locked)
|
||||
return
|
||||
|
||||
if(mess) //Clean that mess and dump those gibs!
|
||||
mess = 0
|
||||
gibs(loc)
|
||||
icon_state = "pod_0"
|
||||
|
||||
/*
|
||||
for(var/obj/O in src)
|
||||
O.loc = loc
|
||||
*/
|
||||
return
|
||||
|
||||
if(!(occupant))
|
||||
return
|
||||
|
||||
/*
|
||||
for(var/obj/O in src)
|
||||
O.loc = loc
|
||||
*/
|
||||
|
||||
if(occupant.client)
|
||||
occupant.client.eye = occupant.client.mob
|
||||
occupant.client.perspective = MOB_PERSPECTIVE
|
||||
occupant.loc = loc
|
||||
icon_state = "pod_0"
|
||||
eject_wait = 0 //If it's still set somehow.
|
||||
domutcheck(occupant) //Waiting until they're out before possible monkeyizing.
|
||||
// occupant.add_side_effect("Bad Stomach") // Give them an extra side-effect for free.
|
||||
occupant = null
|
||||
|
||||
biomass -= CLONE_BIOMASS
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/proc/malfunction()
|
||||
if(occupant)
|
||||
connected_message("Critical Error!")
|
||||
mess = 1
|
||||
icon_state = "pod_g"
|
||||
occupant.ghostize()
|
||||
spawn(5)
|
||||
del(occupant)
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/relaymove(mob/user as mob)
|
||||
if(user.stat)
|
||||
return
|
||||
go_out()
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/emp_act(severity)
|
||||
if(prob(100/severity))
|
||||
malfunction()
|
||||
..()
|
||||
|
||||
/obj/machinery/clonepod/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
//Health Tracker Implant
|
||||
|
||||
/obj/item/weapon/implant/health
|
||||
name = "health implant"
|
||||
var/healthstring = ""
|
||||
|
||||
/obj/item/weapon/implant/health/proc/sensehealth()
|
||||
if(!implanted)
|
||||
return "ERROR"
|
||||
else
|
||||
if(isliving(implanted))
|
||||
var/mob/living/L = implanted
|
||||
healthstring = "[round(L.getOxyLoss())] - [round(L.getFireLoss())] - [round(L.getToxLoss())] - [round(L.getBruteLoss())]"
|
||||
if(!healthstring)
|
||||
healthstring = "ERROR"
|
||||
return healthstring
|
||||
|
||||
//Disk stuff.
|
||||
//The return of data disks?? Just for transferring between genetics machine/cloning machine.
|
||||
//TO-DO: Make the genetics machine accept them.
|
||||
/obj/item/weapon/disk/data
|
||||
@@ -30,7 +413,7 @@
|
||||
icon_state = "datadisk0" //Gosh I hope syndies don't mistake them for the nuke disk.
|
||||
item_state = "card-id"
|
||||
w_class = 2.0
|
||||
var/datum/dna2/record/buf=null
|
||||
var/datum/dna2/record/buf = null
|
||||
var/read_only = 0 //Well,it's still a floppy disk
|
||||
|
||||
/obj/item/weapon/disk/data/proc/initializeDisk()
|
||||
@@ -65,363 +448,18 @@
|
||||
buf.dna.SE=new_SE
|
||||
buf.dna.SetSEValueRange(MONKEYBLOCK,0xDAC, 0xFFF)
|
||||
|
||||
|
||||
//Find a dead mob with a brain and client.
|
||||
/proc/find_dead_player(var/find_key)
|
||||
if (isnull(find_key))
|
||||
return
|
||||
|
||||
var/mob/selected = null
|
||||
for(var/mob/living/M in player_list)
|
||||
//Dead people only thanks!
|
||||
if ((M.stat != 2) || (!M.client))
|
||||
continue
|
||||
//They need a brain!
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.has_organ["brain"] && !H.has_brain())
|
||||
continue
|
||||
if (M.ckey == find_key)
|
||||
selected = M
|
||||
break
|
||||
return selected
|
||||
|
||||
//Disk stuff.
|
||||
/obj/item/weapon/disk/data/New()
|
||||
..()
|
||||
var/diskcolor = pick(0,1,2)
|
||||
src.icon_state = "datadisk[diskcolor]"
|
||||
icon_state = "datadisk[diskcolor]"
|
||||
|
||||
/obj/item/weapon/disk/data/attack_self(mob/user as mob)
|
||||
src.read_only = !src.read_only
|
||||
user << "You flip the write-protect tab to [src.read_only ? "protected" : "unprotected"]."
|
||||
read_only = !read_only
|
||||
user << "You flip the write-protect tab to [read_only ? "protected" : "unprotected"]."
|
||||
|
||||
/obj/item/weapon/disk/data/examine(mob/user)
|
||||
..(user)
|
||||
user << text("The write-protect tab is set to [src.read_only ? "protected" : "unprotected"].")
|
||||
return
|
||||
|
||||
//Health Tracker Implant
|
||||
|
||||
/obj/item/weapon/implant/health
|
||||
name = "health implant"
|
||||
var/healthstring = ""
|
||||
|
||||
/obj/item/weapon/implant/health/proc/sensehealth()
|
||||
if (!src.implanted)
|
||||
return "ERROR"
|
||||
else
|
||||
if(isliving(src.implanted))
|
||||
var/mob/living/L = src.implanted
|
||||
src.healthstring = "[round(L.getOxyLoss())] - [round(L.getFireLoss())] - [round(L.getToxLoss())] - [round(L.getBruteLoss())]"
|
||||
if (!src.healthstring)
|
||||
src.healthstring = "ERROR"
|
||||
return src.healthstring
|
||||
|
||||
/obj/machinery/clonepod/attack_ai(mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/clonepod/attack_hand(mob/user as mob)
|
||||
if ((isnull(src.occupant)) || (stat & NOPOWER))
|
||||
return
|
||||
if ((!isnull(src.occupant)) && (src.occupant.stat != 2))
|
||||
var/completion = (100 * ((src.occupant.health + 100) / (src.heal_level + 100)))
|
||||
user << "Current clone cycle is [round(completion)]% complete."
|
||||
return
|
||||
|
||||
//Clonepod
|
||||
|
||||
//Start growing a human clone in the pod!
|
||||
/obj/machinery/clonepod/proc/growclone(var/datum/dna2/record/R)
|
||||
if(mess || attempting)
|
||||
return 0
|
||||
var/datum/mind/clonemind = locate(R.mind)
|
||||
if(!istype(clonemind,/datum/mind)) //not a mind
|
||||
return 0
|
||||
if( clonemind.current && clonemind.current.stat != DEAD ) //mind is associated with a non-dead body
|
||||
return 0
|
||||
if(clonemind.active) //somebody is using that mind
|
||||
if( ckey(clonemind.key)!=R.ckey )
|
||||
return 0
|
||||
else
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(G.ckey == R.ckey)
|
||||
if(G.can_reenter_corpse)
|
||||
break
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
src.heal_level = rand(10,40) //Randomizes what health the clone is when ejected
|
||||
src.attempting = 1 //One at a time!!
|
||||
src.locked = 1
|
||||
|
||||
src.eject_wait = 1
|
||||
spawn(30)
|
||||
src.eject_wait = 0
|
||||
|
||||
var/mob/living/carbon/human/H = new /mob/living/carbon/human(src, R.dna.species)
|
||||
occupant = H
|
||||
|
||||
if(!R.dna.real_name) //to prevent null names
|
||||
R.dna.real_name = "clone ([rand(0,999)])"
|
||||
H.real_name = R.dna.real_name
|
||||
|
||||
src.icon_state = "pod_1"
|
||||
//Get the clone body ready
|
||||
H.adjustCloneLoss(150) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite
|
||||
H.adjustBrainLoss(src.heal_level + 50 + rand(10, 30)) // The rand(10, 30) will come out as extra brain damage
|
||||
H.Paralyse(4)
|
||||
|
||||
//Here let's calculate their health so the pod doesn't immediately eject them!!!
|
||||
H.updatehealth()
|
||||
|
||||
clonemind.transfer_to(H)
|
||||
H.ckey = R.ckey
|
||||
H << "<span class='notice'><b>Consciousness slowly creeps over you as your body regenerates.</b><br><i>So this is what cloning feels like?</i></span>"
|
||||
|
||||
// -- Mode/mind specific stuff goes here
|
||||
callHook("clone", list(H))
|
||||
|
||||
switch(ticker.mode.name)
|
||||
if("revolution")
|
||||
if((H.mind in ticker.mode:revolutionaries) || (H.mind in ticker.mode:head_revolutionaries))
|
||||
ticker.mode.update_all_rev_icons() //So the icon actually appears
|
||||
if("mercenary")
|
||||
if(H.mind in ticker.mode.syndicates)
|
||||
ticker.mode.update_all_synd_icons()
|
||||
if("cult")
|
||||
if (H.mind in ticker.mode.cult)
|
||||
ticker.mode.add_cultist(src.occupant.mind)
|
||||
ticker.mode.update_all_cult_icons() //So the icon actually appears
|
||||
|
||||
// -- End mode specific stuff
|
||||
|
||||
if(!R.dna)
|
||||
H.dna = new /datum/dna()
|
||||
H.dna.real_name = H.real_name
|
||||
else
|
||||
H.dna=R.dna
|
||||
H.UpdateAppearance()
|
||||
randmutb(H) //Sometimes the clones come out wrong.
|
||||
H.dna.UpdateSE()
|
||||
H.dna.UpdateUI()
|
||||
|
||||
H.set_cloned_appearance()
|
||||
|
||||
for(var/datum/language/L in R.languages)
|
||||
H.add_language(L.name)
|
||||
H.flavor_texts = R.flavor.Copy()
|
||||
H.suiciding = 0
|
||||
src.attempting = 0
|
||||
return 1
|
||||
|
||||
//Grow clones to maturity then kick them out. FREELOADERS
|
||||
/obj/machinery/clonepod/process()
|
||||
|
||||
if(stat & NOPOWER) //Autoeject if power is lost
|
||||
if (src.occupant)
|
||||
src.locked = 0
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
if((src.occupant) && (src.occupant.loc == src))
|
||||
if((src.occupant.stat == DEAD) || (src.occupant.suiciding) || !occupant.key) //Autoeject corpses and suiciding dudes.
|
||||
src.locked = 0
|
||||
src.go_out()
|
||||
src.connected_message("Clone Rejected: Deceased.")
|
||||
return
|
||||
|
||||
else if(src.occupant.health < src.heal_level)
|
||||
src.occupant.Paralyse(4)
|
||||
|
||||
//Slowly get that clone healed and finished.
|
||||
src.occupant.adjustCloneLoss(-2)
|
||||
|
||||
//Premature clones may have brain damage.
|
||||
src.occupant.adjustBrainLoss(-1)
|
||||
|
||||
//So clones don't die of oxyloss in a running pod.
|
||||
if (src.occupant.reagents.get_reagent_amount("inaprovaline") < 30)
|
||||
src.occupant.reagents.add_reagent("inaprovaline", 60)
|
||||
|
||||
//So clones will remain asleep for long enough to get them into cryo (Bay RP edit)
|
||||
if (src.occupant.reagents.get_reagent_amount("stoxin") < 10)
|
||||
src.occupant.reagents.add_reagent("stoxin", 5)
|
||||
if (src.occupant.reagents.get_reagent_amount("chloralhydrate") < 1)
|
||||
src.occupant.reagents.add_reagent("chloralhydrate", 1)
|
||||
|
||||
//Also heal some oxyloss ourselves because inaprovaline is so bad at preventing it!!
|
||||
src.occupant.adjustOxyLoss(-4)
|
||||
|
||||
use_power(7500) //This might need tweaking.
|
||||
return
|
||||
|
||||
else if((src.occupant.health >= src.heal_level) && (!src.eject_wait))
|
||||
src.connected_message("Cloning Process Complete.")
|
||||
src.locked = 0
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
else if ((!src.occupant) || (src.occupant.loc != src))
|
||||
src.occupant = null
|
||||
if (src.locked)
|
||||
src.locked = 0
|
||||
if (!src.mess)
|
||||
icon_state = "pod_0"
|
||||
//use_power(200)
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
//Let's unlock this early I guess. Might be too early, needs tweaking.
|
||||
/obj/machinery/clonepod/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (!src.check_access(W))
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
if ((!src.locked) || (isnull(src.occupant)))
|
||||
return
|
||||
if ((src.occupant.health < -20) && (src.occupant.stat != 2))
|
||||
user << "\red Access Refused."
|
||||
return
|
||||
else
|
||||
src.locked = 0
|
||||
user << "System unlocked."
|
||||
else if (istype(W, /obj/item/weapon/card/emag))
|
||||
if (isnull(src.occupant))
|
||||
return
|
||||
user << "You force an emergency ejection."
|
||||
src.locked = 0
|
||||
src.go_out()
|
||||
return
|
||||
else if (istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
|
||||
user << "\blue \The [src] processes \the [W]."
|
||||
biomass += 50
|
||||
user.drop_item()
|
||||
del(W)
|
||||
return
|
||||
else if (istype(W, /obj/item/weapon/wrench))
|
||||
if(src.locked && (src.anchored || src.occupant))
|
||||
user << "\red Can not do that while [src] is in use."
|
||||
else
|
||||
if(src.anchored)
|
||||
src.anchored = 0
|
||||
connected.pod1 = null
|
||||
connected = null
|
||||
else
|
||||
src.anchored = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
if(anchored)
|
||||
user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.")
|
||||
else
|
||||
user.visible_message("[user] unsecures [src] from the floor.", "You unsecure [src] from the floor.")
|
||||
else
|
||||
..()
|
||||
|
||||
//Put messages in the connected computer's temp var for display.
|
||||
/obj/machinery/clonepod/proc/connected_message(var/message)
|
||||
if ((isnull(src.connected)) || (!istype(src.connected, /obj/machinery/computer/cloning)))
|
||||
return 0
|
||||
if (!message)
|
||||
return 0
|
||||
|
||||
src.connected.temp = message
|
||||
src.connected.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
/obj/machinery/clonepod/verb/eject()
|
||||
set name = "Eject Cloner"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/proc/go_out()
|
||||
if (src.locked)
|
||||
return
|
||||
|
||||
if (src.mess) //Clean that mess and dump those gibs!
|
||||
src.mess = 0
|
||||
gibs(src.loc)
|
||||
src.icon_state = "pod_0"
|
||||
|
||||
/*
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
*/
|
||||
return
|
||||
|
||||
if (!(src.occupant))
|
||||
return
|
||||
|
||||
/*
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
*/
|
||||
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.icon_state = "pod_0"
|
||||
src.eject_wait = 0 //If it's still set somehow.
|
||||
domutcheck(src.occupant) //Waiting until they're out before possible monkeyizing.
|
||||
// src.occupant.add_side_effect("Bad Stomach") // Give them an extra side-effect for free.
|
||||
src.occupant = null
|
||||
|
||||
src.biomass -= CLONE_BIOMASS
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/proc/malfunction()
|
||||
if(src.occupant)
|
||||
src.connected_message("Critical Error!")
|
||||
src.mess = 1
|
||||
src.icon_state = "pod_g"
|
||||
src.occupant.ghostize()
|
||||
spawn(5)
|
||||
del(src.occupant)
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/relaymove(mob/user as mob)
|
||||
if (user.stat)
|
||||
return
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/emp_act(severity)
|
||||
if(prob(100/severity)) malfunction()
|
||||
..()
|
||||
|
||||
/obj/machinery/clonepod/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
user << text("The write-protect tab is set to [read_only ? "protected" : "unprotected"].")
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
circuit = /obj/item/weapon/circuitboard/rcon_console
|
||||
req_one_access = list(access_engine)
|
||||
var/current_tag = null
|
||||
var/list/known_SMESs = null
|
||||
var/list/known_breakers = null
|
||||
// Allows you to hide specific parts of the UI
|
||||
var/hide_SMES = 0
|
||||
var/hide_SMES_details = 0
|
||||
var/hide_breakers = 0
|
||||
var/obj/nano_module/rcon/rcon
|
||||
|
||||
/obj/machinery/computer/rcon/New()
|
||||
..()
|
||||
rcon = new(src)
|
||||
|
||||
// Proc: attack_hand()
|
||||
// Parameters: 1 (user - Person which clicked this computer)
|
||||
@@ -29,106 +28,5 @@
|
||||
// Proc: ui_interact()
|
||||
// Parameters: 4 (standard NanoUI parameters)
|
||||
// Description: Uses dark magic (NanoUI) to render this machine's UI
|
||||
/obj/machinery/computer/rcon/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
FindDevices() // Update our devices list
|
||||
var/data[0]
|
||||
|
||||
// SMES DATA (simplified view)
|
||||
var/list/smeslist[0]
|
||||
for(var/obj/machinery/power/smes/buildable/SMES in known_SMESs)
|
||||
smeslist.Add(list(list(
|
||||
"charge" = round(SMES.Percentage()),
|
||||
"input_set" = SMES.input_attempt,
|
||||
"input_val" = round(SMES.input_level),
|
||||
"output_set" = SMES.output_attempt,
|
||||
"output_val" = round(SMES.output_level),
|
||||
"output_load" = round(SMES.output_used),
|
||||
"RCON_tag" = SMES.RCon_tag
|
||||
)))
|
||||
|
||||
data["smes_info"] = sortByKey(smeslist, "RCON_tag")
|
||||
|
||||
// BREAKER DATA (simplified view)
|
||||
var/list/breakerlist[0]
|
||||
for(var/obj/machinery/power/breakerbox/BR in known_breakers)
|
||||
breakerlist.Add(list(list(
|
||||
"RCON_tag" = BR.RCon_tag,
|
||||
"enabled" = BR.on
|
||||
)))
|
||||
data["breaker_info"] = breakerlist
|
||||
data["hide_smes"] = hide_SMES
|
||||
data["hide_smes_details"] = hide_SMES_details
|
||||
data["hide_breakers"] = hide_breakers
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "rcon.tmpl", "RCON Console", 600, 400)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
// Proc: Topic()
|
||||
// Parameters: 2 (href, href_list - allows us to process UI clicks)
|
||||
// Description: Allows us to process UI clicks, which are relayed in form of hrefs.
|
||||
/obj/machinery/computer/rcon/Topic(href, href_list)
|
||||
if(href_list["smes_in_toggle"])
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(href_list["smes_in_toggle"])
|
||||
if(SMES)
|
||||
SMES.toggle_input()
|
||||
if(href_list["smes_out_toggle"])
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(href_list["smes_out_toggle"])
|
||||
if(SMES)
|
||||
SMES.toggle_output()
|
||||
if(href_list["smes_in_set"])
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(href_list["smes_in_set"])
|
||||
if(SMES)
|
||||
var/inputset = input(usr, "Enter new input level (0-[SMES.input_level_max])", "SMES Input Power Control") as num
|
||||
SMES.set_input(inputset)
|
||||
if(href_list["smes_out_set"])
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(href_list["smes_out_set"])
|
||||
if(SMES)
|
||||
var/outputset = input(usr, "Enter new output level (0-[SMES.output_level_max])", "SMES Input Power Control") as num
|
||||
SMES.set_output(outputset)
|
||||
|
||||
if(href_list["toggle_breaker"])
|
||||
var/obj/machinery/power/breakerbox/toggle = null
|
||||
for(var/obj/machinery/power/breakerbox/breaker in known_breakers)
|
||||
if(breaker.RCon_tag == href_list["toggle_breaker"])
|
||||
toggle = breaker
|
||||
if(toggle)
|
||||
if(toggle.update_locked)
|
||||
usr << "The breaker box was recently toggled. Please wait before toggling it again."
|
||||
else
|
||||
toggle.auto_toggle()
|
||||
if(href_list["hide_smes"])
|
||||
hide_SMES = !hide_SMES
|
||||
if(href_list["hide_smes_details"])
|
||||
hide_SMES_details = !hide_SMES_details
|
||||
if(href_list["hide_breakers"])
|
||||
hide_breakers = !hide_breakers
|
||||
|
||||
|
||||
// Proc: GetSMESByTag()
|
||||
// Parameters: 1 (tag - RCON tag of SMES we want to look up)
|
||||
// Description: Looks up and returns SMES which has matching RCON tag
|
||||
/obj/machinery/computer/rcon/proc/GetSMESByTag(var/tag)
|
||||
if(!tag)
|
||||
return
|
||||
|
||||
for(var/obj/machinery/power/smes/buildable/S in known_SMESs)
|
||||
if(S.RCon_tag == tag)
|
||||
return S
|
||||
|
||||
// Proc: FindDevices()
|
||||
// Parameters: None
|
||||
// Description: Refreshes local list of known devices.
|
||||
/obj/machinery/computer/rcon/proc/FindDevices()
|
||||
known_SMESs = new /list()
|
||||
for(var/obj/machinery/power/smes/buildable/SMES in machines)
|
||||
if(SMES.RCon_tag && (SMES.RCon_tag != "NO_TAG") && SMES.RCon)
|
||||
known_SMESs.Add(SMES)
|
||||
|
||||
known_breakers = new /list()
|
||||
for(var/obj/machinery/power/breakerbox/breaker in machines)
|
||||
if(breaker.RCon_tag != "NO_TAG")
|
||||
known_breakers.Add(breaker)
|
||||
/obj/machinery/computer/rcon/ui_interact(mob/user, ui_key = "rcon", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
rcon.ui_interact(user, ui_key, ui, force_open)
|
||||
|
||||
@@ -168,9 +168,15 @@
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You connect the monitor."
|
||||
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai ( loc, laws, brain )
|
||||
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
|
||||
A.rename_self("ai", 1)
|
||||
if(!brain)
|
||||
var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes"
|
||||
var/obj/structure/AIcore/deactivated/D = new(loc)
|
||||
if(open_for_latejoin)
|
||||
empty_playable_ai_cores += D
|
||||
else
|
||||
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai ( loc, laws, brain )
|
||||
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
|
||||
A.rename_self("ai", 1)
|
||||
feedback_inc("cyborg_ais_created",1)
|
||||
del(src)
|
||||
|
||||
@@ -207,14 +213,53 @@
|
||||
if (ai.mind == malfai)
|
||||
return 1
|
||||
|
||||
/obj/structure/AIcore/deactivated/attackby(var/obj/item/device/aicard/card, var/mob/user)
|
||||
/obj/structure/AIcore/deactivated/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
|
||||
if(istype(card))
|
||||
if(istype(W, /obj/item/device/aicard))
|
||||
var/obj/item/device/aicard/card = W
|
||||
var/mob/living/silicon/ai/transfer = locate() in card
|
||||
if(transfer)
|
||||
load_ai(transfer,card,user)
|
||||
else
|
||||
user << "\red <b>ERROR</b>: \black Unable to locate artificial intelligence."
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
if(anchored)
|
||||
user.visible_message("\blue \The [user] starts to unbolt \the [src] from the plating...")
|
||||
if(!do_after(user,40))
|
||||
user.visible_message("\blue \The [user] decides not to unbolt \the [src].")
|
||||
return
|
||||
user.visible_message("\blue \The [user] finishes unfastening \the [src]!")
|
||||
anchored = 0
|
||||
return
|
||||
else
|
||||
user.visible_message("\blue \The [user] starts to bolt \the [src] to the plating...")
|
||||
if(!do_after(user,40))
|
||||
user.visible_message("\blue \The [user] decides not to bolt \the [src].")
|
||||
return
|
||||
user.visible_message("\blue \The [user] finishes fastening down \the [src]!")
|
||||
anchored = 1
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
..()
|
||||
/client/proc/empty_ai_core_toggle_latejoin()
|
||||
set name = "Toggle AI Core Latejoin"
|
||||
set category = "Admin"
|
||||
|
||||
var/list/cores = list()
|
||||
for(var/obj/structure/AIcore/deactivated/D in world)
|
||||
cores["[D] ([D.loc.loc])"] = D
|
||||
|
||||
var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores
|
||||
if(!id) return
|
||||
|
||||
var/obj/structure/AIcore/deactivated/D = cores[id]
|
||||
if(!D) return
|
||||
|
||||
if(D in empty_playable_ai_cores)
|
||||
empty_playable_ai_cores -= D
|
||||
src << "\The [id] is now <font color=\"#ff0000\">not available</font> for latejoining AIs."
|
||||
else
|
||||
empty_playable_ai_cores += D
|
||||
src << "\The [id] is now <font color=\"#008000\">available</font> for latejoining AIs."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/obj/machinery/computer/arcade
|
||||
name = "arcade machine"
|
||||
desc = "Does not support Pin ball."
|
||||
desc = "Does not support pinball."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "arcade"
|
||||
circuit = "/obj/item/weapon/circuitboard/arcade"
|
||||
@@ -32,7 +32,10 @@
|
||||
/obj/item/toy/prize/mauler = 1,
|
||||
/obj/item/toy/prize/odysseus = 1,
|
||||
/obj/item/toy/prize/phazon = 1,
|
||||
/obj/item/toy/waterflower = 1
|
||||
/obj/item/toy/waterflower = 1,
|
||||
/obj/item/toy/figure = 1,
|
||||
/obj/random/plushie = 1,
|
||||
/obj/item/toy/cultsword = 1
|
||||
)
|
||||
|
||||
/obj/machinery/computer/arcade
|
||||
|
||||
@@ -1,116 +1,85 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
// Converting these to global lists may be a bit laggy when removal procs are called. Consider
|
||||
// rewriting this properly to fix the update bug, rather than unifying all monitors. ~Z
|
||||
|
||||
var/global/list/priority_air_alarms = list()
|
||||
var/global/list/minor_air_alarms = list()
|
||||
|
||||
|
||||
/obj/machinery/computer/atmos_alert
|
||||
name = "atmospheric alert computer"
|
||||
desc = "Used to access the station's atmospheric sensors."
|
||||
circuit = "/obj/item/weapon/circuitboard/atmos_alert"
|
||||
icon_state = "alert:0"
|
||||
var/receive_frequency = 1437
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
|
||||
/obj/machinery/computer/atmos_alert/initialize()
|
||||
/obj/machinery/computer/atmos_alert/New()
|
||||
..()
|
||||
set_frequency(receive_frequency)
|
||||
|
||||
/obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/zone = signal.data["zone"]
|
||||
var/severity = signal.data["alert"]
|
||||
|
||||
if(!zone || !severity) return
|
||||
|
||||
minor_air_alarms -= zone
|
||||
priority_air_alarms -= zone
|
||||
if(severity=="severe")
|
||||
priority_air_alarms |= zone
|
||||
else if (severity=="minor")
|
||||
minor_air_alarms |= zone
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/atmos_alert/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, receive_frequency)
|
||||
receive_frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, receive_frequency, RADIO_ATMOSIA)
|
||||
|
||||
atmosphere_alarm.register(src, /obj/machinery/computer/station_alert/update_icon)
|
||||
|
||||
/obj/machinery/computer/atmos_alert/Del()
|
||||
atmosphere_alarm.unregister(src)
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/atmos_alert/attack_hand(mob/user)
|
||||
if(..(user))
|
||||
return
|
||||
user << browse(return_text(),"window=computer")
|
||||
user.set_machine(src)
|
||||
onclose(user, "computer")
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/atmos_alert/process()
|
||||
if(..())
|
||||
src.updateDialog()
|
||||
/obj/machinery/computer/atmos_alert/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
var/major_alarms[0]
|
||||
var/minor_alarms[0]
|
||||
|
||||
for(var/datum/alarm/alarm in atmosphere_alarm.major_alarms())
|
||||
major_alarms[++major_alarms.len] = list("name" = sanitize(alarm.alarm_name()), "ref" = "\ref[alarm]")
|
||||
|
||||
for(var/datum/alarm/alarm in atmosphere_alarm.minor_alarms())
|
||||
minor_alarms[++minor_alarms.len] = list("name" = sanitize(alarm.alarm_name()), "ref" = "\ref[alarm]")
|
||||
|
||||
data["priority_alarms"] = major_alarms
|
||||
data["minor_alarms"] = minor_alarms
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "atmos_alert.tmpl", src.name, 500, 500)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/atmos_alert/update_icon()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(priority_air_alarms.len)
|
||||
var/list/alarms = atmosphere_alarm.major_alarms()
|
||||
if(alarms.len)
|
||||
icon_state = "alert:2"
|
||||
|
||||
else if(minor_air_alarms.len)
|
||||
icon_state = "alert:1"
|
||||
|
||||
else
|
||||
icon_state = "alert:0"
|
||||
alarms = atmosphere_alarm.minor_alarms()
|
||||
if(alarms.len)
|
||||
icon_state = "alert:1"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/atmos_alert/proc/return_text()
|
||||
var/priority_text
|
||||
var/minor_text
|
||||
|
||||
if(priority_air_alarms.len)
|
||||
for(var/zone in priority_air_alarms)
|
||||
priority_text += "<FONT color='red'><B>[zone]</B></FONT> <A href='?src=\ref[src];priority_clear=[ckey(zone)]'>X</A><BR>"
|
||||
else
|
||||
priority_text = "No priority alerts detected.<BR>"
|
||||
|
||||
if(minor_air_alarms.len)
|
||||
for(var/zone in minor_air_alarms)
|
||||
minor_text += "<B>[zone]</B> <A href='?src=\ref[src];minor_clear=[ckey(zone)]'>X</A><BR>"
|
||||
else
|
||||
minor_text = "No minor alerts detected.<BR>"
|
||||
|
||||
var/output = {"<B>[name]</B><HR>
|
||||
<B>Priority Alerts:</B><BR>
|
||||
[priority_text]
|
||||
<BR>
|
||||
<HR>
|
||||
<B>Minor Alerts:</B><BR>
|
||||
[minor_text]
|
||||
<BR>"}
|
||||
|
||||
return output
|
||||
|
||||
|
||||
/obj/machinery/computer/atmos_alert/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
return 1
|
||||
|
||||
if(href_list["priority_clear"])
|
||||
var/removing_zone = href_list["priority_clear"]
|
||||
for(var/zone in priority_air_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
priority_air_alarms -= zone
|
||||
if(href_list["clear_alarm"])
|
||||
var/datum/alarm/alarm = locate(href_list["clear_alarm"]) in atmosphere_alarm.alarms
|
||||
if(alarm)
|
||||
for(var/datum/alarm_source/alarm_source in alarm.sources)
|
||||
var/obj/machinery/alarm/air_alarm = alarm_source.source
|
||||
if(istype(air_alarm))
|
||||
var/list/new_ref = list("atmos_reset" = 1)
|
||||
air_alarm.Topic(href, new_ref, custom_state = atmos_alert_topic)
|
||||
return 1
|
||||
|
||||
if(href_list["minor_clear"])
|
||||
var/removing_zone = href_list["minor_clear"]
|
||||
for(var/zone in minor_air_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
minor_air_alarms -= zone
|
||||
update_icon()
|
||||
return
|
||||
|
||||
var/datum/topic_state/atmos_alert/atmos_alert_topic = new()
|
||||
|
||||
/datum/topic_state/atmos_alert
|
||||
flags = NANO_IGNORE_DISTANCE
|
||||
|
||||
/datum/topic_state/air_alarm/href_list(var/mob/user)
|
||||
var/list/extra_href = list()
|
||||
extra_href["remote_connection"] = 1
|
||||
extra_href["remote_access"] = 1
|
||||
|
||||
return extra_href
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
circuit = "/obj/item/weapon/circuitboard/atmoscontrol"
|
||||
var/obj/machinery/alarm/current
|
||||
var/overridden = 0 //not set yet, can't think of a good way to do it
|
||||
req_access = list(access_ce)
|
||||
var/list/monitored_alarm_ids = null
|
||||
var/list/monitored_alarms = null
|
||||
var/ui_ref
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/laptop
|
||||
name = "Atmospherics Laptop"
|
||||
@@ -32,36 +32,29 @@
|
||||
monitored_alarms = dd_sortedObjectList(monitored_alarms)
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob)
|
||||
return interact(user)
|
||||
return ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
return interact(user)
|
||||
return ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
if(allowed(user))
|
||||
overridden = 1
|
||||
else if(!emagged)
|
||||
overridden = 0
|
||||
var/dat = "<a href='?src=\ref[src]&reset=1'>Main Menu</a><hr>"
|
||||
if(monitored_alarms && monitored_alarms.len == 1)
|
||||
current = monitored_alarms[1]
|
||||
if(current)
|
||||
dat += specific()
|
||||
else
|
||||
for(var/obj/machinery/alarm/alarm in monitored_alarms ? monitored_alarms : machines)
|
||||
dat += "<a href='?src=\ref[src]&alarm=\ref[alarm]'>"
|
||||
switch(max(alarm.danger_level, alarm.alarm_area.atmosalm))
|
||||
if (0)
|
||||
dat += "<font color=green>"
|
||||
if (1)
|
||||
dat += "<font color=blue>"
|
||||
if (2)
|
||||
dat += "<font color=red>"
|
||||
dat += "[sanitize(alarm.name)]</font></a><br/>"
|
||||
user << browse(dat, "window=atmoscontrol")
|
||||
/obj/machinery/computer/atmoscontrol/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
var/alarms[0]
|
||||
|
||||
// TODO: Move these to a cache, similar to cameras
|
||||
for(var/obj/machinery/alarm/alarm in (monitored_alarms ? monitored_alarms : machines))
|
||||
alarms[++alarms.len] = list("name" = sanitize(alarm.name), "ref"= "\ref[alarm]", "danger" = max(alarm.danger_level, alarm.alarm_area.atmosalm))
|
||||
data["alarms"] = alarms
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 625, 625)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
ui_ref = ui
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/attackby(var/obj/item/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/card/emag) && !emagged)
|
||||
@@ -73,23 +66,33 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/proc/specific()
|
||||
if(!current)
|
||||
return ""
|
||||
var/dat = "<h3>[current.name]</h3><hr>"
|
||||
dat += current.return_status()
|
||||
if(current.remote_control || overridden)
|
||||
dat += "<hr>[current.return_controls(src)]"
|
||||
return dat
|
||||
|
||||
//a bunch of this is copied from atmos alarms
|
||||
/obj/machinery/computer/atmoscontrol/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["reset"])
|
||||
current = null
|
||||
return 1
|
||||
|
||||
if(href_list["alarm"])
|
||||
current = locate(href_list["alarm"])
|
||||
else if(current)
|
||||
current.Topic(href, href_list, 1, 1)
|
||||
interact(usr)
|
||||
if(ui_ref)
|
||||
var/obj/machinery/alarm/alarm = locate(href_list["alarm"]) in (monitored_alarms ? monitored_alarms : machines)
|
||||
if(alarm)
|
||||
var/datum/topic_state/TS = generate_state(alarm)
|
||||
alarm.ui_interact(usr, master_ui = ui_ref, custom_state = TS)
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/proc/generate_state(var/alarm)
|
||||
var/datum/topic_state/air_alarm/state = new()
|
||||
state.atmos_control = src
|
||||
state.air_alarm = alarm
|
||||
return state
|
||||
|
||||
/datum/topic_state/air_alarm
|
||||
flags = NANO_IGNORE_DISTANCE
|
||||
var/obj/machinery/computer/atmoscontrol/atmos_control = null
|
||||
var/obj/machinery/alarm/air_alarm = null
|
||||
|
||||
/datum/topic_state/air_alarm/href_list(var/mob/user)
|
||||
var/list/extra_href = list()
|
||||
extra_href["remote_connection"] = 1
|
||||
extra_href["remote_access"] = user && (atmos_control.allowed(user) || atmos_control.emagged || air_alarm.rcon_setting == RCON_YES || (air_alarm.alarm_area.atmosalm && air_alarm.rcon_setting == RCON_AUTO))
|
||||
|
||||
return extra_href
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
/proc/invalidateCameraCache()
|
||||
for(var/obj/machinery/computer/security/s in world)
|
||||
s.camera_cache = null
|
||||
for(var/datum/alarm/A in world)
|
||||
A.cameras = null
|
||||
|
||||
/obj/machinery/computer/security
|
||||
name = "security camera monitor"
|
||||
@@ -15,7 +17,6 @@
|
||||
circuit = /obj/item/weapon/circuitboard/security
|
||||
var/camera_cache = null
|
||||
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
@@ -23,7 +24,7 @@
|
||||
if (user.stat || ((get_dist(user, src) > 1 || !( user.canmove ) || user.blinded) && !istype(user, /mob/living/silicon))) //user can't see - not sure why canmove is here.
|
||||
return null
|
||||
if ( !current || !current.can_use() ) //camera doesn't work
|
||||
current = null
|
||||
reset_current()
|
||||
user.reset_view(current)
|
||||
return 1
|
||||
|
||||
@@ -44,33 +45,17 @@
|
||||
if(!can_access_camera(C))
|
||||
continue
|
||||
|
||||
var/cam[0]
|
||||
cam["name"] = sanitize(C.c_tag)
|
||||
cam["deact"] = !C.can_use()
|
||||
cam["camera"] = "\ref[C]"
|
||||
cam["x"] = C.x
|
||||
cam["y"] = C.y
|
||||
cam["z"] = C.z
|
||||
|
||||
var/cam = C.nano_structure()
|
||||
cameras[++cameras.len] = cam
|
||||
|
||||
if(C == current)
|
||||
data["current"] = cam
|
||||
|
||||
var/list/camera_list = list("cameras" = cameras)
|
||||
camera_cache=list2json(camera_list)
|
||||
|
||||
var/list/camera_list = list("cameras" = cameras)
|
||||
camera_cache=list2json(camera_list)
|
||||
else
|
||||
if(current)
|
||||
var/cam[0]
|
||||
cam["name"] = current.c_tag
|
||||
cam["deact"] = !current.can_use()
|
||||
cam["camera"] = "\ref[current]"
|
||||
cam["x"] = current.x
|
||||
cam["y"] = current.y
|
||||
cam["z"] = current.z
|
||||
|
||||
data["current"] = cam
|
||||
data["current"] = current.nano_structure()
|
||||
|
||||
|
||||
if(ui)
|
||||
@@ -102,7 +87,7 @@
|
||||
else if(href_list["reset"])
|
||||
if(src.z>6 || stat&(NOPOWER|BROKEN)) return
|
||||
if(usr.stat || ((get_dist(usr, src) > 1 || !( usr.canmove ) || usr.blinded) && !istype(usr, /mob/living/silicon))) return
|
||||
current = null
|
||||
reset_current()
|
||||
usr.check_eye(current)
|
||||
return 1
|
||||
else
|
||||
@@ -128,13 +113,17 @@
|
||||
//don't need to check if the camera works for AI because the AI jumps to the camera location and doesn't actually look through cameras.
|
||||
if(isAI(user))
|
||||
var/mob/living/silicon/ai/A = user
|
||||
// Only allow non-carded AIs to view because the interaction with the eye gets all wonky otherwise.
|
||||
if(!A.is_in_chassis())
|
||||
return 0
|
||||
|
||||
A.eyeobj.setLoc(get_turf(C))
|
||||
A.client.eye = A.eyeobj
|
||||
return 1
|
||||
|
||||
if (!C.can_use() || user.stat || (get_dist(user, src) > 1 || user.machine != src || user.blinded || !( user.canmove ) && !istype(user, /mob/living/silicon)))
|
||||
return 0
|
||||
src.current = C
|
||||
set_current(C)
|
||||
check_eye(user)
|
||||
use_power(50)
|
||||
return 1
|
||||
@@ -168,6 +157,27 @@
|
||||
return
|
||||
if(can_access_camera(jump_to))
|
||||
switch_to_camera(user,jump_to)
|
||||
|
||||
/obj/machinery/computer/security/proc/set_current(var/obj/machinery/camera/C)
|
||||
if(current == C)
|
||||
return
|
||||
|
||||
if(current)
|
||||
reset_current()
|
||||
|
||||
src.current = C
|
||||
if(current)
|
||||
var/mob/living/L = current.loc
|
||||
if(istype(L))
|
||||
L.tracking_initiated()
|
||||
|
||||
/obj/machinery/computer/security/proc/reset_current()
|
||||
if(current)
|
||||
var/mob/living/L = current.loc
|
||||
if(istype(L))
|
||||
L.tracking_cancelled()
|
||||
current = null
|
||||
|
||||
//Camera control: mouse.
|
||||
/atom/DblClick()
|
||||
..()
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
if(message_cooldown)
|
||||
usr << "Please allow at least one minute to pass between announcements"
|
||||
return
|
||||
var/input = stripped_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
|
||||
var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
|
||||
if(!input || !(usr in view(1,src)))
|
||||
return
|
||||
crew_announcement.Announce(input)
|
||||
|
||||
@@ -101,6 +101,20 @@
|
||||
return text
|
||||
|
||||
|
||||
/obj/machinery/computer/attack_ghost(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/attack_hand(user as mob)
|
||||
/* Observers can view computers, but not actually use them via Topic*/
|
||||
if(istype(user, /mob/dead/observer)) return 0
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/Topic(href, href_list)
|
||||
/* Can't use topic as observer by default */
|
||||
if(istype(usr, /mob/dead/observer)) return 0
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/computer/attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
idle_power_usage = 250
|
||||
active_power_usage = 500
|
||||
circuit = "/obj/item/weapon/circuitboard/crew"
|
||||
var/list/tracked = list( )
|
||||
|
||||
var/obj/nano_module/crew_monitor/crew_monitor
|
||||
|
||||
/obj/machinery/computer/crew/New()
|
||||
tracked = list()
|
||||
crew_monitor = new(src)
|
||||
..()
|
||||
|
||||
|
||||
@@ -25,6 +24,8 @@
|
||||
return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/crew/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
crew_monitor.ui_interact(user, ui_key, ui, force_open)
|
||||
|
||||
/obj/machinery/computer/crew/update_icon()
|
||||
|
||||
@@ -38,90 +39,5 @@
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
|
||||
|
||||
/obj/machinery/computer/crew/Topic(href, href_list)
|
||||
if(..()) return
|
||||
if (src.z > 6)
|
||||
usr << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
|
||||
return 0
|
||||
if( href_list["close"] )
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
usr.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
if(href_list["update"])
|
||||
src.updateDialog()
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/crew/interact(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/crew/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
user.set_machine(src)
|
||||
src.scan()
|
||||
|
||||
var/data[0]
|
||||
var/list/crewmembers = list()
|
||||
|
||||
for(var/obj/item/clothing/under/C in src.tracked)
|
||||
|
||||
|
||||
var/turf/pos = get_turf(C)
|
||||
|
||||
if((C) && (C.has_sensor) && (pos) && (pos.z == src.z) && C.sensor_mode)
|
||||
if(istype(C.loc, /mob/living/carbon/human))
|
||||
|
||||
var/mob/living/carbon/human/H = C.loc
|
||||
if(H.w_uniform != C)
|
||||
continue
|
||||
|
||||
var/list/crewmemberData = list()
|
||||
|
||||
crewmemberData["sensor_type"] = C.sensor_mode
|
||||
crewmemberData["dead"] = H.stat > 1
|
||||
crewmemberData["oxy"] = round(H.getOxyLoss(), 1)
|
||||
crewmemberData["tox"] = round(H.getToxLoss(), 1)
|
||||
crewmemberData["fire"] = round(H.getFireLoss(), 1)
|
||||
crewmemberData["brute"] = round(H.getBruteLoss(), 1)
|
||||
|
||||
crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown")
|
||||
crewmemberData["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job")
|
||||
crewmemberData["assignment"] = H.get_assignment(if_no_id="Unknown", if_no_job="No Job")
|
||||
|
||||
var/area/A = get_area(H)
|
||||
crewmemberData["area"] = sanitize(A.name)
|
||||
crewmemberData["x"] = pos.x
|
||||
crewmemberData["y"] = pos.y
|
||||
|
||||
crewmembers[++crewmembers.len] = crewmemberData
|
||||
|
||||
crewmembers = sortByKey(crewmembers, "name")
|
||||
|
||||
data["crewmembers"] = crewmembers
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800)
|
||||
|
||||
// adding a template with the key "mapContent" enables the map ui functionality
|
||||
ui.add_template("mapContent", "crew_monitor_map_content.tmpl")
|
||||
// adding a template with the key "mapHeader" replaces the map header content
|
||||
ui.add_template("mapHeader", "crew_monitor_map_header.tmpl")
|
||||
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
// should make the UI auto-update; doesn't seem to?
|
||||
ui.set_auto_update(1)
|
||||
|
||||
|
||||
/obj/machinery/computer/crew/proc/scan()
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
if(istype(H.w_uniform, /obj/item/clothing/under))
|
||||
var/obj/item/clothing/under/C = H.w_uniform
|
||||
if (C.has_sensor)
|
||||
tracked |= C
|
||||
return 1
|
||||
crew_monitor.ui_interact(user)
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/machinery/computer/hologram_comp
|
||||
name = "hologram computer"
|
||||
desc = "Rumoured to control holograms."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "holo_console0"
|
||||
var/obj/machinery/hologram/projector/projector = null
|
||||
var/temp = null
|
||||
var/lumens = 0.0
|
||||
var/h_r = 245.0
|
||||
var/h_g = 245.0
|
||||
var/h_b = 245.0
|
||||
|
||||
|
||||
/obj/machinery/computer/hologram_comp/New()
|
||||
..()
|
||||
spawn( 10 )
|
||||
src.projector = locate(/obj/machinery/hologram/projector, get_step(src.loc, NORTH))
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/computer/hologram_comp/DblClick()
|
||||
if (!in_range(src, usr))
|
||||
return 0
|
||||
src.show_console(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/hologram_comp/proc/render()
|
||||
var/icon/I = new /icon('icons/mob/human.dmi', "body_m_s")
|
||||
|
||||
if (src.lumens >= 0)
|
||||
I.Blend(rgb(src.lumens, src.lumens, src.lumens), ICON_ADD)
|
||||
else
|
||||
I.Blend(rgb(- src.lumens, -src.lumens, -src.lumens), ICON_SUBTRACT)
|
||||
|
||||
I.Blend(new /icon('icons/mob/human.dmi', "mouth_m_s"), ICON_OVERLAY)
|
||||
I.Blend(new /icon('icons/mob/human.dmi', "underwear1_m_s"), ICON_OVERLAY)
|
||||
|
||||
var/icon/U = new /icon('icons/mob/human_face.dmi', "hair_a_s")
|
||||
U.Blend(rgb(src.h_r, src.h_g, src.h_b), ICON_ADD)
|
||||
|
||||
I.Blend(U, ICON_OVERLAY)
|
||||
|
||||
src.projector.hologram.icon = I
|
||||
|
||||
/obj/machinery/computer/hologram_comp/proc/show_console(var/mob/user as mob)
|
||||
var/dat
|
||||
user.set_machine(src)
|
||||
if (src.temp)
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];temp=1'>Clear</A>", src.temp, src)
|
||||
else
|
||||
dat = text("<B>Hologram Status:</B><HR>\nPower: <A href='?src=\ref[];power=1'>[]</A><HR>\n<B>Hologram Control:</B><BR>\nColor Luminosity: []/220 <A href='?src=\ref[];reset=1'>\[Reset\]</A><BR>\nLighten: <A href='?src=\ref[];light=1'>1</A> <A href='?src=\ref[];light=10'>10</A><BR>\nDarken: <A href='?src=\ref[];light=-1'>1</A> <A href='?src=\ref[];light=-10'>10</A><BR>\n<BR>\nHair Color: ([],[],[]) <A href='?src=\ref[];h_reset=1'>\[Reset\]</A><BR>\nRed (0-255): <A href='?src=\ref[];h_r=-300'>\[0\]</A> <A href='?src=\ref[];h_r=-10'>-10</A> <A href='?src=\ref[];h_r=-1'>-1</A> [] <A href='?src=\ref[];h_r=1'>1</A> <A href='?src=\ref[];h_r=10'>10</A> <A href='?src=\ref[];h_r=300'>\[255\]</A><BR>\nGreen (0-255): <A href='?src=\ref[];h_g=-300'>\[0\]</A> <A href='?src=\ref[];h_g=-10'>-10</A> <A href='?src=\ref[];h_g=-1'>-1</A> [] <A href='?src=\ref[];h_g=1'>1</A> <A href='?src=\ref[];h_g=10'>10</A> <A href='?src=\ref[];h_g=300'>\[255\]</A><BR>\nBlue (0-255): <A href='?src=\ref[];h_b=-300'>\[0\]</A> <A href='?src=\ref[];h_b=-10'>-10</A> <A href='?src=\ref[];h_b=-1'>-1</A> [] <A href='?src=\ref[];h_b=1'>1</A> <A href='?src=\ref[];h_b=10'>10</A> <A href='?src=\ref[];h_b=300'>\[255\]</A><BR>", src, (src.projector.hologram ? "On" : "Off"), -src.lumens + 35, src, src, src, src, src, src.h_r, src.h_g, src.h_b, src, src, src, src, src.h_r, src, src, src, src, src, src, src.h_g, src, src, src, src, src, src, src.h_b, src, src, src)
|
||||
user << browse(dat, "window=hologram_console")
|
||||
onclose(user, "hologram_console")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/hologram_comp/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if (in_range(src, usr))
|
||||
flick("holo_console1", src)
|
||||
if (href_list["power"])
|
||||
if (src.projector.hologram)
|
||||
src.projector.icon_state = "hologram0"
|
||||
//src.projector.hologram = null
|
||||
del(src.projector.hologram)
|
||||
else
|
||||
src.projector.hologram = new(src.projector.loc)
|
||||
src.projector.hologram.icon = 'icons/mob/human.dmi'
|
||||
src.projector.hologram.icon_state = "body_m_s"
|
||||
src.projector.icon_state = "hologram1"
|
||||
src.render()
|
||||
else
|
||||
if (href_list["h_r"])
|
||||
if (src.projector.hologram)
|
||||
src.h_r += text2num(href_list["h_r"])
|
||||
src.h_r = min(max(src.h_r, 0), 255)
|
||||
render()
|
||||
else
|
||||
if (href_list["h_g"])
|
||||
if (src.projector.hologram)
|
||||
src.h_g += text2num(href_list["h_g"])
|
||||
src.h_g = min(max(src.h_g, 0), 255)
|
||||
render()
|
||||
else
|
||||
if (href_list["h_b"])
|
||||
if (src.projector.hologram)
|
||||
src.h_b += text2num(href_list["h_b"])
|
||||
src.h_b = min(max(src.h_b, 0), 255)
|
||||
render()
|
||||
else
|
||||
if (href_list["light"])
|
||||
if (src.projector.hologram)
|
||||
src.lumens += text2num(href_list["light"])
|
||||
src.lumens = min(max(src.lumens, -185.0), 35)
|
||||
render()
|
||||
else
|
||||
if (href_list["reset"])
|
||||
if (src.projector.hologram)
|
||||
src.lumens = 0
|
||||
render()
|
||||
else
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.show_console(M)
|
||||
return
|
||||
@@ -50,7 +50,9 @@
|
||||
else
|
||||
usr << "[src.current.name] selected for law changes."
|
||||
return
|
||||
|
||||
|
||||
attack_ghost(user as mob)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/borgupload
|
||||
@@ -83,3 +85,6 @@
|
||||
else
|
||||
usr << "[src.current.name] selected for law changes."
|
||||
return
|
||||
|
||||
attack_ghost(user as mob)
|
||||
return 1
|
||||
|
||||
@@ -534,7 +534,7 @@ What a mess.*/
|
||||
if ("Change Criminal Status")
|
||||
if (active2)
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
H.hud_updateflag |= 1 << WANTED_HUD
|
||||
BITSET(H.hud_updateflag, WANTED_HUD)
|
||||
switch(href_list["criminal2"])
|
||||
if("none")
|
||||
active2.fields["criminal"] = "None"
|
||||
@@ -612,4 +612,4 @@ What a mess.*/
|
||||
|
||||
/obj/machinery/computer/secure_data/detective_computer
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "messyfiles"
|
||||
icon_state = "messyfiles"
|
||||
|
||||
@@ -5,106 +5,42 @@
|
||||
icon_state = "alert:0"
|
||||
circuit = "/obj/item/weapon/circuitboard/stationalert"
|
||||
var/alarms = list("Fire"=list(), "Atmosphere"=list(), "Power"=list())
|
||||
var/obj/nano_module/alarm_monitor/engineering/alarm_monitor
|
||||
|
||||
/obj/machinery/computer/station_alert/New()
|
||||
..()
|
||||
alarm_monitor = new(src)
|
||||
alarm_monitor.register(src, /obj/machinery/computer/station_alert/update_icon)
|
||||
|
||||
attack_ai(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
/obj/machinery/computer/station_alert/Del()
|
||||
alarm_monitor.unregister(src)
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/station_alert/attack_ai(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/station_alert/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/station_alert/interact(mob/user)
|
||||
alarm_monitor.ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/station_alert/update_icon()
|
||||
..()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
return
|
||||
|
||||
|
||||
interact(mob/user)
|
||||
usr.set_machine(src)
|
||||
var/dat = "<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
|
||||
dat += "<A HREF='?src=\ref[user];mach_close=alerts'>Close</A><br><br>"
|
||||
for (var/cat in src.alarms)
|
||||
dat += text("<B>[]</B><BR>\n", cat)
|
||||
var/list/L = src.alarms[cat]
|
||||
if (L.len)
|
||||
for (var/alarm in L)
|
||||
var/list/alm = L[alarm]
|
||||
var/area/A = alm[1]
|
||||
var/list/sources = alm[3]
|
||||
dat += "<NOBR>"
|
||||
dat += "• "
|
||||
dat += "[A.name]"
|
||||
if (sources.len > 1)
|
||||
dat += text(" - [] sources", sources.len)
|
||||
dat += "</NOBR><BR>\n"
|
||||
else
|
||||
dat += "-- All Systems Nominal<BR>\n"
|
||||
dat += "<BR>\n"
|
||||
user << browse(dat, "window=alerts")
|
||||
onclose(user, "alerts")
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
var/list/L = src.alarms[class]
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/sources = alarm[3]
|
||||
if (!(alarmsource in sources))
|
||||
sources += alarmsource
|
||||
return 1
|
||||
var/obj/machinery/camera/C = null
|
||||
var/list/CL = null
|
||||
if (O && istype(O, /list))
|
||||
CL = O
|
||||
if (CL.len == 1)
|
||||
C = CL[1]
|
||||
else if (O && istype(O, /obj/machinery/camera))
|
||||
C = O
|
||||
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
|
||||
return 1
|
||||
|
||||
|
||||
proc/cancelAlarm(var/class, area/A as area, obj/origin)
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
var/list/L = src.alarms[class]
|
||||
var/cleared = 0
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/srcs = alarm[3]
|
||||
if (origin in srcs)
|
||||
srcs -= origin
|
||||
if (srcs.len == 0)
|
||||
cleared = 1
|
||||
L -= I
|
||||
return !cleared
|
||||
|
||||
|
||||
process()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "atmos0"
|
||||
return
|
||||
var/active_alarms = 0
|
||||
for (var/cat in src.alarms)
|
||||
var/list/L = src.alarms[cat]
|
||||
if(L.len) active_alarms = 1
|
||||
if(active_alarms)
|
||||
icon_state = "alert:2"
|
||||
else
|
||||
icon_state = "alert:0"
|
||||
..()
|
||||
return
|
||||
var/list/alarms = alarm_monitor.active_alarms()
|
||||
if(alarms.len)
|
||||
icon_state = "alert:2"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
return
|
||||
|
||||
@@ -123,6 +123,12 @@
|
||||
desc = "Monitors the prison."
|
||||
networks = list("Prison")
|
||||
|
||||
/datum/file/camnet_key/syndicate
|
||||
name = "Camera Network Key"
|
||||
title = "%!#BUFFER OVERFLOW"
|
||||
desc = "Connects to security cameras."
|
||||
networks = list("SS13")
|
||||
hidden_file = 1
|
||||
|
||||
|
||||
/*
|
||||
@@ -174,7 +180,7 @@
|
||||
|
||||
/datum/file/program/security
|
||||
name = "camera monitor"
|
||||
desc = "Connets to the Nanotrasen Camera Network"
|
||||
desc = "Connects to the Nanotrasen Camera Network"
|
||||
image = 'icons/ntos/camera.png'
|
||||
active_state = "camera-static"
|
||||
|
||||
@@ -200,7 +206,7 @@
|
||||
|
||||
Reset()
|
||||
..()
|
||||
current = null
|
||||
reset_current()
|
||||
for(var/mob/living/L in viewers(1))
|
||||
if(!istype(L,/mob/living/silicon/ai) && L.machine == src)
|
||||
L.reset_view(null)
|
||||
@@ -259,24 +265,80 @@
|
||||
if("show" in href_list)
|
||||
var/obj/machinery/camera/C = locate(href_list["show"])
|
||||
if(istype(C) && C.status)
|
||||
current = C
|
||||
set_current(C)
|
||||
usr.reset_view(C)
|
||||
interact()
|
||||
return
|
||||
|
||||
if("keyselect" in href_list)
|
||||
current = null
|
||||
reset_current()
|
||||
usr.reset_view(null)
|
||||
key = input(usr,"Select a camera network key:", "Key Select", null) as null|anything in computer.list_files(/datum/file/camnet_key)
|
||||
camera_list = null
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
select_key(key)
|
||||
if(key)
|
||||
interact()
|
||||
else
|
||||
usr << "The screen turns to static."
|
||||
return
|
||||
|
||||
/datum/file/program/security/proc/select_key(var/selected_key)
|
||||
key = selected_key
|
||||
camera_list = null
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
|
||||
/datum/file/program/security/proc/set_current(var/obj/machinery/camera/C)
|
||||
if(current == C)
|
||||
return
|
||||
|
||||
if(current)
|
||||
reset_current()
|
||||
|
||||
src.current = C
|
||||
if(current)
|
||||
var/mob/living/L = current.loc
|
||||
if(istype(L))
|
||||
L.tracking_initiated()
|
||||
|
||||
/datum/file/program/security/proc/reset_current()
|
||||
if(current)
|
||||
var/mob/living/L = current.loc
|
||||
if(istype(L))
|
||||
L.tracking_cancelled()
|
||||
current = null
|
||||
|
||||
// Atlantis: Required for camnetkeys to work.
|
||||
/datum/file/program/security/hidden
|
||||
hidden_file = 1
|
||||
|
||||
/*
|
||||
Camera monitoring program
|
||||
|
||||
Works much as the parent program, except:
|
||||
* It requires a camera to be found using the proximity network card.
|
||||
* It begins with all cam-access.
|
||||
*/
|
||||
|
||||
/datum/file/program/security/syndicate
|
||||
name = "camer# moni!%r"
|
||||
desc = "Cons the Nanotrash Camera Network"
|
||||
var/special_key = new/datum/file/camnet_key/syndicate
|
||||
var/camera_conn = null
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
if(!computer.net)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
camera_conn = computer.net.connect_to(/obj/machinery/camera,camera_conn)
|
||||
|
||||
if(!camera_conn)
|
||||
computer.Crash(NETWORK_FAILURE)
|
||||
return
|
||||
|
||||
// On interact, override camera key selection
|
||||
select_key(special_key)
|
||||
..()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user