Merge remote-tracking branch 'bay12-upstream/master' into development

This commit is contained in:
skull132
2016-10-07 00:58:39 +03:00
1594 changed files with 53994 additions and 48590 deletions
+1
View File
@@ -8,5 +8,6 @@ Thumbs.db
*.backup
data/
cfg/
build_log.txt
/.atom-build.json
+14 -6
View File
@@ -1,10 +1,10 @@
#pretending we're C because otherwise ruby will initialize, even with "language: dm".
language: c
language: generic
sudo: false
env:
BYOND_MAJOR="510"
BYOND_MINOR="1346"
MACRO_COUNT=1021
cache:
directories:
@@ -16,8 +16,6 @@ addons:
- libc6-i386
- libgcc1:i386
- libstdc++6:i386
- python
- python-pip
install:
- pip install --user PyYaml -q
@@ -31,8 +29,18 @@ script:
- shopt -s globstar
- (! grep 'step_[xy]' maps/**/*.dmm)
- (! find nano/templates/ -type f -exec md5sum {} + | sort | uniq -D -w 32 | grep nano)
- (! grep -E "<\s*span\s+class\s*=\s*('[^'>]+|[^'>]+')\s*>" **/*.dm)
- (num=`grep -E '\\\\(red|blue|green|black|b|i[^mc])' **/*.dm | wc -l`; echo "$num escapes (expecting ${MACRO_COUNT} or less)"; [ $num -le ${MACRO_COUNT} ])
- awk -f tools/indentation.awk **/*.dm
- md5sum -c - <<< "0af969f671fba6cf9696c78cd175a14a *baystation12.int"
- md5sum -c - <<< "88490b460c26947f5ec1ab1bb9fa9f17 *html/changelogs/example.yml"
- python tools/GenerateChangelog/ss13_genchangelog.py html/changelog.html html/changelogs
- python tools/TagMatcher/tag-matcher.py ../..
- python tools/GenerateChangelog/ss13_genchangelog.py html/changelog.html html/changelogs --dry-run
- source $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin/byondsetup
- DreamMaker baystation12.dme
- cp config/example/* config/
- scripts/dm.sh -DUNIT_TEST baystation12.dme
- grep "0 warnings" build_log.txt
- DreamDaemon baystation12.dmb -invisible -trusted -core 2>&1 | tee log.txt
- grep "All Unit Tests Passed" log.txt
- (! grep "runtime error:" log.txt)
- (! grep 'Process scheduler caught exception processing' log.txt)
+298 -93
View File
@@ -10,33 +10,53 @@
#define DEBUG
// END_PREFERENCES
// BEGIN_INCLUDE
#include "code\_macros.dm"
#include "code\global.dm"
#include "code\hub.dm"
#include "code\names.dm"
#include "code\setup.dm"
#include "code\stylesheet.dm"
#include "code\world.dm"
#include "code\__defines\_compile_options.dm"
#include "code\__defines\admin.dm"
#include "code\__defines\atmos.dm"
#include "code\__defines\btime.dm"
#include "code\__defines\chemistry.dm"
#include "code\__defines\damage_organs.dm"
#include "code\__defines\dna.dm"
#include "code\__defines\gamemode.dm"
#include "code\__defines\items_clothing.dm"
#include "code\__defines\lighting.dm"
#include "code\__defines\machinery.dm"
#include "code\__defines\math_physics.dm"
#include "code\__defines\misc.dm"
#include "code\__defines\mobs.dm"
#include "code\__defines\process_scheduler.dm"
#include "code\__HELPERS\datum_pool.dm"
#include "code\__HELPERS\files.dm"
#include "code\__HELPERS\game.dm"
#include "code\__HELPERS\global_lists.dm"
#include "code\__HELPERS\icons.dm"
#include "code\__HELPERS\lists.dm"
#include "code\__HELPERS\logging.dm"
#include "code\__HELPERS\maths.dm"
#include "code\__HELPERS\matrices.dm"
#include "code\__HELPERS\mobs.dm"
#include "code\__HELPERS\names.dm"
#include "code\__HELPERS\sanitize_values.dm"
#include "code\__HELPERS\text.dm"
#include "code\__HELPERS\time.dm"
#include "code\__HELPERS\turfs.dm"
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\__HELPERS\vector.dm"
#include "code\_defines\chemical_effects.dm"
#include "code\__defines\research.dm"
#include "code\__defines\species_languages.dm"
#include "code\__defines\targeting.dm"
#include "code\__defines\turfs.dm"
#include "code\_helpers\areas.dm"
#include "code\_helpers\atmospherics.dm"
#include "code\_helpers\datum_pool.dm"
#include "code\_helpers\files.dm"
#include "code\_helpers\functional.dm"
#include "code\_helpers\game.dm"
#include "code\_helpers\global_lists.dm"
#include "code\_helpers\icons.dm"
#include "code\_helpers\lists.dm"
#include "code\_helpers\logging.dm"
#include "code\_helpers\maths.dm"
#include "code\_helpers\matrices.dm"
#include "code\_helpers\mobs.dm"
#include "code\_helpers\names.dm"
#include "code\_helpers\sanitize_values.dm"
#include "code\_helpers\spawn_sync.dm"
#include "code\_helpers\text.dm"
#include "code\_helpers\time.dm"
#include "code\_helpers\turfs.dm"
#include "code\_helpers\type2type.dm"
#include "code\_helpers\unsorted.dm"
#include "code\_helpers\vector.dm"
#include "code\_onclick\adjacent.dm"
#include "code\_onclick\ai.dm"
#include "code\_onclick\click.dm"
@@ -45,13 +65,16 @@
#include "code\_onclick\item_attack.dm"
#include "code\_onclick\observer.dm"
#include "code\_onclick\other_mobs.dm"
#include "code\_onclick\rig.dm"
#include "code\_onclick\telekinesis.dm"
#include "code\_onclick\hud\_defines.dm"
#include "code\_onclick\hud\action.dm"
#include "code\_onclick\hud\ai.dm"
#include "code\_onclick\hud\alien_larva.dm"
#include "code\_onclick\hud\gun_mode.dm"
#include "code\_onclick\hud\hud.dm"
#include "code\_onclick\hud\human.dm"
#include "code\_onclick\hud\monkey.dm"
#include "code\_onclick\hud\movable_screen_objects.dm"
#include "code\_onclick\hud\other_mobs.dm"
#include "code\_onclick\hud\robot.dm"
#include "code\_onclick\hud\screen_objects.dm"
@@ -101,8 +124,10 @@
#include "code\controllers\subsystems.dm"
#include "code\controllers\verbs.dm"
#include "code\controllers\voting.dm"
#include "code\controllers\Processes\ai.dm"
#include "code\controllers\Processes\air.dm"
#include "code\controllers\Processes\alarm.dm"
#include "code\controllers\Processes\chemistry.dm"
#include "code\controllers\Processes\disease.dm"
#include "code\controllers\Processes\emergencyShuttle.dm"
#include "code\controllers\Processes\event.dm"
@@ -112,22 +137,23 @@
#include "code\controllers\Processes\mob.dm"
#include "code\controllers\Processes\nanoui.dm"
#include "code\controllers\Processes\obj.dm"
#include "code\controllers\Processes\scheduler.dm"
#include "code\controllers\Processes\Shuttle.dm"
#include "code\controllers\Processes\sun.dm"
#include "code\controllers\Processes\supply.dm"
#include "code\controllers\Processes\ticker.dm"
#include "code\controllers\Processes\turf.dm"
#include "code\controllers\Processes\vote.dm"
#include "code\controllers\Processes\wireless.dm"
#include "code\controllers\ProcessScheduler\core\_stubs.dm"
#include "code\controllers\ProcessScheduler\core\process.dm"
#include "code\controllers\ProcessScheduler\core\processScheduler.dm"
#include "code\datums\ai_law_sets.dm"
#include "code\datums\ai_laws.dm"
#include "code\datums\browser.dm"
#include "code\datums\category.dm"
#include "code\datums\computerfiles.dm"
#include "code\datums\crew.dm"
#include "code\datums\datacore.dm"
#include "code\datums\datumvars.dm"
#include "code\datums\disease.dm"
#include "code\datums\mind.dm"
#include "code\datums\mixed.dm"
@@ -137,6 +163,7 @@
#include "code\datums\server_greeting.dm"
#include "code\datums\sun.dm"
#include "code\datums\supplypacks.dm"
#include "code\datums\ai\ai.dm"
#include "code\datums\diseases\appendicitis.dm"
#include "code\datums\diseases\beesease.dm"
#include "code\datums\diseases\brainrot.dm"
@@ -173,12 +200,43 @@
#include "code\datums\diseases\advance\symptoms\voice_change.dm"
#include "code\datums\diseases\advance\symptoms\vomit.dm"
#include "code\datums\diseases\advance\symptoms\weight.dm"
#include "code\datums\expansions\expansion.dm"
#include "code\datums\expansions\multitool\_multitool.dm"
#include "code\datums\expansions\multitool\multitool.dm"
#include "code\datums\expansions\multitool\store.dm"
#include "code\datums\expansions\multitool\circuitboards\circuitboards.dm"
#include "code\datums\expansions\multitool\circuitboards\stationalert.dm"
#include "code\datums\expansions\multitool\items\cable.dm"
#include "code\datums\expansions\multitool\items\items.dm"
#include "code\datums\expansions\multitool\machinery\cloning.dm"
#include "code\datums\helper_datums\construction_datum.dm"
#include "code\datums\helper_datums\events.dm"
#include "code\datums\helper_datums\getrev.dm"
#include "code\datums\helper_datums\global_iterator.dm"
#include "code\datums\helper_datums\teleport.dm"
#include "code\datums\helper_datums\topic_input.dm"
#include "code\datums\observation\_debug.dm"
#include "code\datums\observation\destroyed.dm"
#include "code\datums\observation\moved.dm"
#include "code\datums\observation\observation.dm"
#include "code\datums\observation\task_triggered.dm"
#include "code\datums\repositories\cameras.dm"
#include "code\datums\repositories\crew.dm"
#include "code\datums\repositories\repository.dm"
#include "code\datums\uplink\ammunition.dm"
#include "code\datums\uplink\announcements.dm"
#include "code\datums\uplink\badassery.dm"
#include "code\datums\uplink\devices and tools.dm"
#include "code\datums\uplink\grenades.dm"
#include "code\datums\uplink\hardsuit_modules.dm"
#include "code\datums\uplink\highly visible and dangerous weapons.dm"
#include "code\datums\uplink\implants.dm"
#include "code\datums\uplink\medical.dm"
#include "code\datums\uplink\stealth and camouflage items.dm"
#include "code\datums\uplink\stealthy and inconspicuous weapons.dm"
#include "code\datums\uplink\telecrystals.dm"
#include "code\datums\uplink\uplink_categories.dm"
#include "code\datums\uplink\uplink_items.dm"
#include "code\datums\wires\airlock.dm"
#include "code\datums\wires\alarm.dm"
#include "code\datums\wires\apc.dm"
@@ -186,6 +244,7 @@
#include "code\datums\wires\camera.dm"
#include "code\datums\wires\explosive.dm"
#include "code\datums\wires\mulebot.dm"
#include "code\datums\wires\nuclearbomb.dm"
#include "code\datums\wires\particle_accelerator.dm"
#include "code\datums\wires\radio.dm"
#include "code\datums\wires\robot.dm"
@@ -194,6 +253,7 @@
#include "code\datums\wires\suit_storage_unit.dm"
#include "code\datums\wires\vending.dm"
#include "code\datums\wires\wires.dm"
#include "code\defines\gases.dm"
#include "code\defines\obj.dm"
#include "code\defines\obj\weapon.dm"
#include "code\defines\procs\announce.dm"
@@ -201,11 +261,11 @@
#include "code\defines\procs\dbcore.dm"
#include "code\defines\procs\hud.dm"
#include "code\defines\procs\radio.dm"
#include "code\defines\procs\records.dm"
#include "code\defines\procs\sd_Alert.dm"
#include "code\defines\procs\statistics.dm"
#include "code\game\atoms.dm"
#include "code\game\atoms_movable.dm"
#include "code\game\base_turf.dm"
#include "code\game\periodic_news.dm"
#include "code\game\response_team.dm"
#include "code\game\shuttle_engines.dm"
@@ -226,6 +286,7 @@
#include "code\game\antagonist\antagonist_update.dm"
#include "code\game\antagonist\alien\borer.dm"
#include "code\game\antagonist\alien\xenomorph.dm"
#include "code\game\antagonist\outsider\actors.dm"
#include "code\game\antagonist\outsider\commando.dm"
#include "code\game\antagonist\outsider\deathsquad.dm"
#include "code\game\antagonist\outsider\ert.dm"
@@ -260,12 +321,6 @@
#include "code\game\gamemodes\gameticker.dm"
#include "code\game\gamemodes\objective.dm"
#include "code\game\gamemodes\setupgame.dm"
#include "code\game\gamemodes\blob\blob.dm"
#include "code\game\gamemodes\blob\theblob.dm"
#include "code\game\gamemodes\blob\blobs\core.dm"
#include "code\game\gamemodes\blob\blobs\factory.dm"
#include "code\game\gamemodes\blob\blobs\node.dm"
#include "code\game\gamemodes\blob\blobs\shield.dm"
#include "code\game\gamemodes\calamity\calamity.dm"
#include "code\game\gamemodes\changeling\changeling.dm"
#include "code\game\gamemodes\changeling\changeling_powers.dm"
@@ -288,7 +343,6 @@
#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\wormholes.dm"
#include "code\game\gamemodes\events\holidays\Christmas.dm"
@@ -307,6 +361,12 @@
#include "code\game\gamemodes\malfunction\newmalf_ability_trees\tree_networking.dm"
#include "code\game\gamemodes\meteor\meteor.dm"
#include "code\game\gamemodes\meteor\meteors.dm"
#include "code\game\gamemodes\mixed\bughunt.dm"
#include "code\game\gamemodes\mixed\conflux.dm"
#include "code\game\gamemodes\mixed\infestation.dm"
#include "code\game\gamemodes\mixed\paranoia.dm"
#include "code\game\gamemodes\mixed\traitorling.dm"
#include "code\game\gamemodes\mixed\uprising.dm"
#include "code\game\gamemodes\ninja\ninja.dm"
#include "code\game\gamemodes\nuclear\nuclear.dm"
#include "code\game\gamemodes\nuclear\pinpointer.dm"
@@ -318,7 +378,9 @@
#include "code\game\gamemodes\vampire\vampire_helpers.dm"
#include "code\game\gamemodes\vampire\vampire_powers.dm"
#include "code\game\gamemodes\wizard\wizard.dm"
#include "code\game\jobs\_access_defs.dm"
#include "code\game\jobs\access.dm"
#include "code\game\jobs\access_datum.dm"
#include "code\game\jobs\job_controller.dm"
#include "code\game\jobs\jobs.dm"
#include "code\game\jobs\whitelist.dm"
@@ -339,7 +401,6 @@
#include "code\game\machinery\autolathe.dm"
#include "code\game\machinery\autolathe_datums.dm"
#include "code\game\machinery\Beacon.dm"
#include "code\game\machinery\bees_items.dm"
#include "code\game\machinery\biogenerator.dm"
#include "code\game\machinery\bioprinter.dm"
#include "code\game\machinery\bluespacerelay.dm"
@@ -355,6 +416,7 @@
#include "code\game\machinery\doppler_array.dm"
#include "code\game\machinery\flasher.dm"
#include "code\game\machinery\floodlight.dm"
#include "code\game\machinery\floor_light.dm"
#include "code\game\machinery\floorlayer.dm"
#include "code\game\machinery\hologram.dm"
#include "code\game\machinery\holosign.dm"
@@ -370,7 +432,6 @@
#include "code\game\machinery\nuclear_bomb.dm"
#include "code\game\machinery\OpTable.dm"
#include "code\game\machinery\overview.dm"
#include "code\game\machinery\portable_tag_turret.dm"
#include "code\game\machinery\portable_turret.dm"
#include "code\game\machinery\recharger.dm"
#include "code\game\machinery\rechargestation.dm"
@@ -383,10 +444,10 @@
#include "code\game\machinery\status_display_ai.dm"
#include "code\game\machinery\suit_storage_unit.dm"
#include "code\game\machinery\supply_display.dm"
#include "code\game\machinery\supplybeacon.dm"
#include "code\game\machinery\syndicatebeacon.dm"
#include "code\game\machinery\teleporter.dm"
#include "code\game\machinery\turret_control.dm"
#include "code\game\machinery\turrets.dm"
#include "code\game\machinery\vending.dm"
#include "code\game\machinery\wall_frames.dm"
#include "code\game\machinery\washing_machine.dm"
@@ -407,11 +468,11 @@
#include "code\game\machinery\computer\ai_core.dm"
#include "code\game\machinery\computer\aifixer.dm"
#include "code\game\machinery\computer\arcade.dm"
#include "code\game\machinery\computer\arcade_orion.dm"
#include "code\game\machinery\computer\atmos_alert.dm"
#include "code\game\machinery\computer\atmos_control.dm"
#include "code\game\machinery\computer\buildandrepair.dm"
#include "code\game\machinery\computer\camera.dm"
#include "code\game\machinery\computer\card.dm"
#include "code\game\machinery\computer\cloning.dm"
#include "code\game\machinery\computer\communications.dm"
#include "code\game\machinery\computer\computer.dm"
@@ -433,36 +494,6 @@
#include "code\game\machinery\computer\station_alert.dm"
#include "code\game\machinery\computer\supply.dm"
#include "code\game\machinery\computer\syndicate_specops_shuttle.dm"
#include "code\game\machinery\computer3\bios.dm"
#include "code\game\machinery\computer3\buildandrepair.dm"
#include "code\game\machinery\computer3\component.dm"
#include "code\game\machinery\computer3\computer.dm"
#include "code\game\machinery\computer3\computer3_notes.dm"
#include "code\game\machinery\computer3\file.dm"
#include "code\game\machinery\computer3\laptop.dm"
#include "code\game\machinery\computer3\lapvend.dm"
#include "code\game\machinery\computer3\networking.dm"
#include "code\game\machinery\computer3\NTOS.dm"
#include "code\game\machinery\computer3\program.dm"
#include "code\game\machinery\computer3\program_disks.dm"
#include "code\game\machinery\computer3\server.dm"
#include "code\game\machinery\computer3\storage.dm"
#include "code\game\machinery\computer3\computers\arcade.dm"
#include "code\game\machinery\computer3\computers\atmos_alert.dm"
#include "code\game\machinery\computer3\computers\camera.dm"
#include "code\game\machinery\computer3\computers\card.dm"
#include "code\game\machinery\computer3\computers\communications.dm"
#include "code\game\machinery\computer3\computers\crew.dm"
#include "code\game\machinery\computer3\computers\customs.dm"
#include "code\game\machinery\computer3\computers\HolodeckControl.dm"
#include "code\game\machinery\computer3\computers\law.dm"
#include "code\game\machinery\computer3\computers\medical.dm"
#include "code\game\machinery\computer3\computers\Operating.dm"
#include "code\game\machinery\computer3\computers\power.dm"
#include "code\game\machinery\computer3\computers\prisoner.dm"
#include "code\game\machinery\computer3\computers\robot.dm"
#include "code\game\machinery\computer3\computers\security.dm"
#include "code\game\machinery\computer3\computers\welcome.dm"
#include "code\game\machinery\doors\airlock.dm"
#include "code\game\machinery\doors\airlock_control.dm"
#include "code\game\machinery\doors\airlock_electronics.dm"
@@ -561,7 +592,6 @@
#include "code\game\objects\effects\decals\posters\bs12.dm"
#include "code\game\objects\effects\spawners\bombspawner.dm"
#include "code\game\objects\effects\spawners\gibspawner.dm"
#include "code\game\objects\effects\spawners\vaultspawner.dm"
#include "code\game\objects\items\apc_frame.dm"
#include "code\game\objects\items\blueprints.dm"
#include "code\game\objects\items\bodybag.dm"
@@ -580,6 +610,7 @@
#include "code\game\objects\items\devices\flash.dm"
#include "code\game\objects\items\devices\flashlight.dm"
#include "code\game\objects\items\devices\floor_painter.dm"
#include "code\game\objects\items\devices\hacktool.dm"
#include "code\game\objects\items\devices\lightreplacer.dm"
#include "code\game\objects\items\devices\magnetic_lock.dm"
#include "code\game\objects\items\devices\megaphone.dm"
@@ -592,10 +623,12 @@
#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\t_scanner.dm"
#include "code\game\objects\items\devices\taperecorder.dm"
#include "code\game\objects\items\devices\traitordevices.dm"
#include "code\game\objects\items\devices\transfer_valve.dm"
#include "code\game\objects\items\devices\uplinks.dm"
#include "code\game\objects\items\devices\uplink.dm"
#include "code\game\objects\items\devices\uplink_random_lists.dm"
#include "code\game\objects\items\devices\violin.dm"
#include "code\game\objects\items\devices\whistle.dm"
#include "code\game\objects\items\devices\PDA\cart.dm"
@@ -616,15 +649,14 @@
#include "code\game\objects\items\stacks\nanopaste.dm"
#include "code\game\objects\items\stacks\rods.dm"
#include "code\game\objects\items\stacks\stack.dm"
#include "code\game\objects\items\stacks\telecrystal.dm"
#include "code\game\objects\items\stacks\sheets\leather.dm"
#include "code\game\objects\items\stacks\sheets\light.dm"
#include "code\game\objects\items\stacks\tiles\light.dm"
#include "code\game\objects\items\stacks\tiles\plasteel.dm"
#include "code\game\objects\items\stacks\tiles\tile_types.dm"
#include "code\game\objects\items\weapons\AI_modules.dm"
#include "code\game\objects\items\weapons\autopsy.dm"
#include "code\game\objects\items\weapons\candle.dm"
#include "code\game\objects\items\weapons\cards_ids.dm"
#include "code\game\objects\items\weapons\cards_ids_syndicate.dm"
#include "code\game\objects\items\weapons\cigs_lighters.dm"
#include "code\game\objects\items\weapons\clown_items.dm"
#include "code\game\objects\items\weapons\cosmetics.dm"
@@ -636,7 +668,6 @@
#include "code\game\objects\items\weapons\gift_wrappaper.dm"
#include "code\game\objects\items\weapons\handcuffs.dm"
#include "code\game\objects\items\weapons\improvised_components.dm"
#include "code\game\objects\items\weapons\kitchen.dm"
#include "code\game\objects\items\weapons\manuals.dm"
#include "code\game\objects\items\weapons\mop.dm"
#include "code\game\objects\items\weapons\paint.dm"
@@ -667,11 +698,13 @@
#include "code\game\objects\items\weapons\circuitboards\computer\computer.dm"
#include "code\game\objects\items\weapons\circuitboards\computer\holodeckcontrol.dm"
#include "code\game\objects\items\weapons\circuitboards\computer\research.dm"
#include "code\game\objects\items\weapons\circuitboards\computer\station_alert.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\commsantenna.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\mech_recharger.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\mining_drill.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\pacman.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\power.dm"
@@ -680,9 +713,11 @@
#include "code\game\objects\items\weapons\circuitboards\machinery\shieldgen.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\telecomms.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\unary_atmos.dm"
#include "code\game\objects\items\weapons\grenades\anti_photon_grenade.dm"
#include "code\game\objects\items\weapons\grenades\chem_grenade.dm"
#include "code\game\objects\items\weapons\grenades\emgrenade.dm"
#include "code\game\objects\items\weapons\grenades\flashbang.dm"
#include "code\game\objects\items\weapons\grenades\fragmentation.dm"
#include "code\game\objects\items\weapons\grenades\grenade.dm"
#include "code\game\objects\items\weapons\grenades\smokebomb.dm"
#include "code\game\objects\items\weapons\grenades\spawnergrenade.dm"
@@ -714,6 +749,7 @@
#include "code\game\objects\items\weapons\storage\fancy.dm"
#include "code\game\objects\items\weapons\storage\firstaid.dm"
#include "code\game\objects\items\weapons\storage\internal.dm"
#include "code\game\objects\items\weapons\storage\laundry_basket.dm"
#include "code\game\objects\items\weapons\storage\lockbox.dm"
#include "code\game\objects\items\weapons\storage\misc.dm"
#include "code\game\objects\items\weapons\storage\secure.dm"
@@ -733,14 +769,13 @@
#include "code\game\objects\structures\door_assembly.dm"
#include "code\game\objects\structures\electricchair.dm"
#include "code\game\objects\structures\extinguisher.dm"
#include "code\game\objects\structures\fireaxe_cabinet.dm"
#include "code\game\objects\structures\flora.dm"
#include "code\game\objects\structures\girders.dm"
#include "code\game\objects\structures\grille.dm"
#include "code\game\objects\structures\inflatable.dm"
#include "code\game\objects\structures\janicart.dm"
#include "code\game\objects\structures\kitchen_spike.dm"
#include "code\game\objects\structures\ladders.dm"
#include "code\game\objects\structures\lamarr_cage.dm"
#include "code\game\objects\structures\lattice.dm"
#include "code\game\objects\structures\mirror.dm"
#include "code\game\objects\structures\mop_bucket.dm"
@@ -757,12 +792,16 @@
#include "code\game\objects\structures\watercloset.dm"
#include "code\game\objects\structures\windoor_assembly.dm"
#include "code\game\objects\structures\window.dm"
#include "code\game\objects\structures\window_spawner.dm"
#include "code\game\objects\structures\alien\alien.dm"
#include "code\game\objects\structures\alien\egg.dm"
#include "code\game\objects\structures\alien\node.dm"
#include "code\game\objects\structures\alien\resin.dm"
#include "code\game\objects\structures\crates_lockers\closets.dm"
#include "code\game\objects\structures\crates_lockers\crates.dm"
#include "code\game\objects\structures\crates_lockers\largecrate.dm"
#include "code\game\objects\structures\crates_lockers\closets\coffin.dm"
#include "code\game\objects\structures\crates_lockers\closets\crittercrate.dm"
#include "code\game\objects\structures\crates_lockers\closets\fireaxe.dm"
#include "code\game\objects\structures\crates_lockers\closets\fitness.dm"
#include "code\game\objects\structures\crates_lockers\closets\gimmick.dm"
#include "code\game\objects\structures\crates_lockers\closets\job_closets.dm"
@@ -791,9 +830,20 @@
#include "code\game\objects\structures\stool_bed_chair_nest\wheelchair.dm"
#include "code\game\turfs\simulated.dm"
#include "code\game\turfs\turf.dm"
#include "code\game\turfs\turf_changing.dm"
#include "code\game\turfs\turf_flick_animations.dm"
#include "code\game\turfs\unsimulated.dm"
#include "code\game\turfs\flooring\flooring.dm"
#include "code\game\turfs\flooring\flooring_decals.dm"
#include "code\game\turfs\flooring\flooring_premade.dm"
#include "code\game\turfs\initialization\init.dm"
#include "code\game\turfs\initialization\maintenance.dm"
#include "code\game\turfs\simulated\floor.dm"
#include "code\game\turfs\simulated\floor_acts.dm"
#include "code\game\turfs\simulated\floor_attackby.dm"
#include "code\game\turfs\simulated\floor_damage.dm"
#include "code\game\turfs\simulated\floor_icon.dm"
#include "code\game\turfs\simulated\floor_static.dm"
#include "code\game\turfs\simulated\floor_types.dm"
#include "code\game\turfs\simulated\wall_attacks.dm"
#include "code\game\turfs\simulated\wall_icon.dm"
@@ -805,15 +855,16 @@
#include "code\game\turfs\unsimulated\floor.dm"
#include "code\game\turfs\unsimulated\walls.dm"
#include "code\game\verbs\ooc.dm"
#include "code\game\verbs\suicide.dm"
#include "code\game\verbs\who.dm"
#include "code\js\byjax.dm"
#include "code\js\menus.dm"
#include "code\modules\acting\acting_items.dm"
#include "code\modules\admin\admin.dm"
#include "code\modules\admin\admin_attack_log.dm"
#include "code\modules\admin\admin_investigate.dm"
#include "code\modules\admin\admin_ranks.dm"
#include "code\modules\admin\admin_server_greeting.dm"
#include "code\modules\admin\admin_secrets.dm"
#include "code\modules\admin\admin_verbs.dm"
#include "code\modules\admin\banjob.dm"
#include "code\modules\admin\create_mob.dm"
@@ -821,15 +872,54 @@
#include "code\modules\admin\create_turf.dm"
#include "code\modules\admin\holder2.dm"
#include "code\modules\admin\IsBanned.dm"
#include "code\modules\admin\map_capture.dm"
#include "code\modules\admin\NewBan.dm"
#include "code\modules\admin\player_notes.dm"
#include "code\modules\admin\player_notes_sql.dm"
#include "code\modules\admin\player_panel.dm"
#include "code\modules\admin\topic.dm"
#include "code\modules\admin\ToRban.dm"
#include "code\modules\admin\callproc\callproc.dm"
#include "code\modules\admin\DB ban\ban_mirroring.dm"
#include "code\modules\admin\DB ban\functions.dm"
#include "code\modules\admin\permissionverbs\permissionedit.dm"
#include "code\modules\admin\secrets\admin_secrets\admin_logs.dm"
#include "code\modules\admin\secrets\admin_secrets\alter_narsie.dm"
#include "code\modules\admin\secrets\admin_secrets\bombing_list.dm"
#include "code\modules\admin\secrets\admin_secrets\jump_shuttle.dm"
#include "code\modules\admin\secrets\admin_secrets\launch_shuttle.dm"
#include "code\modules\admin\secrets\admin_secrets\launch_shuttle_forced.dm"
#include "code\modules\admin\secrets\admin_secrets\list_dna.dm"
#include "code\modules\admin\secrets\admin_secrets\list_fingerprints.dm"
#include "code\modules\admin\secrets\admin_secrets\move_shuttle.dm"
#include "code\modules\admin\secrets\admin_secrets\prison_warp.dm"
#include "code\modules\admin\secrets\admin_secrets\show_ai_laws.dm"
#include "code\modules\admin\secrets\admin_secrets\show_crew_manifest.dm"
#include "code\modules\admin\secrets\admin_secrets\show_game_mode.dm"
#include "code\modules\admin\secrets\admin_secrets\show_law_changes.dm"
#include "code\modules\admin\secrets\admin_secrets\show_signalers.dm"
#include "code\modules\admin\secrets\admin_secrets\traitors_and_objectives.dm"
#include "code\modules\admin\secrets\final_solutions\summon_narsie.dm"
#include "code\modules\admin\secrets\final_solutions\supermatter_cascade.dm"
#include "code\modules\admin\secrets\fun_secrets\break_all_lights.dm"
#include "code\modules\admin\secrets\fun_secrets\break_some_lights.dm"
#include "code\modules\admin\secrets\fun_secrets\fix_all_lights.dm"
#include "code\modules\admin\secrets\fun_secrets\ghost_mode.dm"
#include "code\modules\admin\secrets\fun_secrets\make_all_areas_powered.dm"
#include "code\modules\admin\secrets\fun_secrets\make_all_areas_unpowered.dm"
#include "code\modules\admin\secrets\fun_secrets\only_one.dm"
#include "code\modules\admin\secrets\fun_secrets\paintball_mode.dm"
#include "code\modules\admin\secrets\fun_secrets\power_all_smes.dm"
#include "code\modules\admin\secrets\fun_secrets\remove_all_clothing.dm"
#include "code\modules\admin\secrets\fun_secrets\remove_internal_clothing.dm"
#include "code\modules\admin\secrets\fun_secrets\send_strike_team.dm"
#include "code\modules\admin\secrets\fun_secrets\toggle_bomb_cap.dm"
#include "code\modules\admin\secrets\fun_secrets\triple_ai_mode.dm"
#include "code\modules\admin\secrets\fun_secrets\turn_humans_into_corgies.dm"
#include "code\modules\admin\secrets\fun_secrets\turn_humans_into_monkeys.dm"
#include "code\modules\admin\secrets\random_events\gravity.dm"
#include "code\modules\admin\secrets\random_events\trigger_cordical_borer_infestation.dm"
#include "code\modules\admin\secrets\random_events\trigger_xenomorph_infestation.dm"
#include "code\modules\admin\verbs\adminhelp.dm"
#include "code\modules\admin\verbs\adminjump.dm"
#include "code\modules\admin\verbs\adminpm.dm"
@@ -862,6 +952,9 @@
#include "code\modules\admin\verbs\ticklag.dm"
#include "code\modules\admin\verbs\tripAI.dm"
#include "code\modules\admin\verbs\warning.dm"
#include "code\modules\admin\view_variables\helpers.dm"
#include "code\modules\admin\view_variables\topic.dm"
#include "code\modules\admin\view_variables\view_variables.dm"
#include "code\modules\alarm\alarm.dm"
#include "code\modules\alarm\alarm_handler.dm"
#include "code\modules\alarm\atmosphere_alarm.dm"
@@ -889,10 +982,12 @@
#include "code\modules\awaymissions\pamphlet.dm"
#include "code\modules\awaymissions\trigger.dm"
#include "code\modules\awaymissions\zlevel.dm"
#include "code\modules\blob\blob.dm"
#include "code\modules\cciaa\cciaa.dm"
#include "code\modules\cciaa\cciaa_items.dm"
#include "code\modules\client\client defines.dm"
#include "code\modules\client\client procs.dm"
#include "code\modules\client\movement.dm"
#include "code\modules\client\preferences.dm"
#include "code\modules\client\preferences_ambience.dm"
#include "code\modules\client\preferences_factions.dm"
@@ -904,7 +999,25 @@
#include "code\modules\client\preferences_sql.dm"
#include "code\modules\client\preferences_system_control.dm"
#include "code\modules\client\preferences_toggles.dm"
#include "code\modules\client\ui_style.dm"
#include "code\modules\client\preference_setup\preference_setup.dm"
#include "code\modules\client\preference_setup\antagonism\01_candidacy.dm"
#include "code\modules\client\preference_setup\antagonism\02_setup.dm"
#include "code\modules\client\preference_setup\general\01_basic.dm"
#include "code\modules\client\preference_setup\general\02_language.dm"
#include "code\modules\client\preference_setup\general\03_body.dm"
#include "code\modules\client\preference_setup\general\04_equipment.dm"
#include "code\modules\client\preference_setup\general\05_background.dm"
#include "code\modules\client\preference_setup\general\06_flavor.dm"
#include "code\modules\client\preference_setup\global\01_ui.dm"
#include "code\modules\client\preference_setup\global\02_settings.dm"
#include "code\modules\client\preference_setup\global\03_language.dm"
#include "code\modules\client\preference_setup\global\04_pai.dm"
#include "code\modules\client\preference_setup\occupation\occupation.dm"
#include "code\modules\client\preference_setup\skills\skills.dm"
#include "code\modules\clothing\chameleon.dm"
#include "code\modules\clothing\clothing.dm"
#include "code\modules\clothing\clothing_accessories.dm"
#include "code\modules\clothing\ears\skrell.dm"
#include "code\modules\clothing\glasses\glasses.dm"
#include "code\modules\clothing\glasses\hud.dm"
@@ -964,7 +1077,6 @@
#include "code\modules\clothing\suits\storage.dm"
#include "code\modules\clothing\suits\utility.dm"
#include "code\modules\clothing\suits\wiz_robe.dm"
#include "code\modules\clothing\under\chameleon.dm"
#include "code\modules\clothing\under\color.dm"
#include "code\modules\clothing\under\miscellaneous.dm"
#include "code\modules\clothing\under\shorts.dm"
@@ -979,6 +1091,7 @@
#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\clothing\under\xenos\resomi.dm"
#include "code\modules\customitems\item_defines.dm"
#include "code\modules\customitems\item_spawning.dm"
#include "code\modules\detectivework\footprints.dm"
@@ -1029,6 +1142,7 @@
#include "code\modules\events\radiation_storm.dm"
#include "code\modules\events\random_antagonist.dm"
#include "code\modules\events\rogue_drones.dm"
#include "code\modules\events\shipping_error.dm"
#include "code\modules\events\space_ninja.dm"
#include "code\modules\events\spacevine.dm"
#include "code\modules\events\spider_infestation.dm"
@@ -1051,8 +1165,13 @@
#include "code\modules\flufftext\Hallucination.dm"
#include "code\modules\flufftext\TextFilters.dm"
#include "code\modules\food\recipes_microwave.dm"
#include "code\modules\games\boardgame.dm"
#include "code\modules\games\cardemon.dm"
#include "code\modules\games\cards.dm"
#include "code\modules\games\spaceball_cards.dm"
#include "code\modules\games\tarot.dm"
#include "code\modules\genetics\side_effects.dm"
#include "code\modules\ghosttrap\trap.dm"
#include "code\modules\holodeck\HolodeckControl.dm"
#include "code\modules\holodeck\HolodeckObjects.dm"
#include "code\modules\holodeck\HolodeckPrograms.dm"
@@ -1067,11 +1186,11 @@
#include "code\modules\hydroponics\seed_mobs.dm"
#include "code\modules\hydroponics\seed_packets.dm"
#include "code\modules\hydroponics\seed_storage.dm"
#include "code\modules\hydroponics\beekeeping\beehive.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"
@@ -1118,6 +1237,7 @@
#include "code\modules\mob\animations.dm"
#include "code\modules\mob\death.dm"
#include "code\modules\mob\emote.dm"
#include "code\modules\mob\gender.dm"
#include "code\modules\mob\hear_say.dm"
#include "code\modules\mob\holder.dm"
#include "code\modules\mob\inventory.dm"
@@ -1160,8 +1280,10 @@
#include "code\modules\mob\language\outsider.dm"
#include "code\modules\mob\language\station.dm"
#include "code\modules\mob\language\synthetic.dm"
#include "code\modules\mob\living\autohiss.dm"
#include "code\modules\mob\living\damage_procs.dm"
#include "code\modules\mob\living\default_language.dm"
#include "code\modules\mob\living\life.dm"
#include "code\modules\mob\living\living.dm"
#include "code\modules\mob\living\living_defense.dm"
#include "code\modules\mob\living\living_defines.dm"
@@ -1169,7 +1291,6 @@
#include "code\modules\mob\living\login.dm"
#include "code\modules\mob\living\logout.dm"
#include "code\modules\mob\living\say.dm"
#include "code\modules\mob\living\blob\blob.dm"
#include "code\modules\mob\living\bot\bot.dm"
#include "code\modules\mob\living\bot\cleanbot.dm"
#include "code\modules\mob\living\bot\ed209bot.dm"
@@ -1179,6 +1300,7 @@
#include "code\modules\mob\living\bot\secbot.dm"
#include "code\modules\mob\living\carbon\breathe.dm"
#include "code\modules\mob\living\carbon\carbon.dm"
#include "code\modules\mob\living\carbon\carbon_defense.dm"
#include "code\modules\mob\living\carbon\carbon_defines.dm"
#include "code\modules\mob\living\carbon\carbon_powers.dm"
#include "code\modules\mob\living\carbon\give.dm"
@@ -1203,6 +1325,7 @@
#include "code\modules\mob\living\carbon\alien\diona\update_icons.dm"
#include "code\modules\mob\living\carbon\alien\larva\larva.dm"
#include "code\modules\mob\living\carbon\alien\larva\life.dm"
#include "code\modules\mob\living\carbon\alien\larva\powers.dm"
#include "code\modules\mob\living\carbon\alien\larva\progression.dm"
#include "code\modules\mob\living\carbon\brain\brain.dm"
#include "code\modules\mob\living\carbon\brain\brain_item.dm"
@@ -1223,6 +1346,7 @@
#include "code\modules\mob\living\carbon\human\human_damage.dm"
#include "code\modules\mob\living\carbon\human\human_defense.dm"
#include "code\modules\mob\living\carbon\human\human_defines.dm"
#include "code\modules\mob\living\carbon\human\human_helpers.dm"
#include "code\modules\mob\living\carbon\human\human_movement.dm"
#include "code\modules\mob\living\carbon\human\human_organs.dm"
#include "code\modules\mob\living\carbon\human\human_powers.dm"
@@ -1245,11 +1369,11 @@
#include "code\modules\mob\living\carbon\human\species\outsider\shadow.dm"
#include "code\modules\mob\living\carbon\human\species\outsider\vox.dm"
#include "code\modules\mob\living\carbon\human\species\station\golem.dm"
#include "code\modules\mob\living\carbon\human\species\station\human_subspecies.dm"
#include "code\modules\mob\living\carbon\human\species\station\monkey.dm"
#include "code\modules\mob\living\carbon\human\species\station\resomi.dm"
#include "code\modules\mob\living\carbon\human\species\station\slime.dm"
#include "code\modules\mob\living\carbon\human\species\station\station.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_embryo.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_facehugger.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_powers.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_species.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\xenomorphs.dm"
@@ -1274,14 +1398,16 @@
#include "code\modules\mob\living\silicon\silicon.dm"
#include "code\modules\mob\living\silicon\subystems.dm"
#include "code\modules\mob\living\silicon\ai\ai.dm"
#include "code\modules\mob\living\silicon\ai\ai_movement.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\icons.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\nano.dm"
#include "code\modules\mob\living\silicon\ai\malf.dm"
#include "code\modules\mob\living\silicon\decoy\death.dm"
#include "code\modules\mob\living\silicon\decoy\decoy.dm"
#include "code\modules\mob\living\silicon\decoy\life.dm"
@@ -1312,6 +1438,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\syndicate.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"
@@ -1319,7 +1446,6 @@
#include "code\modules\mob\living\silicon\robot\drone\drone_items.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_manufacturer.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_say.dm"
#include "code\modules\mob\living\simple_animal\bees.dm"
#include "code\modules\mob\living\simple_animal\corpse.dm"
#include "code\modules\mob\living\simple_animal\parrot.dm"
#include "code\modules\mob\living\simple_animal\shade.dm"
@@ -1366,6 +1492,47 @@
#include "code\modules\mob\new_player\preferences_setup.dm"
#include "code\modules\mob\new_player\skill.dm"
#include "code\modules\mob\new_player\sprite_accessories.dm"
#include "code\modules\modular_computers\laptop_vendor.dm"
#include "code\modules\modular_computers\computers\item\modular_computer.dm"
#include "code\modules\modular_computers\computers\item\processor.dm"
#include "code\modules\modular_computers\computers\item\tablet.dm"
#include "code\modules\modular_computers\computers\item\tablet_presets.dm"
#include "code\modules\modular_computers\computers\machinery\console_presets.dm"
#include "code\modules\modular_computers\computers\machinery\modular_computer.dm"
#include "code\modules\modular_computers\computers\machinery\modular_console.dm"
#include "code\modules\modular_computers\computers\machinery\modular_laptop.dm"
#include "code\modules\modular_computers\file_system\computer_file.dm"
#include "code\modules\modular_computers\file_system\data.dm"
#include "code\modules\modular_computers\file_system\program.dm"
#include "code\modules\modular_computers\file_system\programs\_engineering.dm"
#include "code\modules\modular_computers\file_system\programs\_medical.dm"
#include "code\modules\modular_computers\file_system\programs\card.dm"
#include "code\modules\modular_computers\file_system\programs\configurator.dm"
#include "code\modules\modular_computers\file_system\programs\file_browser.dm"
#include "code\modules\modular_computers\file_system\programs\ntdownloader.dm"
#include "code\modules\modular_computers\file_system\programs\ntmonitor.dm"
#include "code\modules\modular_computers\file_system\programs\ntnrc_client.dm"
#include "code\modules\modular_computers\file_system\programs\nttransfer.dm"
#include "code\modules\modular_computers\file_system\programs\antagonist\dos.dm"
#include "code\modules\modular_computers\file_system\programs\antagonist\revelation.dm"
#include "code\modules\modular_computers\hardware\battery_module.dm"
#include "code\modules\modular_computers\hardware\card_slot.dm"
#include "code\modules\modular_computers\hardware\hard_drive.dm"
#include "code\modules\modular_computers\hardware\hardware.dm"
#include "code\modules\modular_computers\hardware\nano_printer.dm"
#include "code\modules\modular_computers\hardware\network_card.dm"
#include "code\modules\modular_computers\hardware\portable_hard_drive.dm"
#include "code\modules\modular_computers\hardware\processor_unit.dm"
#include "code\modules\modular_computers\hardware\tesla_link.dm"
#include "code\modules\modular_computers\NTNet\NTNet.dm"
#include "code\modules\modular_computers\NTNet\NTNet_relay.dm"
#include "code\modules\modular_computers\NTNet\NTNRC\conversation.dm"
#include "code\modules\multiz\_stubs.dm"
#include "code\modules\multiz\basic.dm"
#include "code\modules\multiz\movement.dm"
#include "code\modules\multiz\pipes.dm"
#include "code\modules\multiz\structures.dm"
#include "code\modules\multiz\turf.dm"
#include "code\modules\nano\_JSON.dm"
#include "code\modules\nano\JSON Reader.dm"
#include "code\modules\nano\JSON Writer.dm"
@@ -1378,9 +1545,12 @@
#include "code\modules\nano\interaction\conscious.dm"
#include "code\modules\nano\interaction\contained.dm"
#include "code\modules\nano\interaction\default.dm"
#include "code\modules\nano\interaction\interactive.dm"
#include "code\modules\nano\interaction\inventory.dm"
#include "code\modules\nano\interaction\inventory_deep.dm"
#include "code\modules\nano\interaction\outside.dm"
#include "code\modules\nano\interaction\physical.dm"
#include "code\modules\nano\interaction\remote.dm"
#include "code\modules\nano\interaction\self.dm"
#include "code\modules\nano\interaction\zlevel.dm"
#include "code\modules\nano\modules\alarm_monitor.dm"
@@ -1392,8 +1562,8 @@
#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\misc.dm"
#include "code\modules\organs\organ.dm"
#include "code\modules\organs\organ_alien.dm"
#include "code\modules\organs\organ_external.dm"
#include "code\modules\organs\organ_icon.dm"
#include "code\modules\organs\organ_internal.dm"
@@ -1401,6 +1571,12 @@
#include "code\modules\organs\pain.dm"
#include "code\modules\organs\robolimbs.dm"
#include "code\modules\organs\wound.dm"
#include "code\modules\organs\subtypes\diona.dm"
#include "code\modules\organs\subtypes\machine.dm"
#include "code\modules\organs\subtypes\resomi.dm"
#include "code\modules\organs\subtypes\standard.dm"
#include "code\modules\organs\subtypes\unbreakable.dm"
#include "code\modules\organs\subtypes\xenos.dm"
#include "code\modules\overmap\_defines.dm"
#include "code\modules\overmap\sectors.dm"
#include "code\modules\overmap\ships\ship.dm"
@@ -1418,6 +1594,7 @@
#include "code\modules\paperwork\paper.dm"
#include "code\modules\paperwork\paper_bundle.dm"
#include "code\modules\paperwork\paperbin.dm"
#include "code\modules\paperwork\papershredder.dm"
#include "code\modules\paperwork\pen.dm"
#include "code\modules\paperwork\photocopier.dm"
#include "code\modules\paperwork\photography.dm"
@@ -1429,7 +1606,6 @@
#include "code\modules\power\cable.dm"
#include "code\modules\power\cable_heavyduty.dm"
#include "code\modules\power\cell.dm"
#include "code\modules\power\engine.dm"
#include "code\modules\power\fractal_reactor.dm"
#include "code\modules\power\generator.dm"
#include "code\modules\power\generator_type2.dm"
@@ -1470,7 +1646,6 @@
#include "code\modules\projectiles\effects.dm"
#include "code\modules\projectiles\gun.dm"
#include "code\modules\projectiles\projectile.dm"
#include "code\modules\projectiles\targeting.dm"
#include "code\modules\projectiles\ammunition\boxes.dm"
#include "code\modules\projectiles\ammunition\bullets.dm"
#include "code\modules\projectiles\guns\alien.dm"
@@ -1503,8 +1678,28 @@
#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\projectiles\targeting\targeting_client.dm"
#include "code\modules\projectiles\targeting\targeting_gun.dm"
#include "code\modules\projectiles\targeting\targeting_mob.dm"
#include "code\modules\projectiles\targeting\targeting_overlay.dm"
#include "code\modules\projectiles\targeting\targeting_triggers.dm"
#include "code\modules\random_map\_random_map_setup.dm"
#include "code\modules\random_map\random_map.dm"
#include "code\modules\random_map\random_map_verbs.dm"
#include "code\modules\random_map\automata\automata.dm"
#include "code\modules\random_map\automata\caves.dm"
#include "code\modules\random_map\building\building.dm"
#include "code\modules\random_map\drop\drop_types.dm"
#include "code\modules\random_map\drop\droppod.dm"
#include "code\modules\random_map\drop\droppod_doors.dm"
#include "code\modules\random_map\drop\supply.dm"
#include "code\modules\random_map\mazes\maze.dm"
#include "code\modules\random_map\mazes\maze_cell.dm"
#include "code\modules\random_map\noise\desert.dm"
#include "code\modules\random_map\noise\magma.dm"
#include "code\modules\random_map\noise\noise.dm"
#include "code\modules\random_map\noise\ore.dm"
#include "code\modules\random_map\noise\tundra.dm"
#include "code\modules\reagents\Chemistry-Colours.dm"
#include "code\modules\reagents\Chemistry-Holder.dm"
#include "code\modules\reagents\Chemistry-Logging.dm"
@@ -1557,6 +1752,7 @@
#include "code\modules\research\circuitprinter.dm"
#include "code\modules\research\designs.dm"
#include "code\modules\research\destructive_analyzer.dm"
#include "code\modules\research\mechfab_designs.dm"
#include "code\modules\research\message_server.dm"
#include "code\modules\research\protolathe.dm"
#include "code\modules\research\rd-readme.dm"
@@ -1691,20 +1887,21 @@
#include "code\modules\spells\targeted\projectile\fireball.dm"
#include "code\modules\spells\targeted\projectile\magic_missile.dm"
#include "code\modules\spells\targeted\projectile\projectile.dm"
#include "code\modules\supermatter\setup_supermatter.dm"
#include "code\modules\supermatter\supermatter.dm"
#include "code\modules\surgery\_defines.dm"
#include "code\modules\surgery\bones.dm"
#include "code\modules\surgery\brainrepair.dm"
#include "code\modules\surgery\encased.dm"
#include "code\modules\surgery\eye.dm"
#include "code\modules\surgery\face.dm"
#include "code\modules\surgery\generic.dm"
#include "code\modules\surgery\headreattach.dm"
#include "code\modules\surgery\implant.dm"
#include "code\modules\surgery\limb_reattach.dm"
#include "code\modules\surgery\organs_internal.dm"
#include "code\modules\surgery\other.dm"
#include "code\modules\surgery\robolimbs.dm"
#include "code\modules\surgery\robotics.dm"
#include "code\modules\surgery\slimes.dm"
#include "code\modules\surgery\surgery.dm"
#include "code\modules\surgery\~defines.dm"
#include "code\modules\tables\flipping.dm"
#include "code\modules\tables\interactions.dm"
#include "code\modules\tables\presets.dm"
@@ -1731,6 +1928,10 @@
#include "code\modules\virus2\isolator.dm"
#include "code\modules\virus2\items_devices.dm"
#include "code\modules\web_interface\webint_procs.dm"
#include "code\modules\wireless\devices.dm"
#include "code\modules\wireless\interfaces.dm"
#include "code\modules\xgm\xgm_gas_data.dm"
#include "code\modules\xgm\xgm_gas_mixture.dm"
#include "code\TriDimension\controller.dm"
#include "code\TriDimension\controller_presets.dm"
#include "code\TriDimension\Movement.dm"
@@ -1738,9 +1939,14 @@
#include "code\TriDimension\Structures.dm"
#include "code\TriDimension\Structures_presets.dm"
#include "code\TriDimension\Turfs.dm"
#include "code\unit_tests\equipment_tests.dm"
#include "code\unit_tests\foundation_tests.dm"
#include "code\unit_tests\map_tests.dm"
#include "code\unit_tests\mob_tests.dm"
#include "code\unit_tests\observation_tests.dm"
#include "code\unit_tests\unit_test.dm"
#include "code\unit_tests\zas_tests.dm"
#include "code\ZAS\_docs.dm"
#include "code\ZAS\_gas_mixture_xgm.dm"
#include "code\ZAS\_xgm_gas_data.dm"
#include "code\ZAS\Airflow.dm"
#include "code\ZAS\Atom.dm"
#include "code\ZAS\Connection.dm"
@@ -1750,7 +1956,6 @@
#include "code\ZAS\Debug.dm"
#include "code\ZAS\Diagnostic.dm"
#include "code\ZAS\Fire.dm"
#include "code\ZAS\Gas.dm"
#include "code\ZAS\Phoron.dm"
#include "code\ZAS\Turf.dm"
#include "code\ZAS\Variable Settings.dm"
+2 -2
View File
@@ -12,14 +12,14 @@
#define PIPE_COLOR_CYAN "#00ffff"
#define PIPE_COLOR_GREEN "#00ff00"
#define PIPE_COLOR_YELLOW "#ffcc00"
#define PIPE_COLOR_PURPLE "#5c1ec0"
#define PIPE_COLOR_BLACK "#444444"
#define CONNECT_TYPE_REGULAR 1
#define CONNECT_TYPE_SUPPLY 2
#define CONNECT_TYPE_SCRUBBER 4
#define CONNECT_TYPE_HE 8
var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE)
var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "black" = PIPE_COLOR_BLACK)
/proc/pipe_color_lookup(var/color)
for(var/C in pipe_colors)
+1 -1
View File
@@ -15,7 +15,7 @@
/obj/machinery/atmospherics/var/debug = 0
/client/proc/atmos_toggle_debug(var/obj/machinery/atmospherics/M in view())
/client/proc/atmos_toggle_debug(var/obj/machinery/atmospherics/M in range(world.view))
set name = "Toggle Debug Messages"
set category = "Debug"
M.debug = !M.debug
+1 -1
View File
@@ -49,7 +49,7 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/proc/add_underlay(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type)
if(node)
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
//underlays += icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node))
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
else
@@ -8,8 +8,6 @@
#define PRESSURE_CHECK_INPUT 2
#define PRESSURE_CHECK_OUTPUT 4
#undefine
/obj/machinery/atmospherics/binary/dp_vent_pump
icon = 'icons/atmos/vent_pump.dmi'
icon_state = "map_dp_vent"
@@ -69,7 +67,7 @@
if(!istype(T))
return
if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
vent_icon += "h"
if(!powered())
@@ -85,7 +83,7 @@
var/turf/T = get_turf(src)
if(!istype(T))
return
if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
return
else
if (node1)
@@ -258,4 +256,14 @@
spawn(2)
broadcast_status()
update_icon()
update_icon()
#undef DEFAULT_PRESSURE_DELTA
#undef EXTERNAL_PRESSURE_BOUND
#undef INTERNAL_PRESSURE_BOUND
#undef PRESSURE_CHECKS
#undef PRESSURE_CHECK_EXTERNAL
#undef PRESSURE_CHECK_INPUT
#undef PRESSURE_CHECK_OUTPUT
@@ -2,8 +2,6 @@
#define REGULATE_INPUT 1 //shuts off when input side is below the target pressure
#define REGULATE_OUTPUT 2 //shuts off when output side is above the target pressure
#undefine
/obj/machinery/atmospherics/binary/passive_gate
icon = 'icons/atmos/passive_gate.dmi'
icon_state = "map"
@@ -13,7 +11,7 @@
desc = "A one-way air valve that can be used to regulate input or output pressure, and flow rate. Does not require power."
use_power = 0
interact_offline = 1
var/unlocked = 0 //If 0, then the valve is locked closed, otherwise it is open(-able, it's a one-way valve so it closes if gas would flow backwards).
var/target_pressure = ONE_ATMOSPHERE
var/max_pressure_setting = 15000 //kPa
@@ -168,7 +166,7 @@
return
src.add_fingerprint(usr)
if(!src.allowed(user))
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
return
usr.set_machine(src)
ui_interact(user)
@@ -242,20 +240,24 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (unlocked)
user << "\red You cannot unwrench this [src], turn it off first."
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
#undef REGULATE_NONE
#undef REGULATE_INPUT
#undef REGULATE_OUTPUT
@@ -91,7 +91,7 @@
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
anchored = !anchored
user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor."
user << "<span class='notice'>You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.</span>"
if(anchored)
if(dir & (NORTH|SOUTH))
@@ -263,7 +263,7 @@
if(istype(W, /obj/item/weapon/wrench))
anchored = !anchored
turbine = null
user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor."
user << "<span class='notice'>You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.</span>"
updateConnection()
else
..()
@@ -286,4 +286,4 @@
if (usr.stat || usr.restrained() || anchored)
return
src.set_dir(turn(src.dir, 90))
src.set_dir(turn(src.dir, 90))
@@ -183,7 +183,7 @@ Thus, the two variables affect pump operation are set in New():
return
src.add_fingerprint(usr)
if(!src.allowed(user))
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
return
usr.set_machine(src)
ui_interact(user)
@@ -219,20 +219,20 @@ Thus, the two variables affect pump operation are set in New():
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && use_power)
user << "\red You cannot unwrench this [src], turn it off first."
user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench this [src], it too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
@@ -87,15 +87,15 @@
int_pressure += P.air.return_pressure()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "<span class='warning'>You cannot unwrench [src], it is too exerted due to internal pressure.</span>"
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
@@ -189,7 +189,7 @@
var/turf/T = get_turf(src)
if(!istype(T))
return
if(T.intact && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 )
if(!T.is_plating() && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 )
//pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node))
pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down")
else
@@ -299,4 +299,4 @@
update_ports()
return null
return null
@@ -134,22 +134,22 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (connected_device)
user << "\red You cannot unwrench this [src], dettach [connected_device] first."
user << "<span class='warning'>You cannot unwrench \the [src], dettach \the [connected_device] first.</span>"
return 1
if (locate(/obj/machinery/portable_atmospherics, src.loc))
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
@@ -40,7 +40,7 @@
..()
switch(filter_type)
if(0) //removing hydrocarbons
filtered_out = list("phoron", "oxygen_agent_b")
filtered_out = list("phoron")
if(1) //removing O2
filtered_out = list("oxygen")
if(2) //removing N2
@@ -95,10 +95,10 @@
/obj/machinery/atmospherics/trinary/filter/process()
..()
last_power_draw = 0
last_flow_rate = 0
if((stat & (NOPOWER|BROKEN)) || !use_power)
return
@@ -134,16 +134,16 @@
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
@@ -153,7 +153,7 @@
return
if(!src.allowed(user))
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
return
var/dat
@@ -206,7 +206,6 @@
switch(filter_type)
if(0) //removing hydrocarbons
filtered_out += "phoron"
filtered_out += "oxygen_agent_b"
if(1) //removing O2
filtered_out += "oxygen"
if(2) //removing N2
@@ -109,15 +109,15 @@
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
@@ -127,7 +127,7 @@
return
src.add_fingerprint(usr)
if(!src.allowed(user))
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
return
usr.set_machine(src)
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[use_power?"On":"Off"]</a><br>
+9 -9
View File
@@ -308,7 +308,7 @@
if(!powered())
return
if(!src.allowed(user))
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
return
..()
@@ -350,21 +350,21 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
user << "\red You cannot unwrench this [src], it's too complicated."
user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warnng'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
@@ -448,7 +448,7 @@
if(!powered())
return
if(!src.allowed(user))
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
return
..()
@@ -482,4 +482,4 @@
if(state)
go_straight()
else
go_to_side()
go_to_side()
@@ -69,21 +69,21 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
if (level==1 && isturf(T) && !T.is_plating())
user << "<span class='warning'>You must remove the plating first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
qdel(src)
+27 -24
View File
@@ -7,8 +7,6 @@
#define PRESSURE_CHECK_EXTERNAL 1
#define PRESSURE_CHECK_INTERNAL 2
#undefine
/obj/machinery/atmospherics/unary/vent_pump
icon = 'icons/atmos/vent_pump.dmi'
icon_state = "map_vent"
@@ -118,7 +116,7 @@
if(!istype(T))
return
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
vent_icon += "h"
if(welded)
@@ -136,7 +134,7 @@
var/turf/T = get_turf(src)
if(!istype(T))
return
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
return
else
if(node)
@@ -160,7 +158,7 @@
/obj/machinery/atmospherics/unary/vent_pump/process()
..()
if (hibernate)
if (hibernate > world.time)
return 1
if (!node)
@@ -190,12 +188,8 @@
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(pump_direction && pressure_checks == PRESSURE_CHECK_EXTERNAL) //99% of all vents
hibernate = world.time + (rand(100,200))
if (power_draw >= 0)
@@ -358,22 +352,22 @@
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user))
user << "\blue Now welding the vent."
user << "<span class='notice'>Now welding the vent.</span>"
if(do_after(user, 20))
if(!src || !WT.isOn()) return
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
if(!welded)
user.visible_message("[user] welds the vent shut.", "You weld the vent shut.", "You hear welding.")
user.visible_message("<span class='notice'>\The [user] welds the vent shut.</span>", "<span class='notice'>You weld the vent shut.</span>", "You hear welding.")
welded = 1
update_icon()
else
user.visible_message("[user] unwelds the vent.", "You unweld the vent.", "You hear welding.")
user.visible_message("<span class='notice'>[user] unwelds the vent.</span>", "<span class='notice'>You unweld the vent.</span>", "You hear welding.")
welded = 0
update_icon()
else
user << "\blue The welding tool needs to be on to start this task."
user << "<span class='notice'>The welding tool needs to be on to start this task.</span>"
else
user << "\blue You need more welding fuel to complete this task."
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
return 1
else
..()
@@ -396,25 +390,25 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && use_power)
user << "\red You cannot unwrench this [src], turn it off first."
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
return 1
var/turf/T = src.loc
if (node && node.level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
if (node && node.level==1 && isturf(T) && !T.is_plating())
user << "<span class='warning'>You must remove the plating first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
@@ -424,3 +418,12 @@
initial_loc.air_vent_names -= id_tag
..()
return
#undef DEFAULT_PRESSURE_DELTA
#undef EXTERNAL_PRESSURE_BOUND
#undef INTERNAL_PRESSURE_BOUND
#undef PRESSURE_CHECKS
#undef PRESSURE_CHECK_EXTERNAL
#undef PRESSURE_CHECK_INTERNAL
@@ -72,7 +72,7 @@
var/turf/T = get_turf(src)
if(!istype(T))
return
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
return
else
if(node)
@@ -127,7 +127,7 @@
/obj/machinery/atmospherics/unary/vent_scrubber/process()
..()
if (hibernate)
if (hibernate > world.time)
return 1
if (!node)
@@ -150,11 +150,9 @@
power_draw = pump_gas(src, environment, air_contents, transfer_moles, power_rating)
if(scrubbing && power_draw < 0 && controller_iteration > 10) //99% of all scrubbers
if(scrubbing && power_draw <= 0) //99% of all scrubbers
//Fucking hibernate because you ain't doing shit.
hibernate = 1
spawn(rand(100,200)) //hibernate for 10 or 20 seconds randomly
hibernate = 0
hibernate = world.time + (rand(100,200))
if (power_draw >= 0)
last_power_draw = power_draw
@@ -258,25 +256,25 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && use_power)
user << "\red You cannot unwrench this [src], turn it off first."
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
return 1
var/turf/T = src.loc
if (node && node.level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
if (node && node.level==1 && isturf(T) && !T.is_plating())
user << "<span class='warning'>You must remove the plating first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
+7 -7
View File
@@ -241,7 +241,7 @@
if(!powered())
return
if(!src.allowed(user))
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
return
..()
@@ -294,21 +294,21 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital))
user << "\red You cannot unwrench this [src], it's too complicated."
user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
+8 -8
View File
@@ -181,7 +181,7 @@ obj/machinery/atmospherics/mains_pipe/simple
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
hidden
@@ -243,7 +243,7 @@ obj/machinery/atmospherics/mains_pipe/manifold
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
update_icon()
@@ -293,7 +293,7 @@ obj/machinery/atmospherics/mains_pipe/manifold4w
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
update_icon()
@@ -354,7 +354,7 @@ obj/machinery/atmospherics/mains_pipe/split
N1.merge(N2)
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
update_icon()
@@ -475,7 +475,7 @@ obj/machinery/atmospherics/mains_pipe/split3
N1.merge(N2)
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
update_icon()
@@ -525,7 +525,7 @@ obj/machinery/atmospherics/mains_pipe/cap
..()
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
hidden
@@ -649,7 +649,7 @@ obj/machinery/atmospherics/mains_pipe/valve
attack_hand(mob/user as mob)
if(!src.allowed(user))
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
return
..()
@@ -704,4 +704,4 @@ obj/machinery/atmospherics/mains_pipe/valve
close()
else
open()
*/
*/
+37 -51
View File
@@ -1,8 +1,7 @@
/obj/machinery/atmospherics/pipe
var/datum/gas_mixture/air_temporary //used when reconstructing a pipeline that broke
var/datum/gas_mixture/air_temporary // used when reconstructing a pipeline that broke
var/datum/pipeline/parent
var/volume = 0
force = 20
@@ -20,10 +19,12 @@
return -1
/obj/machinery/atmospherics/pipe/New()
..()
//so pipes under walls are hidden
if(istype(get_turf(src), /turf/simulated/wall) || istype(get_turf(src), /turf/simulated/shuttle/wall) || istype(get_turf(src), /turf/unsimulated/wall))
level = 1
..()
/obj/machinery/atmospherics/pipe/hides_under_flooring()
return level != 2
/obj/machinery/atmospherics/pipe/proc/pipeline_expansion()
return null
@@ -81,22 +82,22 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
if (level==1 && isturf(T) && !T.is_plating())
user << "<span class='warning'>You must remove the plating first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "<span class='warning'>You cannot unwrench [src], it is too exerted due to internal pressure.</span>"
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
@@ -188,7 +189,7 @@
initialize_directions = SOUTH|WEST
/obj/machinery/atmospherics/pipe/simple/hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
if(istype(loc, /turf/simulated))
invisibility = i ? 101 : 0
update_icon()
@@ -214,7 +215,7 @@
else return 1
/obj/machinery/atmospherics/pipe/simple/proc/burst()
src.visible_message("\red \bold [src] bursts!");
src.visible_message("<span class='danger'>\The [src] bursts!</span>");
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
var/datum/effect/effect/system/smoke_spread/smoke = new
smoke.set_up(1,0, src.loc, 0)
@@ -297,9 +298,8 @@
qdel(src)
return
var/turf/T = get_turf(src)
if(istype(T))
hide(T.intact)
var/turf/T = loc
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference)
@@ -348,8 +348,8 @@
/obj/machinery/atmospherics/pipe/simple/visible/green
color = PIPE_COLOR_GREEN
/obj/machinery/atmospherics/pipe/simple/visible/purple
color = PIPE_COLOR_PURPLE
/obj/machinery/atmospherics/pipe/simple/visible/black
color = PIPE_COLOR_BLACK
/obj/machinery/atmospherics/pipe/simple/visible/red
color = PIPE_COLOR_RED
@@ -390,8 +390,8 @@
/obj/machinery/atmospherics/pipe/simple/hidden/green
color = PIPE_COLOR_GREEN
/obj/machinery/atmospherics/pipe/simple/hidden/purple
color = PIPE_COLOR_PURPLE
/obj/machinery/atmospherics/pipe/simple/hidden/black
color = PIPE_COLOR_BLACK
/obj/machinery/atmospherics/pipe/simple/hidden/red
color = PIPE_COLOR_RED
@@ -446,7 +446,7 @@
initialize_directions = NORTH|EAST|SOUTH
/obj/machinery/atmospherics/pipe/manifold/hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
if(istype(loc, /turf/simulated))
invisibility = i ? 101 : 0
update_icon()
@@ -582,8 +582,7 @@
return
var/turf/T = get_turf(src)
if(istype(T))
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
/obj/machinery/atmospherics/pipe/manifold/visible
@@ -617,8 +616,8 @@
/obj/machinery/atmospherics/pipe/manifold/visible/green
color = PIPE_COLOR_GREEN
/obj/machinery/atmospherics/pipe/manifold/visible/purple
color = PIPE_COLOR_PURPLE
/obj/machinery/atmospherics/pipe/manifold/visible/black
color = PIPE_COLOR_BLACK
/obj/machinery/atmospherics/pipe/manifold/visible/red
color = PIPE_COLOR_RED
@@ -659,8 +658,8 @@
/obj/machinery/atmospherics/pipe/manifold/hidden/green
color = PIPE_COLOR_GREEN
/obj/machinery/atmospherics/pipe/manifold/hidden/purple
color = PIPE_COLOR_PURPLE
/obj/machinery/atmospherics/pipe/manifold/hidden/black
color = PIPE_COLOR_BLACK
/obj/machinery/atmospherics/pipe/manifold/hidden/red
color = PIPE_COLOR_RED
@@ -806,7 +805,7 @@
update_icon()
/obj/machinery/atmospherics/pipe/manifold4w/hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
if(istype(loc, /turf/simulated))
invisibility = i ? 101 : 0
update_icon()
@@ -841,8 +840,7 @@
return
var/turf/T = get_turf(src)
if(istype(T))
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
/obj/machinery/atmospherics/pipe/manifold4w/visible
@@ -876,8 +874,8 @@
/obj/machinery/atmospherics/pipe/manifold4w/visible/green
color = PIPE_COLOR_GREEN
/obj/machinery/atmospherics/pipe/manifold4w/visible/purple
color = PIPE_COLOR_PURPLE
/obj/machinery/atmospherics/pipe/manifold4w/visible/black
color = PIPE_COLOR_BLACK
/obj/machinery/atmospherics/pipe/manifold4w/visible/red
color = PIPE_COLOR_RED
@@ -917,8 +915,8 @@
/obj/machinery/atmospherics/pipe/manifold4w/hidden/green
color = PIPE_COLOR_GREEN
/obj/machinery/atmospherics/pipe/manifold4w/hidden/purple
color = PIPE_COLOR_PURPLE
/obj/machinery/atmospherics/pipe/manifold4w/hidden/black
color = PIPE_COLOR_BLACK
/obj/machinery/atmospherics/pipe/manifold4w/hidden/red
color = PIPE_COLOR_RED
@@ -946,7 +944,7 @@
initialize_directions = dir
/obj/machinery/atmospherics/pipe/cap/hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
if(istype(loc, /turf/simulated))
invisibility = i ? 101 : 0
update_icon()
@@ -997,7 +995,7 @@
break
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
/obj/machinery/atmospherics/pipe/cap/visible
@@ -1120,20 +1118,8 @@
return
if(istype(W, /obj/item/device/analyzer) && in_range(user, src))
for (var/mob/O in viewers(user, null))
O << "\red [user] has used the analyzer on \icon[icon]"
var/pressure = parent.air.return_pressure()
var/total_moles = parent.air.total_moles
user << "\blue Results of analysis of \icon[icon]"
if (total_moles>0)
user << "\blue Pressure: [round(pressure,0.1)] kPa"
for(var/g in parent.air.gas)
user << "\blue [gas_data.name[g]]: [round((parent.air.gas[g] / total_moles) * 100)]%"
user << "\blue Temperature: [round(parent.air.temperature-T0C)]&deg;C"
else
user << "\blue Tank is empty!"
var/obj/item/device/analyzer/A = W
A.analyze_gases(src, user)
/obj/machinery/atmospherics/pipe/tank/air
name = "Pressure Tank (Air)"
@@ -1398,7 +1384,7 @@
/obj/machinery/atmospherics/proc/add_underlay_adapter(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type) //modified from add_underlay, does not make exposed underlays
if(node)
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
else
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
-645
View File
@@ -1,645 +0,0 @@
#define DEBUG
datum/air_group/var/marker
datum/air_group/var/debugging = 0
datum/pipe_network/var/marker
datum/gas_mixture
var/turf/parent
/*
turf/simulated
New()
..()
if(air)
air.parent = src
*/
obj/machinery/door
verb
toggle_door()
set src in world
if(density)
open()
else
close()
turf/space
verb
create_floor()
set src in world
new /turf/simulated/floor(src)
create_meteor(direction as num)
set src in world
var/obj/effect/meteor/M = new( src )
walk(M, direction,10)
turf/simulated/wall
verb
create_floor()
set src in world
new /turf/simulated/floor(src)
obj/item/weapon/tank
verb
adjust_mixture(temperature as num, target_toxin_pressure as num, target_oxygen_pressure as num)
set src in world
if(!air_contents)
usr << "\red ERROR: no gas_mixture associated with this tank"
return null
air_contents.temperature = temperature
air_contents.oxygen = target_oxygen_pressure*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
air_contents.toxins = target_toxin_pressure*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
turf/simulated/floor
verb
parent_info()
set src in world
if(parent)
usr << "<B>[x],[y] parent:</B> Processing: [parent.group_processing]"
if(parent.members)
usr << "Members: [parent.members.len]"
else
usr << "Members: None?"
if(parent.borders)
usr << "Borders: [parent.borders.len]"
else
usr << "Borders: None"
if(parent.length_space_border)
usr << "Space Borders: [parent.space_borders.len], Space Length: [parent.length_space_border]"
else
usr << "Space Borders: None"
else
usr << "\blue [x],[y] has no parent air group."
verb
create_wall()
set src in world
new /turf/simulated/wall(src)
verb
adjust_mixture(temp as num, tox as num, oxy as num)
set src in world
var/datum/gas_mixture/stuff = return_air()
stuff.temperature = temp
stuff.toxins = tox
stuff.oxygen = oxy
verb
boom(inner_range as num, middle_range as num, outer_range as num)
set src in world
explosion(src,inner_range,middle_range,outer_range,outer_range)
verb
flag_parent()
set src in world
if(parent)
parent.debugging = !parent.debugging
usr << "[parent.members.len] set to [parent.debugging]"
verb
small_explosion()
set src in world
explosion(src, 1, 2, 3, 3)
verb
large_explosion()
set src in world
explosion(src, 3, 5, 7, 5)
obj/machinery/portable_atmospherics/canister
verb/test_release()
set src in world
set category = "Minor"
valve_open = 1
release_pressure = 1000
/*
obj/machinery/atmospherics
unary
heat_reservoir
verb
toggle_power()
set src in world
set category = "Minor"
on = !on
update_icon()
adjust_temp(temp as num)
set src in world
set category = "Minor"
current_temperature = temp
cold_sink
verb
toggle_power()
set src in world
set category = "Minor"
on = !on
update_icon()
adjust_temp(temp as num)
set src in world
set category = "Minor"
current_temperature = temp
vent_pump
verb
toggle_power()
set src in world
set category = "Minor"
on = !on
update_icon()
toggle_direction()
set src in world
set category = "Minor"
pump_direction = !pump_direction
update_icon()
change_pressure_parameters()
set src in world
set category = "Minor"
usr << "current settings: PC=[pressure_checks], EB=[external_pressure_bound], IB=[internal_pressure_bound]"
var/mode = input(usr, "Select an option:") in list("Bound External", "Bound Internal", "Bound Both")
switch(mode)
if("Bound External")
pressure_checks = 1
external_pressure_bound = input(usr, "External Pressure Bound?") as num
if("Bound Internal")
pressure_checks = 2
internal_pressure_bound = input(usr, "Internal Pressure Bound?") as num
else
pressure_checks = 3
external_pressure_bound = input(usr, "External Pressure Bound?") as num
internal_pressure_bound = input(usr, "Internal Pressure Bound?") as num
outlet_injector
verb
toggle_power()
set src in world
set category = "Minor"
on = !on
update_icon()
verb
trigger_inject()
set src in world
set category = "Minor"
inject()
vent_scrubber
verb
toggle_power()
set src in world
set category = "Minor"
on = !on
update_icon()
toggle_scrubbing()
set src in world
set category = "Minor"
scrubbing = !scrubbing
update_icon()
change_rate(amount as num)
set src in world
set category = "Minor"
volume_rate = amount
mixer
verb
toggle()
set src in world
set category = "Minor"
on = !on
update_icon()
change_pressure(amount as num)
set src in world
set category = "Minor"
target_pressure = amount
change_ratios()
set src in world
set category = "Minor"
if(node_in1)
var/node_ratio = input(usr, "Node 1 Ratio? ([dir2text(get_dir(src, node_in1))])") as num
node_ratio = min(max(0,node_ratio),1)
node1_concentration = node_ratio
node2_concentration = 1-node_ratio
else
node2_concentration = 1
node1_concentration = 0
usr << "Node 1: [node1_concentration], Node 2: [node2_concentration]"
filter
verb
toggle()
set src in world
set category = "Minor"
on = !on
update_icon()
change_pressure(amount as num)
set src in world
set category = "Minor"
target_pressure = amount
unary/oxygen_generator
verb
toggle()
set src in world
set category = "Minor"
on = !on
update_icon()
change_rate(amount as num)
set src in world
set category = "Minor"
oxygen_content = amount
binary/pump
verb
debug()
set src in world
set category = "Minor"
world << "Debugging: [x],[y]"
if(node1)
world << "Input node: [node1.x],[node1.y] [network1]"
if(node2)
world << "Output node: [node2.x],[node2.y] [network2]"
toggle()
set src in world
set category = "Minor"
on = !on
update_icon()
change_pressure(amount as num)
set src in world
set category = "Minor"
target_pressure = amount
valve
verb
toggle()
set src in world
set category = "Minor"
if(open)
close()
else
open()
network_data()
set src in world
set category = "Minor"
world << "\blue [x],[y]"
world << "network 1: [network_node1.normal_members.len], [network_node1.line_members.len]"
for(var/obj/O in network_node1.normal_members)
world << "member: [O.x], [O.y]"
world << "network 2: [network_node2.normal_members.len], [network_node2.line_members.len]"
for(var/obj/O in network_node2.normal_members)
world << "member: [O.x], [O.y]"
pipe
verb
destroy()
set src in world
set category = "Minor"
qdel(src)
pipeline_data()
set src in world
set category = "Minor"
if(parent)
usr << "[x],[y] is in a pipeline with [parent.members.len] members ([parent.edges.len] edges)! Volume: [parent.air.volume]"
usr << "Pressure: [parent.air.return_pressure()], Temperature: [parent.air.temperature]"
usr << "[parent.air.oxygen], [parent.air.toxins], [parent.air.nitrogen], [parent.air.carbon_dioxide] .. [parent.alert_pressure]"
*/
mob
verb
flag_all_pipe_networks()
set category = "Debug"
for(var/datum/pipe_network/network in pipe_networks)
network.update = 1
mark_pipe_networks()
set category = "Debug"
for(var/datum/pipe_network/network in pipe_networks)
network.marker = rand(1,4)
for(var/obj/machinery/atmospherics/pipe/P in world)
P.overlays.Cut()
var/datum/pipe_network/master = P.return_network()
if(master)
P.overlays += icon('icons/Testing/atmos_testing.dmi',"marker[master.marker]")
else
world << "error"
P.overlays += icon('icons/Testing/atmos_testing.dmi',"marker0")
for(var/obj/machinery/atmospherics/valve/V in world)
V.overlays.Cut()
if(V.network_node1)
V.overlays += icon('icons/Testing/atmos_testing.dmi',"marker[V.network_node1.marker]")
else
V.overlays += icon('icons/Testing/atmos_testing.dmi',"marker0")
if(V.network_node2)
V.overlays += icon('icons/Testing/atmos_testing.dmi',"marker[V.network_node2.marker]")
else
V.overlays += icon('icons/Testing/atmos_testing.dmi',"marker0")
turf/simulated
var/fire_verbose = 0
verb
mark_direction()
set src in world
overlays.Cut()
for(var/direction in list(NORTH,SOUTH,EAST,WEST))
if(group_border&direction)
overlays += icon('icons/Testing/turf_analysis.dmi',"red_arrow",direction)
else if(air_check_directions&direction)
overlays += icon('icons/Testing/turf_analysis.dmi',"arrow",direction)
air_status()
set src in world
set category = "Minor"
var/datum/gas_mixture/GM = return_air()
usr << "\blue @[x],[y] ([GM.group_multiplier]): O:[GM.oxygen] T:[GM.toxins] N:[GM.nitrogen] C:[GM.carbon_dioxide] w [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(active_hotspot)?("\red BURNING"):(null)]"
for(var/datum/gas/trace_gas in GM.trace_gases)
usr << "[trace_gas.type]: [trace_gas.moles]"
force_temperature(temp as num)
set src in world
set category = "Minor"
if(parent&&parent.group_processing)
parent.suspend_group_processing()
air.temperature = temp
spark_temperature(temp as num, volume as num)
set src in world
set category = "Minor"
hotspot_expose(temp, volume)
fire_verbose()
set src in world
set category = "Minor"
fire_verbose = !fire_verbose
usr << "[x],[y] now [fire_verbose]"
add_sleeping_agent(amount as num)
set src in world
set category = "Minor"
if(amount>1)
var/datum/gas_mixture/adding = new
var/datum/gas/sleeping_agent/trace_gas = new
trace_gas.moles = amount
adding.trace_gases += trace_gas
adding.temperature = T20C
assume_air(adding)
obj/indicator
icon = 'icons/Testing/air_meter.dmi'
var/measure = "temperature"
anchored = 1
process()
icon_state = measurement()
proc/measurement()
var/turf/T = loc
if(!isturf(T)) return
var/datum/gas_mixture/GM = T.return_air()
switch(measure)
if("temperature")
if(GM.temperature < 0)
return "error"
return "[round(GM.temperature/100+0.5)]"
if("oxygen")
if(GM.oxygen < 0)
return "error"
return "[round(GM.oxygen/MOLES_CELLSTANDARD*10+0.5)]"
if("plasma")
if(GM.toxins < 0)
return "error"
return "[round(GM.toxins/MOLES_CELLSTANDARD*10+0.5)]"
if("nitrogen")
if(GM.nitrogen < 0)
return "error"
return "[round(GM.nitrogen/MOLES_CELLSTANDARD*10+0.5)]"
else
return "[round((GM.total_moles())/MOLES_CELLSTANDARD*10+0.5)]"
Click()
process()
obj/window
verb
destroy()
set category = "Minor"
set src in world
qdel(src)
mob
sight = SEE_OBJS|SEE_TURFS
verb
update_indicators()
set category = "Debug"
if(!air_master)
usr << "Cannot find air_system"
return
for(var/obj/indicator/T in world)
T.process()
change_indicators()
set category = "Debug"
if(!air_master)
usr << "Cannot find air_system"
return
var/str = input("Select") in list("oxygen", "nitrogen","plasma","all","temperature")
for(var/obj/indicator/T in world)
T.measure = str
T.process()
fire_report()
set category = "Debug"
usr << "\b \red Fire Report"
for(var/obj/effect/hotspot/flame in world)
usr << "[flame.x],[flame.y]: [flame.temperature]K, [flame.volume] L - [flame.loc:air:temperature]"
process_cycle()
set category = "Debug"
if(!master_controller)
usr << "Cannot find master_controller"
return
master_controller.process()
update_indicators()
process_cycles(amount as num)
set category = "Debug"
if(!master_controller)
usr << "Cannot find master_controller"
return
var/start_time = world.timeofday
for(var/i=1; i<=amount; i++)
master_controller.process()
world << "Ended [amount] cycles in [(world.timeofday-start_time)/10] seconds. [(world.timeofday-start_time)/10-amount] calculation lag"
update_indicators()
process_updates_early()
set category = "Debug"
if(!air_master)
usr << "Cannot find air_system"
return
air_master.process_update_tiles()
air_master.process_rebuild_select_groups()
mark_group_delay()
set category = "Debug"
if(!air_master)
usr << "Cannot find air_system"
return
for(var/datum/air_group/group in air_master.air_groups)
group.marker = 0
for(var/turf/simulated/floor/S in world)
S.icon = 'icons/Testing/turf_analysis.dmi'
if(S.parent)
if(S.parent.group_processing)
if (S.parent.check_delay < 2)
S.parent.marker=1
else if (S.parent.check_delay < 5)
S.parent.marker=2
else if (S.parent.check_delay < 15)
S.parent.marker=3
else if (S.parent.check_delay < 30)
S.parent.marker=4
else
S.parent.marker=5
if(S.parent.borders && S.parent.borders.Find(S))
S.icon_state = "on[S.parent.marker]_border"
else
S.icon_state = "on[S.parent.marker]"
else
if (S.check_delay < 2)
S.icon_state= "on1_border"
else if (S.check_delay < 5)
S.icon_state= "on2_border"
else if (S.check_delay < 15)
S.icon_state= "on3_border"
else if (S.check_delay < 30)
S.icon_state= "on4_border"
else
S.icon_state = "suspended"
else
if(S.processing)
S.icon_state = "individual_on"
else
S.icon_state = "individual_off"
mark_groups()
set category = "Debug"
if(!air_master)
usr << "Cannot find air_system"
return
for(var/datum/air_group/group in air_master.air_groups)
group.marker = 0
for(var/turf/simulated/floor/S in world)
S.icon = 'icons/Testing/turf_analysis.dmi'
if(S.parent)
if(S.parent.group_processing)
if(S.parent.marker == 0)
S.parent.marker = rand(1,5)
if(S.parent.borders && S.parent.borders.Find(S))
S.icon_state = "on[S.parent.marker]_border"
else
S.icon_state = "on[S.parent.marker]"
else
S.icon_state = "suspended"
else
if(S.processing)
S.icon_state = "individual_on"
else
S.icon_state = "individual_off"
get_broken_icons()
set category = "Debug"
getbrokeninhands()
/* jump_to_dead_group() Currently in the normal admin commands but fits here
set category = "Debug"
if(!air_master)
usr << "Cannot find air_system"
return
var/datum/air_group/dead_groups = list()
for(var/datum/air_group/group in air_master.air_groups)
if (!group.group_processing)
dead_groups += group
var/datum/air_group/dest_group = pick(dead_groups)
usr.loc = pick(dest_group.members)*/
-286
View File
@@ -1,286 +0,0 @@
datum/air_group
var/group_processing = 1 //Processing all tiles as one large tile if 1
var/datum/gas_mixture/air = new
var/current_cycle = 0 //cycle that oxygen value represents
var/archived_cycle = 0 //cycle that oxygen_archived value represents
//The use of archived cycle saves processing power by permitting the archiving step of FET
// to be rolled into the updating step
//optimization vars
var/next_check = 0 //number of ticks before this group updates
var/check_delay = 10 //number of ticks between updates, starts fairly high to get boring groups out of the way
proc/members()
//Returns the members of the group
proc/process_group()
var/list/borders //Tiles that connect this group to other groups/individual tiles
var/list/members //All tiles in this group
var/list/space_borders
var/length_space_border = 0
proc/suspend_group_processing()
group_processing = 0
update_tiles_from_group()
check_delay=0
next_check=0
//Copy group air information to individual tile air
//Used right before turning on group processing
proc/update_group_from_tiles()
var/sample_member = pick(members)
var/datum/gas_mixture/sample_air = sample_member:air
air.copy_from(sample_air)
air.group_multiplier = members.len
return 1
//Copy group air information to individual tile air
//Used right before turning off group processing
proc/update_tiles_from_group()
for(var/member in members)
member:air.copy_from(air)
if (istype(member,/turf/simulated))
var/turf/simulated/turfmem=member
turfmem.reset_delay()
proc/archive()
air.archive()
archived_cycle = air_master.current_cycle
//If individually processing tiles, checks all member tiles to see if they are close enough that the group may resume group processing
//Warning: Do not call, called by air_master.process()
proc/check_regroup()
//Purpose: Checks to see if group processing should be turned back on
//Returns: group_processing
if(prevent_airgroup_regroup)
return 0
if(group_processing) return 1
var/turf/simulated/sample = pick(members)
for(var/member in members)
if(member:active_hotspot)
return 0
if(member:air.compare(sample.air)) continue
else
return 0
update_group_from_tiles()
group_processing = 1
return 1
//Look into this
turf/process_group()
current_cycle = air_master.current_cycle
if(!group_processing) //Revert to individual processing then end
for(var/T in members)
var/turf/simulated/member = T
member.process_cell()
return
//check if we're skipping this tick
if (next_check > 0)
next_check--
return 1
var/player_count = max(player_list.len, 3) / 3
next_check += check_delay + rand(player_count, player_count * 1.5)
check_delay++
var/turf/simulated/list/border_individual = list()
var/datum/air_group/list/border_group = list()
var/turf/simulated/list/enemies = list() //used to send the appropriate border tile of a group to the group proc
var/turf/simulated/list/self_group_borders = list()
var/turf/simulated/list/self_tile_borders = list()
if(archived_cycle < air_master.current_cycle)
archive()
//Archive air data for use in calculations
//But only if another group didn't store it for us
for(var/turf/simulated/border_tile in src.borders)
for(var/direction in cardinal) //Go through all border tiles and get bordering groups and individuals
if(border_tile.group_border&direction)
var/turf/simulated/enemy_tile = get_step(border_tile, direction) //Add found tile to appropriate category
if(istype(enemy_tile) && enemy_tile.parent && enemy_tile.parent.group_processing)
border_group += enemy_tile.parent
enemies += enemy_tile
self_group_borders += border_tile
else
border_individual += enemy_tile
self_tile_borders += border_tile
var/abort_group = 0
// Process connections to adjacent groups
var/border_index = 1
for(var/datum/air_group/AG in border_group)
if(AG.archived_cycle < archived_cycle) //archive other groups information if it has not been archived yet this cycle
AG.archive()
if(AG.current_cycle < current_cycle)
//This if statement makes sure two groups only process their individual connections once!
//Without it, each connection would be processed a second time as the second group is evaluated
var/connection_difference = 0
var/turf/simulated/floor/self_border = self_group_borders[border_index]
var/turf/simulated/floor/enemy_border = enemies[border_index]
var/result = air.check_gas_mixture(AG.air)
if(result == 1)
connection_difference = air.share(AG.air)
else if(result == -1)
AG.suspend_group_processing()
connection_difference = air.share(enemy_border.air)
else
abort_group = 1
break
if(connection_difference)
if(connection_difference > 0)
self_border.consider_pressure_difference(connection_difference, get_dir(self_border,enemy_border))
else
var/turf/enemy_turf = enemy_border
if(!isturf(enemy_turf))
enemy_turf = enemy_border.loc
enemy_turf.consider_pressure_difference(-connection_difference, get_dir(enemy_turf,self_border))
border_index++
// Process connections to adjacent tiles
border_index = 1
if(!abort_group)
for(var/atom/enemy_tile in border_individual)
var/connection_difference = 0
var/turf/simulated/floor/self_border = self_tile_borders[border_index]
if(istype(enemy_tile, /turf/simulated))
if(enemy_tile:archived_cycle < archived_cycle) //archive tile information if not already done
enemy_tile:archive()
if(enemy_tile:current_cycle < current_cycle)
if(air.check_gas_mixture(enemy_tile:air))
connection_difference = air.share(enemy_tile:air)
else
abort_group = 1
break
else if(isturf(enemy_tile))
if(air.check_turf(enemy_tile))
connection_difference = air.mimic(enemy_tile)
else
abort_group = 1
break
if(connection_difference)
if(connection_difference > 0)
self_border.consider_pressure_difference(connection_difference, get_dir(self_border,enemy_tile))
else
var/turf/enemy_turf = enemy_tile
if(!isturf(enemy_turf))
enemy_turf = enemy_tile.loc
enemy_turf.consider_pressure_difference(-connection_difference, get_dir(enemy_tile,enemy_turf))
// Process connections to space
border_index = 1
if(!abort_group)
if(length_space_border > 0)
var/turf/space/sample = locate()
var/connection_difference = 0
if(air.check_turf(sample))
connection_difference = air.mimic(sample, length_space_border)
else
abort_group = 1
if(connection_difference)
for(var/turf/simulated/self_border in space_borders)
self_border.consider_pressure_difference_space(connection_difference)
if(abort_group)
suspend_group_processing()
else
if(air.check_tile_graphic())
for(var/T in members)
var/turf/simulated/member = T
member.update_visuals(air)
if(air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
for(var/T in members)
var/turf/simulated/member = T
member.hotspot_expose(air.temperature, CELL_VOLUME)
member.consider_superconductivity(starting=1)
air.react()
return
object/process_group()
current_cycle = air_master.current_cycle
if(!group_processing) return //See if processing this group as a group
var/turf/simulated/list/border_individual = list()
var/datum/air_group/list/border_group = list()
var/turf/simulated/list/enemies = list() //used to send the appropriate border tile of a group to the group proc
var/enemy_index = 1
if(archived_cycle < air_master.current_cycle)
archive()
//Archive air data for use in calculations
//But only if another group didn't store it for us
enemy_index = 1
var/abort_group = 0
for(var/datum/air_group/AG in border_group)
if(AG.archived_cycle < archived_cycle) //archive other groups information if it has not been archived yet this cycle
AG.archive()
if(AG.current_cycle < current_cycle)
//This if statement makes sure two groups only process their individual connections once!
//Without it, each connection would be processed a second time as the second group is evaluated
var/result = air.check_gas_mixture(AG.air)
if(result == 1)
air.share(AG.air)
else if(result == -1)
AG.suspend_group_processing()
var/turf/simulated/floor/enemy_border = enemies[enemy_index]
air.share(enemy_border.air)
else
abort_group = 0
break
enemy_index++
if(!abort_group)
for(var/enemy_tile in border_individual)
if(istype(enemy_tile, /turf/simulated))
if(enemy_tile:archived_cycle < archived_cycle) //archive tile information if not already done
enemy_tile:archive()
if(enemy_tile:current_cycle < current_cycle)
if(air.check_gas_mixture(enemy_tile:air))
air.share(enemy_tile:air)
else
abort_group = 1
break
else
if(air.check_turf(enemy_tile))
air.mimic(enemy_tile)
else
abort_group = 1
break
if(abort_group)
suspend_group_processing()
return
-178
View File
@@ -1,178 +0,0 @@
/atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return null
/turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
/turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
var/datum/gas_mixture/air_contents = return_air()
if(!air_contents)
return 0
if(active_hotspot)
if(soh)
if(air_contents.toxins > 0.5 && air_contents.oxygen > 0.5)
if(active_hotspot.temperature < exposed_temperature)
active_hotspot.temperature = exposed_temperature
if(active_hotspot.volume < exposed_volume)
active_hotspot.volume = exposed_volume
return 1
var/igniting = 0
if((exposed_temperature > PLASMA_MINIMUM_BURN_TEMPERATURE) && air_contents.toxins > 0.5)
igniting = 1
if(igniting)
if(air_contents.oxygen < 0.5 || air_contents.toxins < 0.5)
return 0
if(parent&&parent.group_processing)
parent.suspend_group_processing()
active_hotspot = new(src)
active_hotspot.temperature = exposed_temperature
active_hotspot.volume = exposed_volume
active_hotspot.just_spawned = (current_cycle < air_master.current_cycle)
//remove just_spawned protection if no longer processing this cell
//start processing quickly if we aren't already
reset_delay()
return igniting
//This is the icon for fire on turfs, also helps for nurturing small fires until they are full tile
/obj/effect/hotspot
anchored = 1
mouse_opacity = 0
unacidable = 1//So you can't melt fire with acid.
icon = 'icons/effects/fire.dmi'
icon_state = "1"
layer = TURF_LAYER
luminosity = 3
var/volume = 125
var/temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
var/just_spawned = 1
var/bypassing = 0
/obj/effect/hotspot/proc/perform_exposure()
var/turf/simulated/floor/location = loc
if(!istype(location)) return 0
if(volume > CELL_VOLUME*0.95) bypassing = 1
else bypassing = 0
if(bypassing)
if(!just_spawned)
volume = location.air.fuel_burnt*FIRE_GROWTH_RATE
temperature = location.air.temperature
else
var/datum/gas_mixture/affected = location.air.remove_ratio(volume/location.air.volume)
affected.temperature = temperature
affected.react()
temperature = affected.temperature
volume = affected.fuel_burnt*FIRE_GROWTH_RATE
location.assume_air(affected)
for(var/atom/item in loc)
if(!bypassing)
item.temperature_expose(null, temperature, volume)
if(item) // It's possible that the item is deleted in temperature_expose
item.fire_act(null, temperature, volume)
return 0
/obj/effect/hotspot/process(turf/simulated/list/possible_spread)
if(just_spawned)
just_spawned = 0
return 0
var/turf/simulated/floor/location = loc
if(!istype(location))
Kill()
return
if((temperature < FIRE_MINIMUM_TEMPERATURE_TO_EXIST) || (volume <= 1))
Kill()
return
if(location.air.toxins < 0.5 || location.air.oxygen < 0.5)
Kill()
return
perform_exposure()
if(location.wet) location.wet = 0
if(bypassing)
icon_state = "3"
location.burn_tile()
//Possible spread due to radiated heat
if(location.air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_SPREAD)
var/radiated_temperature = location.air.temperature*FIRE_SPREAD_RADIOSITY_SCALE
for(var/turf/simulated/possible_target in possible_spread)
if(!possible_target.active_hotspot)
possible_target.hotspot_expose(radiated_temperature, CELL_VOLUME/4)
else
if(volume > CELL_VOLUME*0.4)
icon_state = "2"
else
icon_state = "1"
if(temperature > location.max_fire_temperature_sustained)
location.max_fire_temperature_sustained = temperature
if(location.heat_capacity && temperature > location.heat_capacity)
location.to_be_destroyed = 1
/*if(prob(25))
location.ReplaceWithSpace()
return 0*/
return 1
// Garbage collect itself by nulling reference to it
/obj/effect/hotspot/proc/Kill()
DestroyTurf()
if(istype(loc, /turf/simulated))
var/turf/simulated/T = loc
if(T.active_hotspot == src)
T.active_hotspot = null
loc = null
/obj/effect/hotspot/proc/DestroyTurf()
if(istype(loc, /turf/simulated))
var/turf/simulated/T = loc
if(T.to_be_destroyed)
var/chance_of_deletion
if (T.heat_capacity) //beware of division by zero
chance_of_deletion = T.max_fire_temperature_sustained / T.heat_capacity * 8 //there is no problem with prob(23456), min() was redundant --rastaf0
else
chance_of_deletion = 100
if(prob(chance_of_deletion))
T.ChangeTurf(/turf/space)
else
T.to_be_destroyed = 0
T.max_fire_temperature_sustained = 0
/obj/effect/hotspot/New()
..()
set_dir(pick(cardinal))
return
/*
/obj/effect/hotspot/Destroy()
if (istype(loc, /turf/simulated))
DestroyTurf()
..()
*/
-933
View File
@@ -1,933 +0,0 @@
/*
What are the archived variables for?
Calculations are done using the archived variables with the results merged into the regular variables.
This prevents race conditions that arise based on the order of tile processing.
*/
#define SPECIFIC_HEAT_TOXIN 200
#define SPECIFIC_HEAT_AIR 20
#define SPECIFIC_HEAT_CDO 30
#define HEAT_CAPACITY_CALCULATION(oxygen,carbon_dioxide,nitrogen,toxins) \
(carbon_dioxide*SPECIFIC_HEAT_CDO + (oxygen+nitrogen)*SPECIFIC_HEAT_AIR + toxins*SPECIFIC_HEAT_TOXIN)
#define MINIMUM_HEAT_CAPACITY 0.0003
#define QUANTIZE(variable) (round(variable,0.0001))
/datum/gas
sleeping_agent
specific_heat = 40
oxygen_agent_b
specific_heat = 300
volatile_fuel
specific_heat = 30
var/moles = 0
var/specific_heat = 0
var/moles_archived = 0
/datum/gas_mixture
var/oxygen = 0
var/carbon_dioxide = 0
var/nitrogen = 0
var/toxins = 0
var/volume = CELL_VOLUME
var/temperature = 0 //in Kelvin, use calculate_temperature() to modify
var/group_multiplier = 1
//Size of the group this gas_mixture is representing.
//=1 for singletons
var/graphic
var/list/datum/gas/trace_gases = list()
var/tmp/oxygen_archived
var/tmp/carbon_dioxide_archived
var/tmp/nitrogen_archived
var/tmp/toxins_archived
var/tmp/temperature_archived
var/tmp/graphic_archived
var/tmp/fuel_burnt = 0
//PV=nRT - related procedures
proc/heat_capacity()
var/heat_capacity = HEAT_CAPACITY_CALCULATION(oxygen,carbon_dioxide,nitrogen,toxins)
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
heat_capacity += trace_gas.moles*trace_gas.specific_heat
return heat_capacity
proc/heat_capacity_archived()
var/heat_capacity_archived = HEAT_CAPACITY_CALCULATION(oxygen_archived,carbon_dioxide_archived,nitrogen_archived,toxins_archived)
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
heat_capacity_archived += trace_gas.moles_archived*trace_gas.specific_heat
return heat_capacity_archived
proc/total_moles()
var/moles = oxygen + carbon_dioxide + nitrogen + toxins
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
moles += trace_gas.moles
return moles
proc/return_pressure()
if(volume>0)
return total_moles()*R_IDEAL_GAS_EQUATION*temperature/volume
return 0
proc/return_temperature()
return temperature
proc/return_volume()
return max(0, volume)
proc/thermal_energy()
return temperature*heat_capacity()
//Procedures used for very specific events
proc/check_tile_graphic()
//returns 1 if graphic changed
graphic = null
if(toxins > MOLES_PLASMA_VISIBLE)
graphic = "plasma"
else
var/datum/gas/sleeping_agent = locate(/datum/gas/sleeping_agent) in trace_gases
if(sleeping_agent && (sleeping_agent.moles > 1))
graphic = "sleeping_agent"
else
graphic = null
return graphic != graphic_archived
proc/react(atom/dump_location)
var/reacting = 0 //set to 1 if a notable reaction occured (used by pipe_network)
if(trace_gases.len > 0)
if(temperature > 900)
if(toxins > MINIMUM_HEAT_CAPACITY && carbon_dioxide > MINIMUM_HEAT_CAPACITY)
var/datum/gas/oxygen_agent_b/trace_gas = locate(/datum/gas/oxygen_agent_b/) in trace_gases
if(trace_gas)
var/reaction_rate = min(carbon_dioxide*0.75, toxins*0.25, trace_gas.moles*0.05)
carbon_dioxide -= reaction_rate
oxygen += reaction_rate
trace_gas.moles -= reaction_rate*0.05
temperature -= (reaction_rate*20000)/heat_capacity()
reacting = 1
fuel_burnt = 0
if(temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
//world << "pre [temperature], [oxygen], [toxins]"
if(fire() > 0)
reacting = 1
//world << "post [temperature], [oxygen], [toxins]"
return reacting
proc/fire()
var/energy_released = 0
var/old_heat_capacity = heat_capacity()
var/datum/gas/volatile_fuel/fuel_store = locate(/datum/gas/volatile_fuel/) in trace_gases
if(fuel_store) //General volatile gas burn
var/burned_fuel = 0
if(oxygen < fuel_store.moles)
burned_fuel = oxygen
fuel_store.moles -= burned_fuel
oxygen = 0
else
burned_fuel = fuel_store.moles
oxygen -= fuel_store.moles
trace_gases -= fuel_store
fuel_store = null
energy_released += FIRE_CARBON_ENERGY_RELEASED * burned_fuel
carbon_dioxide += burned_fuel
fuel_burnt += burned_fuel
//Handle plasma burning
if(toxins > MINIMUM_HEAT_CAPACITY)
var/plasma_burn_rate = 0
var/oxygen_burn_rate = 0
//more plasma released at higher temperatures
var/temperature_scale
if(temperature > PLASMA_UPPER_TEMPERATURE)
temperature_scale = 1
else
temperature_scale = (temperature-PLASMA_MINIMUM_BURN_TEMPERATURE)/(PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE)
if(temperature_scale > 0)
oxygen_burn_rate = 1.4 - temperature_scale
if(oxygen > toxins*PLASMA_OXYGEN_FULLBURN)
plasma_burn_rate = (toxins*temperature_scale)/4
else
plasma_burn_rate = (temperature_scale*(oxygen/PLASMA_OXYGEN_FULLBURN))/4
if(plasma_burn_rate > MINIMUM_HEAT_CAPACITY)
toxins -= plasma_burn_rate
oxygen -= plasma_burn_rate*oxygen_burn_rate
carbon_dioxide += plasma_burn_rate
energy_released += FIRE_PLASMA_ENERGY_RELEASED * (plasma_burn_rate)
fuel_burnt += (plasma_burn_rate)*(1+oxygen_burn_rate)
if(energy_released > 0)
var/new_heat_capacity = heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity
return fuel_burnt
proc/archive()
//Update archived versions of variables
//Returns: 1 in all cases
proc/merge(datum/gas_mixture/giver)
//Merges all air from giver into self. Deletes giver.
//Returns: 1 on success (no failure cases yet)
proc/check_then_merge(datum/gas_mixture/giver)
//Similar to merge(...) but first checks to see if the amount of air assumed is small enough
// that group processing is still accurate for source (aborts if not)
//Returns: 1 on successful merge, 0 if the check failed
proc/remove(amount)
//Proportionally removes amount of gas from the gas_mixture
//Returns: gas_mixture with the gases removed
proc/remove_ratio(ratio)
//Proportionally removes amount of gas from the gas_mixture
//Returns: gas_mixture with the gases removed
proc/subtract(datum/gas_mixture/right_side)
//Subtracts right_side from air_mixture. Used to help turfs mingle
proc/check_then_remove(amount)
//Similar to remove(...) but first checks to see if the amount of air removed is small enough
// that group processing is still accurate for source (aborts if not)
//Returns: gas_mixture with the gases removed or null
proc/copy_from(datum/gas_mixture/sample)
//Copies variables from sample
proc/share(datum/gas_mixture/sharer)
//Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length
//Return: amount of gas exchanged (+ if sharer received)
proc/mimic(turf/model)
//Similar to share(...), except the model is not modified
//Return: amount of gas exchanged
proc/check_gas_mixture(datum/gas_mixture/sharer)
//Returns: 0 if the self-check failed then -1 if sharer-check failed then 1 if both checks pass
proc/check_turf(turf/model)
//Returns: 0 if self-check failed or 1 if check passes
// check_me_then_share(datum/gas_mixture/sharer)
//Similar to share(...) but first checks to see if amount of air moved is small enough
// that group processing is still accurate for source (aborts if not)
//Returns: 1 on successful share, 0 if the check failed
// check_me_then_mimic(turf/model)
//Similar to mimic(...) but first checks to see if amount of air moved is small enough
// that group processing is still accurate (aborts if not)
//Returns: 1 on successful mimic, 0 if the check failed
// check_both_then_share(datum/gas_mixture/sharer)
//Similar to check_me_then_share(...) but also checks to see if amount of air moved is small enough
// that group processing is still accurate for the sharer (aborts if not)
//Returns: 0 if the self-check failed then -1 if sharer-check failed then 1 if successful share
proc/temperature_mimic(turf/model, conduction_coefficient)
proc/temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
proc/temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
proc/check_me_then_temperature_mimic(turf/model, conduction_coefficient)
proc/check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
proc/check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
proc/check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
proc/compare(datum/gas_mixture/sample)
//Compares sample to self to see if within acceptable ranges that group processing may be enabled
archive()
oxygen_archived = oxygen
carbon_dioxide_archived = carbon_dioxide
nitrogen_archived = nitrogen
toxins_archived = toxins
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
trace_gas.moles_archived = trace_gas.moles
temperature_archived = temperature
graphic_archived = graphic
return 1
check_then_merge(datum/gas_mixture/giver)
if(!giver)
return 0
if(((giver.oxygen > MINIMUM_AIR_TO_SUSPEND) && (giver.oxygen >= oxygen*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((giver.carbon_dioxide > MINIMUM_AIR_TO_SUSPEND) && (giver.carbon_dioxide >= carbon_dioxide*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((giver.nitrogen > MINIMUM_AIR_TO_SUSPEND) && (giver.nitrogen >= nitrogen*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((giver.toxins > MINIMUM_AIR_TO_SUSPEND) && (giver.toxins >= toxins*MINIMUM_AIR_RATIO_TO_SUSPEND)))
return 0
if(abs(giver.temperature - temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
return 0
if(giver.trace_gases.len)
for(var/datum/gas/trace_gas in giver.trace_gases)
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
if((trace_gas.moles > MINIMUM_AIR_TO_SUSPEND) && (!corresponding || (trace_gas.moles >= corresponding.moles*MINIMUM_AIR_RATIO_TO_SUSPEND)))
return 0
return merge(giver)
merge(datum/gas_mixture/giver)
if(!giver)
return 0
if(abs(temperature-giver.temperature)>MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/self_heat_capacity = heat_capacity()*group_multiplier
var/giver_heat_capacity = giver.heat_capacity()*giver.group_multiplier
var/combined_heat_capacity = giver_heat_capacity + self_heat_capacity
if(combined_heat_capacity != 0)
temperature = (giver.temperature*giver_heat_capacity + temperature*self_heat_capacity)/combined_heat_capacity
if((group_multiplier>1)||(giver.group_multiplier>1))
oxygen += giver.oxygen*giver.group_multiplier/group_multiplier
carbon_dioxide += giver.carbon_dioxide*giver.group_multiplier/group_multiplier
nitrogen += giver.nitrogen*giver.group_multiplier/group_multiplier
toxins += giver.toxins*giver.group_multiplier/group_multiplier
else
oxygen += giver.oxygen
carbon_dioxide += giver.carbon_dioxide
nitrogen += giver.nitrogen
toxins += giver.toxins
if(giver.trace_gases.len)
for(var/datum/gas/trace_gas in giver.trace_gases)
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
if(!corresponding)
corresponding = new trace_gas.type()
trace_gases += corresponding
corresponding.moles += trace_gas.moles*giver.group_multiplier/group_multiplier
// qdel(giver)
return 1
remove(amount)
var/sum = total_moles()
amount = min(amount,sum) //Can not take more air than tile has!
if(amount <= 0)
return null
var/datum/gas_mixture/removed = new
removed.oxygen = QUANTIZE((oxygen/sum)*amount)
removed.nitrogen = QUANTIZE((nitrogen/sum)*amount)
removed.carbon_dioxide = QUANTIZE((carbon_dioxide/sum)*amount)
removed.toxins = QUANTIZE((toxins/sum)*amount)
oxygen -= removed.oxygen/group_multiplier
nitrogen -= removed.nitrogen/group_multiplier
carbon_dioxide -= removed.carbon_dioxide/group_multiplier
toxins -= removed.toxins/group_multiplier
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
var/datum/gas/corresponding = new trace_gas.type()
removed.trace_gases += corresponding
corresponding.moles = (trace_gas.moles/sum)*amount
trace_gas.moles -= corresponding.moles/group_multiplier
removed.temperature = temperature
return removed
remove_ratio(ratio)
if(ratio <= 0)
return null
ratio = min(ratio, 1)
var/datum/gas_mixture/removed = new
removed.oxygen = QUANTIZE(oxygen*ratio)
removed.nitrogen = QUANTIZE(nitrogen*ratio)
removed.carbon_dioxide = QUANTIZE(carbon_dioxide*ratio)
removed.toxins = QUANTIZE(toxins*ratio)
oxygen -= removed.oxygen/group_multiplier
nitrogen -= removed.nitrogen/group_multiplier
carbon_dioxide -= removed.carbon_dioxide/group_multiplier
toxins -= removed.toxins/group_multiplier
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
var/datum/gas/corresponding = new trace_gas.type()
removed.trace_gases += corresponding
corresponding.moles = trace_gas.moles*ratio
trace_gas.moles -= corresponding.moles/group_multiplier
removed.temperature = temperature
return removed
check_then_remove(amount)
//Since it is all proportional, the check may be done on the gas as a whole
var/sum = total_moles()
amount = min(amount,sum) //Can not take more air than tile has!
if((amount > MINIMUM_AIR_RATIO_TO_SUSPEND) && (amount > sum*MINIMUM_AIR_RATIO_TO_SUSPEND))
return 0
return remove(amount)
copy_from(datum/gas_mixture/sample)
oxygen = sample.oxygen
carbon_dioxide = sample.carbon_dioxide
nitrogen = sample.nitrogen
toxins = sample.toxins
trace_gases.len=null
if(sample.trace_gases.len > 0)
for(var/datum/gas/trace_gas in sample.trace_gases)
var/datum/gas/corresponding = new trace_gas.type()
trace_gases += corresponding
corresponding.moles = trace_gas.moles
temperature = sample.temperature
return 1
subtract(datum/gas_mixture/right_side)
oxygen -= right_side.oxygen
carbon_dioxide -= right_side.carbon_dioxide
nitrogen -= right_side.nitrogen
toxins -= right_side.toxins
if((trace_gases.len > 0)||(right_side.trace_gases.len > 0))
for(var/datum/gas/trace_gas in right_side.trace_gases)
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
if(!corresponding)
corresponding = new trace_gas.type()
trace_gases += corresponding
corresponding.moles -= trace_gas.moles
return 1
check_gas_mixture(datum/gas_mixture/sharer)
if(!sharer) return 0
var/delta_oxygen = (oxygen_archived - sharer.oxygen_archived)/5
var/delta_carbon_dioxide = (carbon_dioxide_archived - sharer.carbon_dioxide_archived)/5
var/delta_nitrogen = (nitrogen_archived - sharer.nitrogen_archived)/5
var/delta_toxins = (toxins_archived - sharer.toxins_archived)/5
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
if(((abs(delta_oxygen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_oxygen) >= oxygen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_carbon_dioxide) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_carbon_dioxide) >= carbon_dioxide_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_nitrogen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_nitrogen) >= nitrogen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_toxins) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_toxins) >= toxins_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)))
return 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
return 0
if(sharer.trace_gases.len)
for(var/datum/gas/trace_gas in sharer.trace_gases)
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
if(corresponding)
if(trace_gas.moles_archived >= corresponding.moles_archived*MINIMUM_AIR_RATIO_TO_SUSPEND*4)
return 0
else
return 0
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
if(!locate(trace_gas.type) in sharer.trace_gases)
return 0
if(((abs(delta_oxygen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_oxygen) >= sharer.oxygen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_carbon_dioxide) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_carbon_dioxide) >= sharer.carbon_dioxide_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_nitrogen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_nitrogen) >= sharer.nitrogen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_toxins) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_toxins) >= sharer.toxins_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)))
return -1
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
var/datum/gas/corresponding = locate(trace_gas.type) in sharer.trace_gases
if(corresponding)
if(trace_gas.moles_archived >= corresponding.moles_archived*MINIMUM_AIR_RATIO_TO_SUSPEND*4)
return -1
else
return -1
return 1
check_turf(turf/model)
var/delta_oxygen = (oxygen_archived - model.oxygen)/5
var/delta_carbon_dioxide = (carbon_dioxide_archived - model.carbon_dioxide)/5
var/delta_nitrogen = (nitrogen_archived - model.nitrogen)/5
var/delta_toxins = (toxins_archived - model.toxins)/5
var/delta_temperature = (temperature_archived - model.temperature)
if(((abs(delta_oxygen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_oxygen) >= oxygen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_carbon_dioxide) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_carbon_dioxide) >= carbon_dioxide_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_nitrogen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_nitrogen) >= nitrogen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_toxins) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_toxins) >= toxins_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)))
return 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
return 0
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
return 0
return 1
share(datum/gas_mixture/sharer)
if(!sharer) return 0
var/delta_oxygen = QUANTIZE(oxygen_archived - sharer.oxygen_archived)/5
var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - sharer.carbon_dioxide_archived)/5
var/delta_nitrogen = QUANTIZE(nitrogen_archived - sharer.nitrogen_archived)/5
var/delta_toxins = QUANTIZE(toxins_archived - sharer.toxins_archived)/5
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
var/old_self_heat_capacity = 0
var/old_sharer_heat_capacity = 0
var/heat_capacity_self_to_sharer = 0
var/heat_capacity_sharer_to_self = 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/delta_air = delta_oxygen+delta_nitrogen
if(delta_air)
var/air_heat_capacity = SPECIFIC_HEAT_AIR*delta_air
if(delta_air > 0)
heat_capacity_self_to_sharer += air_heat_capacity
else
heat_capacity_sharer_to_self -= air_heat_capacity
if(delta_carbon_dioxide)
var/carbon_dioxide_heat_capacity = SPECIFIC_HEAT_CDO*delta_carbon_dioxide
if(delta_carbon_dioxide > 0)
heat_capacity_self_to_sharer += carbon_dioxide_heat_capacity
else
heat_capacity_sharer_to_self -= carbon_dioxide_heat_capacity
if(delta_toxins)
var/toxins_heat_capacity = SPECIFIC_HEAT_TOXIN*delta_toxins
if(delta_toxins > 0)
heat_capacity_self_to_sharer += toxins_heat_capacity
else
heat_capacity_sharer_to_self -= toxins_heat_capacity
old_self_heat_capacity = heat_capacity()*group_multiplier
old_sharer_heat_capacity = sharer.heat_capacity()*sharer.group_multiplier
oxygen -= delta_oxygen/group_multiplier
sharer.oxygen += delta_oxygen/sharer.group_multiplier
carbon_dioxide -= delta_carbon_dioxide/group_multiplier
sharer.carbon_dioxide += delta_carbon_dioxide/sharer.group_multiplier
nitrogen -= delta_nitrogen/group_multiplier
sharer.nitrogen += delta_nitrogen/sharer.group_multiplier
toxins -= delta_toxins/group_multiplier
sharer.toxins += delta_toxins/sharer.group_multiplier
var/moved_moles = (delta_oxygen + delta_carbon_dioxide + delta_nitrogen + delta_toxins)
var/list/trace_types_considered = list()
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
var/datum/gas/corresponding = locate(trace_gas.type) in sharer.trace_gases
var/delta = 0
if(corresponding)
delta = QUANTIZE(trace_gas.moles_archived - corresponding.moles_archived)/5
else
corresponding = new trace_gas.type()
sharer.trace_gases += corresponding
delta = trace_gas.moles_archived/5
trace_gas.moles -= delta/group_multiplier
corresponding.moles += delta/sharer.group_multiplier
if(delta)
var/individual_heat_capacity = trace_gas.specific_heat*delta
if(delta > 0)
heat_capacity_self_to_sharer += individual_heat_capacity
else
heat_capacity_sharer_to_self -= individual_heat_capacity
moved_moles += delta
trace_types_considered += trace_gas.type
if(sharer.trace_gases.len)
for(var/datum/gas/trace_gas in sharer.trace_gases)
if(trace_gas.type in trace_types_considered) continue
else
var/datum/gas/corresponding
var/delta = 0
corresponding = new trace_gas.type()
trace_gases += corresponding
delta = trace_gas.moles_archived/5
trace_gas.moles -= delta/sharer.group_multiplier
corresponding.moles += delta/group_multiplier
//Guaranteed transfer from sharer to self
var/individual_heat_capacity = trace_gas.specific_heat*delta
heat_capacity_sharer_to_self += individual_heat_capacity
moved_moles += -delta
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/new_self_heat_capacity = old_self_heat_capacity + heat_capacity_sharer_to_self - heat_capacity_self_to_sharer
var/new_sharer_heat_capacity = old_sharer_heat_capacity + heat_capacity_self_to_sharer - heat_capacity_sharer_to_self
if(new_self_heat_capacity > MINIMUM_HEAT_CAPACITY)
temperature = (old_self_heat_capacity*temperature - heat_capacity_self_to_sharer*temperature_archived + heat_capacity_sharer_to_self*sharer.temperature_archived)/new_self_heat_capacity
if(new_sharer_heat_capacity > MINIMUM_HEAT_CAPACITY)
sharer.temperature = (old_sharer_heat_capacity*sharer.temperature-heat_capacity_sharer_to_self*sharer.temperature_archived + heat_capacity_self_to_sharer*temperature_archived)/new_sharer_heat_capacity
if(abs(old_sharer_heat_capacity) > MINIMUM_HEAT_CAPACITY)
if(abs(new_sharer_heat_capacity/old_sharer_heat_capacity - 1) < 0.10) // <10% change in sharer heat capacity
temperature_share(sharer, OPEN_HEAT_TRANSFER_COEFFICIENT)
if((delta_temperature > MINIMUM_TEMPERATURE_TO_MOVE) || abs(moved_moles) > MINIMUM_MOLES_DELTA_TO_MOVE)
var/delta_pressure = temperature_archived*(total_moles() + moved_moles) - sharer.temperature_archived*(sharer.total_moles() - moved_moles)
return delta_pressure*R_IDEAL_GAS_EQUATION/volume
else
return 0
mimic(turf/model, border_multiplier)
var/delta_oxygen = QUANTIZE(oxygen_archived - model.oxygen)/5
var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - model.carbon_dioxide)/5
var/delta_nitrogen = QUANTIZE(nitrogen_archived - model.nitrogen)/5
var/delta_toxins = QUANTIZE(toxins_archived - model.toxins)/5
var/delta_temperature = (temperature_archived - model.temperature)
var/heat_transferred = 0
var/old_self_heat_capacity = 0
var/heat_capacity_transferred = 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/delta_air = delta_oxygen+delta_nitrogen
if(delta_air)
var/air_heat_capacity = SPECIFIC_HEAT_AIR*delta_air
heat_transferred -= air_heat_capacity*model.temperature
heat_capacity_transferred -= air_heat_capacity
if(delta_carbon_dioxide)
var/carbon_dioxide_heat_capacity = SPECIFIC_HEAT_CDO*delta_carbon_dioxide
heat_transferred -= carbon_dioxide_heat_capacity*model.temperature
heat_capacity_transferred -= carbon_dioxide_heat_capacity
if(delta_toxins)
var/toxins_heat_capacity = SPECIFIC_HEAT_TOXIN*delta_toxins
heat_transferred -= toxins_heat_capacity*model.temperature
heat_capacity_transferred -= toxins_heat_capacity
old_self_heat_capacity = heat_capacity()*group_multiplier
if(border_multiplier)
oxygen -= delta_oxygen*border_multiplier/group_multiplier
carbon_dioxide -= delta_carbon_dioxide*border_multiplier/group_multiplier
nitrogen -= delta_nitrogen*border_multiplier/group_multiplier
toxins -= delta_toxins*border_multiplier/group_multiplier
else
oxygen -= delta_oxygen/group_multiplier
carbon_dioxide -= delta_carbon_dioxide/group_multiplier
nitrogen -= delta_nitrogen/group_multiplier
toxins -= delta_toxins/group_multiplier
var/moved_moles = (delta_oxygen + delta_carbon_dioxide + delta_nitrogen + delta_toxins)
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
var/delta = 0
delta = trace_gas.moles_archived/5
if(border_multiplier)
trace_gas.moles -= delta*border_multiplier/group_multiplier
else
trace_gas.moles -= delta/group_multiplier
var/heat_cap_transferred = delta*trace_gas.specific_heat
heat_transferred += heat_cap_transferred*temperature_archived
heat_capacity_transferred += heat_cap_transferred
moved_moles += delta
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/new_self_heat_capacity = old_self_heat_capacity - heat_capacity_transferred
if(new_self_heat_capacity > MINIMUM_HEAT_CAPACITY)
if(border_multiplier)
temperature = (old_self_heat_capacity*temperature - heat_capacity_transferred*border_multiplier*temperature_archived)/new_self_heat_capacity
else
temperature = (old_self_heat_capacity*temperature - heat_capacity_transferred*border_multiplier*temperature_archived)/new_self_heat_capacity
temperature_mimic(model, model.thermal_conductivity, border_multiplier)
if((delta_temperature > MINIMUM_TEMPERATURE_TO_MOVE) || abs(moved_moles) > MINIMUM_MOLES_DELTA_TO_MOVE)
var/delta_pressure = temperature_archived*(total_moles() + moved_moles) - model.temperature*(model.oxygen+model.carbon_dioxide+model.nitrogen+model.toxins)
return delta_pressure*R_IDEAL_GAS_EQUATION/volume
else
return 0
check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
var/self_heat_capacity = heat_capacity_archived()
var/sharer_heat_capacity = sharer.heat_capacity_archived()
var/self_temperature_delta = 0
var/sharer_temperature_delta = 0
if((sharer_heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
(self_heat_capacity*sharer_heat_capacity/(self_heat_capacity+sharer_heat_capacity))
self_temperature_delta = -heat/(self_heat_capacity*group_multiplier)
sharer_temperature_delta = heat/(sharer_heat_capacity*sharer.group_multiplier)
else
return 1
if((abs(self_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
return 0
if((abs(sharer_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
&& (abs(sharer_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*sharer.temperature_archived))
return -1
temperature += self_temperature_delta
sharer.temperature += sharer_temperature_delta
return 1
//Logic integrated from: temperature_share(sharer, conduction_coefficient) for efficiency
check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
var/self_heat_capacity = heat_capacity_archived()
var/sharer_heat_capacity = sharer.heat_capacity_archived()
var/self_temperature_delta = 0
var/sharer_temperature_delta = 0
if((sharer_heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
(self_heat_capacity*sharer_heat_capacity/(self_heat_capacity+sharer_heat_capacity))
self_temperature_delta = -heat/(self_heat_capacity*group_multiplier)
sharer_temperature_delta = heat/(sharer_heat_capacity*sharer.group_multiplier)
else
return 1
if((abs(self_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
return 0
temperature += self_temperature_delta
sharer.temperature += sharer_temperature_delta
return 1
//Logic integrated from: temperature_share(sharer, conduction_coefficient) for efficiency
check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature)
var/self_temperature_delta = 0
var/sharer_temperature_delta = 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/self_heat_capacity = heat_capacity_archived()
if((sharer.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
(self_heat_capacity*sharer.heat_capacity/(self_heat_capacity+sharer.heat_capacity))
self_temperature_delta = -heat/(self_heat_capacity*group_multiplier)
sharer_temperature_delta = heat/sharer.heat_capacity
else
return 1
if((abs(self_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
return 0
temperature += self_temperature_delta
sharer.temperature += sharer_temperature_delta
return 1
//Logic integrated from: temperature_turf_share(sharer, conduction_coefficient) for efficiency
check_me_then_temperature_mimic(turf/model, conduction_coefficient)
var/delta_temperature = (temperature_archived - model.temperature)
var/self_temperature_delta = 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/self_heat_capacity = heat_capacity_archived()
if((model.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
(self_heat_capacity*model.heat_capacity/(self_heat_capacity+model.heat_capacity))
self_temperature_delta = -heat/(self_heat_capacity*group_multiplier)
if((abs(self_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
return 0
temperature += self_temperature_delta
return 1
//Logic integrated from: temperature_mimic(model, conduction_coefficient) for efficiency
temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/self_heat_capacity = heat_capacity_archived()
var/sharer_heat_capacity = sharer.heat_capacity_archived()
if((sharer_heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
(self_heat_capacity*sharer_heat_capacity/(self_heat_capacity+sharer_heat_capacity))
temperature -= heat/(self_heat_capacity*group_multiplier)
sharer.temperature += heat/(sharer_heat_capacity*sharer.group_multiplier)
temperature_mimic(turf/model, conduction_coefficient, border_multiplier)
var/delta_temperature = (temperature - model.temperature)
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/self_heat_capacity = heat_capacity()//_archived()
if((model.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
(self_heat_capacity*model.heat_capacity/(self_heat_capacity+model.heat_capacity))
if(border_multiplier)
temperature -= heat*border_multiplier/(self_heat_capacity*group_multiplier)
else
temperature -= heat/(self_heat_capacity*group_multiplier)
temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature)
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/self_heat_capacity = heat_capacity()
if((sharer.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
(self_heat_capacity*sharer.heat_capacity/(self_heat_capacity+sharer.heat_capacity))
temperature -= heat/(self_heat_capacity*group_multiplier)
sharer.temperature += heat/sharer.heat_capacity
compare(datum/gas_mixture/sample)
if((abs(oxygen-sample.oxygen) > MINIMUM_AIR_TO_SUSPEND) && \
((oxygen < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.oxygen) || (oxygen > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.oxygen)))
return 0
if((abs(nitrogen-sample.nitrogen) > MINIMUM_AIR_TO_SUSPEND) && \
((nitrogen < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.nitrogen) || (nitrogen > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.nitrogen)))
return 0
if((abs(carbon_dioxide-sample.carbon_dioxide) > MINIMUM_AIR_TO_SUSPEND) && \
((carbon_dioxide < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.carbon_dioxide) || (oxygen > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.carbon_dioxide)))
return 0
if((abs(toxins-sample.toxins) > MINIMUM_AIR_TO_SUSPEND) && \
((toxins < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.toxins) || (toxins > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.toxins)))
return 0
if(total_moles() > MINIMUM_AIR_TO_SUSPEND)
if((abs(temperature-sample.temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) && \
((temperature < (1-MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND)*sample.temperature) || (temperature > (1+MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND)*sample.temperature)))
//world << "temp fail [temperature] & [sample.temperature]"
return 0
if(sample.trace_gases.len)
for(var/datum/gas/trace_gas in sample.trace_gases)
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND)
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
if(corresponding)
if((abs(trace_gas.moles - corresponding.moles) > MINIMUM_AIR_TO_SUSPEND) && \
((corresponding.moles < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*trace_gas.moles) || (corresponding.moles > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*trace_gas.moles)))
return 0
else
return 0
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
if(trace_gas.moles > MINIMUM_AIR_TO_SUSPEND)
var/datum/gas/corresponding = locate(trace_gas.type) in sample.trace_gases
if(corresponding)
if((abs(trace_gas.moles - corresponding.moles) > MINIMUM_AIR_TO_SUSPEND) && \
((trace_gas.moles < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*corresponding.moles) || (trace_gas.moles > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*corresponding.moles)))
return 0
else
return 0
return 1
-101
View File
@@ -1,101 +0,0 @@
/turf/simulated/proc/find_group()
//Basically, join any nearby valid groups
// If more than one, pick one with most members at my borders
// If can not find any but there was an ungrouped at border with me, call for group assembly
var/turf/simulated/floor/north = get_step(src,NORTH)
var/turf/simulated/floor/south = get_step(src,SOUTH)
var/turf/simulated/floor/east = get_step(src,EAST)
var/turf/simulated/floor/west = get_step(src,WEST)
//Clear those we do not have access to
if(!CanPass(null, north, null, 1) || !istype(north))
north = null
if(!CanPass(null, south, null, 1) || !istype(south))
south = null
if(!CanPass(null, east, null, 1) || !istype(east))
east = null
if(!CanPass(null, west, null, 1) || !istype(west))
west = null
var/new_group_possible = 0
var/north_votes = 0
var/south_votes = 0
var/east_votes = 0
if(north)
if(north.parent)
north_votes = 1
if(south && (south.parent == north.parent))
north_votes++
south = null
if(east && (east.parent == north.parent))
north_votes++
east = null
if(west && (west.parent == north.parent))
north_votes++
west = null
else
new_group_possible = 1
if(south)
if(south.parent)
south_votes = 1
if(east && (east.parent == south.parent))
south_votes++
east = null
if(west && (west.parent == south.parent))
south_votes++
west = null
else
new_group_possible = 1
if(east)
if(east.parent)
east_votes = 1
if(west && (west.parent == east.parent))
east_votes++
west = null
else
new_group_possible = 1
// world << "[north_votes], [south_votes], [east_votes]"
var/datum/air_group/group_joined = null
if(west)
if(west.parent)
group_joined = west.parent
else
new_group_possible = 1
if(north_votes && (north_votes >= south_votes) && (north_votes >= east_votes))
group_joined = north.parent
else if(south_votes && (south_votes >= east_votes))
group_joined = south.parent
else if(east_votes)
group_joined = east.parent
if (istype(group_joined))
if (group_joined.group_processing)
group_joined.suspend_group_processing()
group_joined.members += src
parent=group_joined
air_master.tiles_to_update += group_joined.members
return 1
else if(new_group_possible)
air_master.assemble_group_turf(src)
return 1
else
air_master.active_singletons += src
return 1
-335
View File
@@ -1,335 +0,0 @@
/*
Overview:
The air_master global variable is the workhorse for the system.
Why are you archiving data before modifying it?
The general concept with archiving data and having each tile keep track of when they were last updated is to keep everything symmetric
and totally independent of the order they are read in an update cycle.
This prevents abnormalities like air/fire spreading rapidly in one direction and super slowly in the other.
Why not just archive everything and then calculate?
Efficiency. While a for-loop that goes through all tiles and groups to archive their information before doing any calculations seems simple, it is
slightly less efficient than the archive-before-modify/read method.
Why is there a cycle check for calculating data as well?
This ensures that every connection between group-tile, tile-tile, and group-group is only evaluated once per loop.
Important variables:
air_master.groups_to_rebuild (list)
A list of air groups that have had their geometry occluded and thus may need to be split in half.
A set of adjacent groups put in here will join together if validly connected.
This is done before air system calculations for a cycle.
air_master.tiles_to_update (list)
Turfs that are in this list have their border data updated before the next air calculations for a cycle.
Place turfs in this list rather than call the proc directly to prevent race conditions
turf/simulated.archive() and datum/air_group.archive()
This stores all data for.
If you modify, make sure to update the archived_cycle to prevent race conditions and maintain symmetry
atom/CanPass(atom/movable/mover, turf/target, height, air_group)
returns 1 for allow pass and 0 for deny pass
Turfs automatically call this for all objects/mobs in its turf.
This is called both as source.CanPass(target, height, air_group)
and target.CanPass(source, height, air_group)
Cases for the parameters
1. This is called with args (mover, location, height>0, air_group=0) for normal objects.
2. This is called with args (null, location, height=0, air_group=0) for flowing air.
3. This is called with args (null, location, height=?, air_group=1) for determining group boundaries.
Cases 2 and 3 would be different for doors or other objects open and close fairly often.
(Case 3 would return 0 always while Case 2 would return 0 only when the door is open)
This prevents the necessity of re-evaluating group geometry every time a door opens/closes.
Important Procedures
air_master.process()
This first processes the air_master update/rebuild lists then processes all groups and tiles for air calculations
*/
var/kill_air = 0
atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
return (!density || !height || air_group)
turf
CanPass(atom/movable/mover, turf/target, height=1.5,air_group=0)
if(!target) return 0
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
return !density
else // Now, doing more detailed checks for air movement and air group formation
if(target.blocks_air||blocks_air)
return 0
for(var/obj/obstacle in src)
if(!obstacle.CanPass(mover, target, height, air_group))
return 0
for(var/obj/obstacle in target)
if(!obstacle.CanPass(mover, src, height, air_group))
return 0
return 1
var/global/datum/controller/air_system/air_master
datum
controller
air_system
//Geoemetry lists
var/list/datum/air_group/air_groups = list()
var/list/turf/simulated/active_singletons = list()
//Special functions lists
var/list/turf/simulated/active_super_conductivity = list()
var/list/turf/simulated/high_pressure_delta = list()
//Geometry updates lists
var/list/turf/simulated/tiles_to_update = list()
var/list/turf/simulated/groups_to_rebuild = list()
var/current_cycle = 0
proc
setup()
//Call this at the start to setup air groups geometry
//Warning: Very processor intensive but only must be done once per round
assemble_group_turf(turf/simulated/base)
//Call this to try to construct a group starting from base and merging with neighboring unparented tiles
//Expands the group until all valid borders explored
// assemble_group_object(obj/movable/floor/base)
process()
//Call this to process air movements for a cycle
process_groups()
//Used by process()
//Warning: Do not call this
process_singletons()
//Used by process()
//Warning: Do not call this
process_high_pressure_delta()
//Used by process()
//Warning: Do not call this
process_super_conductivity()
//Used by process()
//Warning: Do not call this
process_update_tiles()
//Used by process()
//Warning: Do not call this
process_rebuild_select_groups()
//Used by process()
//Warning: Do not call this
rebuild_group(datum/air_group)
//Used by process_rebuild_select_groups()
//Warning: Do not call this, add the group to air_master.groups_to_rebuild instead
add_singleton(turf/simulated/T)
if(!active_singletons.Find(T))
active_singletons += T
setup()
set background = 1
world << "\red \b Processing Geometry..."
sleep(1)
var/start_time = world.timeofday
for(var/turf/simulated/S in world)
if(!S.blocks_air && !S.parent)
assemble_group_turf(S)
S.update_air_properties()
world << "\red \b Geometry processed in [(world.timeofday-start_time)/10] seconds!"
assemble_group_turf(turf/simulated/base)
var/list/turf/simulated/members = list(base) //Confirmed group members
var/list/turf/simulated/possible_members = list(base) //Possible places for group expansion
var/list/turf/simulated/possible_borders = list()
var/list/turf/simulated/possible_space_borders = list()
var/possible_space_length = 0
while(possible_members.len>0) //Keep expanding, looking for new members
for(var/turf/simulated/test in possible_members)
test.length_space_border = 0
for(var/direction in cardinal)
var/turf/T = get_step(test,direction)
if(T && !members.Find(T) && test.CanPass(null, T, null,1))
if(istype(T,/turf/simulated) && !T:parent)
possible_members += T
members += T
else if(istype(T,/turf/space))
possible_space_borders -= test
possible_space_borders += test
test.length_space_border++
else
possible_borders -= test
possible_borders += test
if(test.length_space_border > 0)
possible_space_length += test.length_space_border
possible_members -= test
if(members.len > 1)
var/datum/air_group/turf/group = new
if(possible_borders.len>0)
group.borders = possible_borders
if(possible_space_borders.len>0)
group.space_borders = possible_space_borders
group.length_space_border = possible_space_length
for(var/turf/simulated/test in members)
test.parent = group
test.processing = 0
active_singletons -= test
group.members = members
air_groups += group
group.update_group_from_tiles() //Initialize air group variables
return group
else
base.processing = 0 //singletons at startup are technically unconnected anyway
base.parent = null
if(base.air.check_tile_graphic())
base.update_visuals(base.air)
return null
/*
assemble_group_object(obj/movable/floor/base)
var/list/obj/movable/floor/members = list(base) //Confirmed group members
var/list/obj/movable/floor/possible_members = list(base) //Possible places for group expansion
var/list/obj/movable/floor/possible_borders = list()
while(possible_members.len>0) //Keep expanding, looking for new members
for(var/obj/movable/floor/test in possible_members)
for(var/direction in list(NORTH, SOUTH, EAST, WEST))
var/turf/T = get_step(test.loc,direction)
if(T && test.loc.CanPass(null, T, null, 1))
var/obj/movable/floor/O = locate(/obj/movable/floor) in T
if(istype(O) && !O.parent)
if(!members.Find(O))
possible_members += O
members += O
else
possible_borders -= test
possible_borders += test
possible_members -= test
if(members.len > 1)
var/datum/air_group/object/group = new
if(possible_borders.len>0)
group.borders = possible_borders
for(var/obj/movable/floor/test in members)
test.parent = group
test.processing = 0
active_singletons -= test
group.members = members
air_groups += group
group.update_group_from_tiles() //Initialize air group variables
return group
else
base.processing = 0 //singletons at startup are technically unconnected anyway
base.parent = null
return null
*/
process()
if(kill_air)
return 1
current_cycle++
if(groups_to_rebuild.len > 0) process_rebuild_select_groups()
if(tiles_to_update.len > 0) process_update_tiles()
process_groups()
process_singletons()
process_super_conductivity()
process_high_pressure_delta()
if(current_cycle%10==5) //Check for groups of tiles to resume group processing every 10 cycles
for(var/datum/air_group/AG in air_groups)
AG.check_regroup()
return 1
process_update_tiles()
for(var/turf/simulated/T in tiles_to_update)
T.update_air_properties()
/*
for(var/obj/movable/floor/O in tiles_to_update)
O.update_air_properties()
*/
tiles_to_update.len = 0
process_rebuild_select_groups()
var/turf/list/turfs = list()
for(var/datum/air_group/turf/turf_AG in groups_to_rebuild) //Deconstruct groups, gathering their old members
for(var/turf in turf_AG.members)
var/turf/simulated/T = turf
T.parent = null
turfs += T
qdel(turf_AG)
for(var/turf/simulated/S in turfs) //Have old members try to form new groups
if(!S.parent)
assemble_group_turf(S)
for(var/turf/simulated/S in turfs)
S.update_air_properties()
// var/obj/movable/list/movable_objects = list()
// for(var/datum/air_group/object/object_AG in groups_to_rebuild) //Deconstruct groups, gathering their old members
/*
for(var/obj/movable/floor/OM in object_AG.members)
OM.parent = null
movable_objects += OM
qdel(object_AG)
for(var/obj/movable/floor/OM in movable_objects) //Have old members try to form new groups
if(!OM.parent)
assemble_group_object(OM)
for(var/obj/movable/floor/OM in movable_objects)
OM.update_air_properties()
*/
groups_to_rebuild.len = 0
process_groups()
for(var/datum/air_group/AG in air_groups)
AG.process_group()
process_singletons()
for(var/item in active_singletons)
item:process_cell()
process_super_conductivity()
for(var/turf/simulated/hot_potato in active_super_conductivity)
hot_potato.super_conduct()
process_high_pressure_delta()
for(var/turf/pressurized in high_pressure_delta)
pressurized.high_pressure_movements()
high_pressure_delta.len = 0
-560
View File
@@ -1,560 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
atom/movable/var/pressure_resistance = 5
atom/movable/var/last_forced_movement = 0
atom/movable/proc/experience_pressure_difference(pressure_difference, direction)
if(last_forced_movement >= air_master.current_cycle)
return 0
else if(!anchored)
if(pressure_difference > pressure_resistance)
last_forced_movement = air_master.current_cycle
spawn step(src, direction)
return 1
turf
assume_air(datum/gas_mixture/giver) //use this for machines to adjust air
qdel(giver)
return 0
return_air()
//Create gas mixture to hold data for passing
var/datum/gas_mixture/GM = new
GM.oxygen = oxygen
GM.carbon_dioxide = carbon_dioxide
GM.nitrogen = nitrogen
GM.toxins = toxins
GM.temperature = temperature
return GM
remove_air(amount as num)
var/datum/gas_mixture/GM = new
var/sum = oxygen + carbon_dioxide + nitrogen + toxins
if(sum>0)
GM.oxygen = (oxygen/sum)*amount
GM.carbon_dioxide = (carbon_dioxide/sum)*amount
GM.nitrogen = (nitrogen/sum)*amount
GM.toxins = (toxins/sum)*amount
GM.temperature = temperature
return GM
turf
var/pressure_difference = 0
var/pressure_direction = 0
var/reporting_pressure_difference
//optimization vars
var/next_check = 0 //number of ticks before this tile updates
var/check_delay = 0 //number of ticks between updates
proc/high_pressure_movements()
if(reporting_pressure_difference)
world << "pressure_difference = [pressure_difference]; pressure_direction = [pressure_direction]"
for(var/atom/movable/in_tile in src)
in_tile.experience_pressure_difference(pressure_difference, pressure_direction)
pressure_difference = 0
proc/consider_pressure_difference(connection_difference, connection_direction)
if(connection_difference < 0)
connection_difference = -connection_difference
connection_direction = turn(connection_direction,180)
if(connection_difference > pressure_difference)
if(!pressure_difference)
air_master.high_pressure_delta += src
pressure_difference = connection_difference
pressure_direction = connection_direction
turf/simulated/proc/consider_pressure_difference_space(connection_difference)
for(var/direction in cardinal)
if(direction&group_border)
if(istype(get_step(src,direction),/turf/space))
if(!pressure_difference)
air_master.high_pressure_delta += src
pressure_direction = direction
pressure_difference = connection_difference
return 1
turf/simulated
var/current_graphic = null
var/tmp/datum/gas_mixture/air
var/tmp/processing = 1
var/tmp/datum/air_group/turf/parent
var/tmp/group_border = 0
var/tmp/length_space_border = 0
var/tmp/air_check_directions = 0 //Do not modify this, just add turf to air_master.tiles_to_update
var/tmp/archived_cycle = 0
var/tmp/current_cycle = 0
var/tmp/obj/effect/hotspot/active_hotspot
var/tmp/temperature_archived //USED ONLY FOR SOLIDS
var/tmp/being_superconductive = 0
proc/update_visuals(datum/gas_mixture/model)
overlays.Cut()
var/siding_icon_state = return_siding_icon_state()
if(siding_icon_state)
overlays += image('icons/turf/floors.dmi',siding_icon_state)
switch(model.graphic)
if("plasma")
overlays.Add(plmaster)
if("sleeping_agent")
overlays.Add(slmaster)
New()
..()
if(!blocks_air)
air = new
air.oxygen = oxygen
air.carbon_dioxide = carbon_dioxide
air.nitrogen = nitrogen
air.toxins = toxins
air.temperature = temperature
if(air_master)
air_master.tiles_to_update.Add(src)
find_group()
// air.parent = src //TODO DEBUG REMOVE
else
if(air_master)
for(var/direction in cardinal)
var/turf/simulated/floor/target = get_step(src,direction)
if(istype(target))
air_master.tiles_to_update.Add(target)
Destroy()
if(air_master)
if(parent)
air_master.groups_to_rebuild.Add(parent)
parent.members.Remove(src)
else
air_master.active_singletons.Remove(src)
if(active_hotspot)
active_hotspot.Kill()
if(blocks_air)
for(var/direction in list(NORTH, SOUTH, EAST, WEST))
var/turf/simulated/tile = get_step(src,direction)
if(istype(tile) && !tile.blocks_air)
air_master.tiles_to_update.Add(tile)
..()
assume_air(datum/gas_mixture/giver)
if(!giver) return 0
var/datum/gas_mixture/receiver = air
if(istype(receiver))
if(parent&&parent.group_processing)
if(!parent.air.check_then_merge(giver))
parent.suspend_group_processing()
air.merge(giver)
else
if (giver.total_moles() > MINIMUM_AIR_TO_SUSPEND)
reset_delay()
air.merge(giver)
if(!processing)
if(air.check_tile_graphic())
update_visuals(air)
return 1
else return ..()
proc/archive()
if(air) //For open space like floors
air.archive()
temperature_archived = temperature
archived_cycle = air_master.current_cycle
proc/share_air_with_tile(turf/simulated/T)
return air.share(T.air)
proc/mimic_air_with_tile(turf/T)
return air.mimic(T)
return_air()
if(air)
if(parent&&parent.group_processing)
return parent.air
else return air
else
return ..()
remove_air(amount as num)
if(air)
var/datum/gas_mixture/removed = null
if(parent&&parent.group_processing)
removed = parent.air.check_then_remove(amount)
if(!removed)
parent.suspend_group_processing()
removed = air.remove(amount)
else
removed = air.remove(amount)
if(!processing)
if(air.check_tile_graphic())
update_visuals(air)
return removed
else
return ..()
proc/update_air_properties()//OPTIMIZE
air_check_directions = 0
for(var/direction in cardinal)
if(CanPass(null, get_step(src,direction), 0, 0))
air_check_directions |= direction
if(parent)
if(parent.borders)
parent.borders -= src
if(length_space_border > 0)
parent.length_space_border -= length_space_border
length_space_border = 0
group_border = 0
for(var/direction in cardinal)
if(air_check_directions&direction)
var/turf/simulated/T = get_step(src,direction)
//See if actually a border
if(!istype(T) || (T.parent!=parent))
//See what kind of border it is
if(istype(T,/turf/space))
if(parent.space_borders)
parent.space_borders -= src
parent.space_borders += src
else
parent.space_borders = list(src)
length_space_border++
else
if(parent.borders)
parent.borders -= src
parent.borders += src
else
parent.borders = list(src)
group_border |= direction
parent.length_space_border += length_space_border
if(air_check_directions)
processing = 1
if(!parent)
air_master.add_singleton(src)
else
processing = 0
proc/process_cell()
//this proc does all the heavy lifting for individual tile processing
//it shares with all of its neighbors, spreads fire, calls superconduction
//and doesn't afraid of anything
//Comment by errorage: In other words, this is the proc that lags the game.
//check if we're skipping this tick
if (next_check > 0)
next_check--
return 1
var/player_count = max(player_list.len, 3) / 3
next_check += check_delay + rand(player_count, player_count * 1.5)
check_delay++
var/turf/simulated/list/possible_fire_spreads = list()
if(processing)
if(archived_cycle < air_master.current_cycle) //archive self if not already done
archive()
current_cycle = air_master.current_cycle
for(var/direction in cardinal)
if(air_check_directions&direction) //Grab all valid bordering tiles
var/turf/simulated/enemy_tile = get_step(src, direction)
var/connection_difference = 0
if(istype(enemy_tile)) //enemy_tile == neighbor, btw
if(enemy_tile.archived_cycle < archived_cycle) //archive bordering tile information if not already done
enemy_tile.archive()
if (air && enemy_tile.air)
var/delay_trigger = air.compare(enemy_tile.air)
if (!delay_trigger) //if compare() didn't return 1, air is different enough to trigger processing
reset_delay()
enemy_tile.reset_delay()
if(enemy_tile.parent && enemy_tile.parent.group_processing) //apply tile to group sharing
if(enemy_tile.parent.current_cycle < current_cycle) //if the group hasn't been archived, it could just be out of date
if(enemy_tile.parent.air.check_gas_mixture(air))
connection_difference = air.share(enemy_tile.parent.air)
else
enemy_tile.parent.suspend_group_processing()
connection_difference = air.share(enemy_tile.air)
//group processing failed so interact with individual tile
else
if(enemy_tile.current_cycle < current_cycle)
connection_difference = air.share(enemy_tile.air)
if(active_hotspot)
possible_fire_spreads += enemy_tile
else
/* var/obj/movable/floor/movable_on_enemy = locate(/obj/movable/floor) in enemy_tile
if(movable_on_enemy)
if(movable_on_enemy.parent && movable_on_enemy.parent.group_processing) //apply tile to group sharing
if(movable_on_enemy.parent.current_cycle < current_cycle)
if(movable_on_enemy.parent.air.check_gas_mixture(air))
connection_difference = air.share(movable_on_enemy.parent.air)
else
movable_on_enemy.parent.suspend_group_processing()
if(movable_on_enemy.archived_cycle < archived_cycle) //archive bordering tile information if not already done
movable_on_enemy.archive()
connection_difference = air.share(movable_on_enemy.air)
//group processing failed so interact with individual tile
else
if(movable_on_enemy.archived_cycle < archived_cycle) //archive bordering tile information if not already done
movable_on_enemy.archive()
if(movable_on_enemy.current_cycle < current_cycle)
connection_difference = share_air_with_tile(movable_on_enemy)
else*/
connection_difference = mimic_air_with_tile(enemy_tile)
//bordering a tile with fixed air properties
if(connection_difference)
if(connection_difference > 0)
consider_pressure_difference(connection_difference, direction)
else
enemy_tile.consider_pressure_difference(connection_difference, direction)
else
air_master.active_singletons -= src //not active if not processing!
air.react()
if(active_hotspot)
if (!active_hotspot.process(possible_fire_spreads))
return 0
if(air.temperature > MINIMUM_TEMPERATURE_START_SUPERCONDUCTION)
consider_superconductivity(starting = 1)
if(air.check_tile_graphic())
update_visuals(air)
if(air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
reset_delay() //hotspots always process quickly
hotspot_expose(air.temperature, CELL_VOLUME)
for(var/atom/movable/item in src)
item.temperature_expose(air, air.temperature, CELL_VOLUME)
temperature_expose(air, air.temperature, CELL_VOLUME)
return 1
proc/super_conduct()
var/conductivity_directions = 0
if(blocks_air)
//Does not participate in air exchange, so will conduct heat across all four borders at this time
conductivity_directions = NORTH|SOUTH|EAST|WEST
if(archived_cycle < air_master.current_cycle)
archive()
else
//Does particate in air exchange so only consider directions not considered during process_cell()
conductivity_directions = ~air_check_directions & (NORTH|SOUTH|EAST|WEST)
if(conductivity_directions>0)
//Conduct with tiles around me
for(var/direction in cardinal)
if(conductivity_directions&direction)
var/turf/neighbor = get_step(src,direction)
if(istype(neighbor, /turf/simulated)) //anything under this subtype will share in the exchange
var/turf/simulated/modeled_neighbor = neighbor
if(modeled_neighbor.archived_cycle < air_master.current_cycle)
modeled_neighbor.archive()
if(modeled_neighbor.air)
if(air) //Both tiles are open
if(modeled_neighbor.parent && modeled_neighbor.parent.group_processing)
if(parent && parent.group_processing)
//both are acting as a group
//modified using construct developed in datum/air_group/share_air_with_group(...)
var/result = parent.air.check_both_then_temperature_share(modeled_neighbor.parent.air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
if(result==0)
//have to deconstruct parent air group
parent.suspend_group_processing()
if(!modeled_neighbor.parent.air.check_me_then_temperature_share(air, WINDOW_HEAT_TRANSFER_COEFFICIENT))
//may have to deconstruct neighbors air group
modeled_neighbor.parent.suspend_group_processing()
air.temperature_share(modeled_neighbor.air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
else if(result==-1)
// have to deconstruct neightbors air group but not mine
modeled_neighbor.parent.suspend_group_processing()
parent.air.temperature_share(modeled_neighbor.air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
else
air.temperature_share(modeled_neighbor.air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
else
if(parent && parent.group_processing)
if(!parent.air.check_me_then_temperature_share(air, WINDOW_HEAT_TRANSFER_COEFFICIENT))
//may have to deconstruct neighbors air group
parent.suspend_group_processing()
air.temperature_share(modeled_neighbor.air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
else
air.temperature_share(modeled_neighbor.air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
// world << "OPEN, OPEN"
else //Solid but neighbor is open
if(modeled_neighbor.parent && modeled_neighbor.parent.group_processing)
if(!modeled_neighbor.parent.air.check_me_then_temperature_turf_share(src, modeled_neighbor.thermal_conductivity))
modeled_neighbor.parent.suspend_group_processing()
modeled_neighbor.air.temperature_turf_share(src, modeled_neighbor.thermal_conductivity)
else
modeled_neighbor.air.temperature_turf_share(src, modeled_neighbor.thermal_conductivity)
// world << "SOLID, OPEN"
else
if(air) //Open but neighbor is solid
if(parent && parent.group_processing)
if(!parent.air.check_me_then_temperature_turf_share(modeled_neighbor, modeled_neighbor.thermal_conductivity))
parent.suspend_group_processing()
air.temperature_turf_share(modeled_neighbor, modeled_neighbor.thermal_conductivity)
else
air.temperature_turf_share(modeled_neighbor, modeled_neighbor.thermal_conductivity)
// world << "OPEN, SOLID"
else //Both tiles are solid
share_temperature_mutual_solid(modeled_neighbor, modeled_neighbor.thermal_conductivity)
// world << "SOLID, SOLID"
modeled_neighbor.consider_superconductivity()
else
if(air) //Open
if(parent && parent.group_processing)
if(!parent.air.check_me_then_temperature_mimic(neighbor, neighbor.thermal_conductivity))
parent.suspend_group_processing()
air.temperature_mimic(neighbor, neighbor.thermal_conductivity)
else
air.temperature_mimic(neighbor, neighbor.thermal_conductivity)
else
mimic_temperature_solid(neighbor, neighbor.thermal_conductivity)
//Radiate excess tile heat to space
if(temperature > T0C)
// Is there a pre-defined Space Tile?
if(!Space_Tile)
Space_Tile = locate(/turf/space) // Define one
//Considering 0 degC as te break even point for radiation in and out
mimic_temperature_solid(Space_Tile, FLOOR_HEAT_TRANSFER_COEFFICIENT)
//Conduct with air on my tile if I have it
if(air)
if(parent && parent.group_processing)
if(!parent.air.check_me_then_temperature_turf_share(src, thermal_conductivity))
parent.suspend_group_processing()
air.temperature_turf_share(src, thermal_conductivity)
else
air.temperature_turf_share(src, thermal_conductivity)
//Make sure still hot enough to continue conducting heat
if(air)
if(air.temperature < MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION)
being_superconductive = 0
air_master.active_super_conductivity -= src
return 0
else
if(temperature < MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION)
being_superconductive = 0
air_master.active_super_conductivity -= src
return 0
proc/mimic_temperature_solid(turf/model, conduction_coefficient)
var/delta_temperature = (temperature_archived - model.temperature)
if((heat_capacity > 0) && (abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER))
var/heat = conduction_coefficient*delta_temperature* \
(heat_capacity*model.heat_capacity/(heat_capacity+model.heat_capacity))
temperature -= heat/heat_capacity
proc/share_temperature_mutual_solid(turf/simulated/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER && heat_capacity && sharer.heat_capacity)
var/heat = conduction_coefficient*delta_temperature* \
(heat_capacity*sharer.heat_capacity/(heat_capacity+sharer.heat_capacity))
temperature -= heat/heat_capacity
sharer.temperature += heat/sharer.heat_capacity
proc/consider_superconductivity(starting)
if(being_superconductive || !thermal_conductivity)
return 0
if(air)
if(air.temperature < (starting?MINIMUM_TEMPERATURE_START_SUPERCONDUCTION:MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION))
return 0
if(air.heat_capacity() < MOLES_CELLSTANDARD*0.1*0.05)
return 0
else
if(temperature < (starting?MINIMUM_TEMPERATURE_START_SUPERCONDUCTION:MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION))
return 0
being_superconductive = 1
air_master.active_super_conductivity += src
proc/reset_delay()
//sets this turf to process quickly again
next_check=0
check_delay= -5 //negative numbers mean a mandatory quick-update period
//if this turf has a parent air group, suspend its processing
if (parent && parent.group_processing)
parent.suspend_group_processing()
-52
View File
@@ -1,52 +0,0 @@
/obj/item/weapon/tank/jetpack/verb/moveup()
set name = "Move Upwards"
set category = "Object"
if(allow_thrust(0.01, usr))
var/turf/controllerlocation = locate(1, 1, usr.z)
var/legal = 0
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
legal = controller.up
if (controller.up)
var/turf/T = locate(usr.x, usr.y, controller.up_target)
if(T && (istype(T, /turf/space) || istype(T, /turf/simulated/floor/open)))
var/blocked = 0
for(var/atom/A in T.contents)
if(A.density)
blocked = 1
usr << "\red You bump into [A.name]."
break
if(!blocked)
usr.Move(T)
usr << "You move upwards."
else
usr << "\red There is something in your way."
if (legal == 0)
usr << "There is nothing of interest in this direction."
return 1
/obj/item/weapon/tank/jetpack/verb/movedown()
set name = "Move Downwards"
set category = "Object"
if(allow_thrust(0.01, usr))
var/turf/controllerlocation = locate(1, 1, usr.z)
var/legal = 0
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
legal = controller.down
if (controller.down == 1)
var/turf/T = locate(usr.x, usr.y, controller.down_target)
var/turf/S = locate(usr.x, usr.y, usr.z)
if(T && (istype(S, /turf/space) || istype(S, /turf/simulated/floor/open)))
var/blocked = 0
for(var/atom/A in T.contents)
if(A.density)
blocked = 1
usr << "\red You bump into [A.name]."
break
if(!blocked)
usr.Move(T)
usr << "You move downwards."
else
usr << "\red You cant move through the floor."
if (legal == 0)
usr << "There is nothing of interest in this direction."
return 1
-274
View File
@@ -1,274 +0,0 @@
///////////////////////////////////////
//Contents: Ladders, Hatches, Stairs.//
///////////////////////////////////////
/obj/multiz
icon = 'icons/obj/structures.dmi'
density = 0
opacity = 0
anchored = 1
CanPass(obj/mover, turf/source, height, airflow)
return airflow || !density
/obj/multiz/ladder
icon_state = "ladderdown"
name = "ladder"
desc = "A ladder. You climb up and down it."
var/d_state = 1
var/obj/multiz/target
New()
. = ..()
proc/connect()
if(icon_state == "ladderdown") // the upper will connect to the lower
d_state = 1
var/turf/controllerlocation = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
if(controller.down)
var/turf/below = locate(src.x, src.y, controller.down_target)
for(var/obj/multiz/ladder/L in below)
if(L.icon_state == "ladderup")
target = L
L.target = src
d_state = 0
break
return
/* ex_act(severity)
switch(severity)
if(1.0)
if(icon_state == "ladderup" && prob(10))
qdel(src)
if(2.0)
if(prob(50))
qdel(src)
if(3.0)
qdel(src)
return*/
Destroy()
spawn(1)
if(target && icon_state == "ladderdown")
qdel(target)
return ..()
attackby(obj/item/C as obj, mob/user as mob)
(..)
// construction commented out for balance concerns
/* if (!target && istype(C, /obj/item/stack/rods))
var/turf/controllerlocation = locate(1, 1, z)
var/found = 0
var/obj/item/stack/rods/S = C
if(S.amount < 2)
user << "You dont have enough rods to finish the ladder."
return
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
if(controller.down)
found = 1
var/turf/below = locate(src.x, src.y, controller.down_target)
var/blocked = 0
for(var/atom/A in below.contents)
if(A.density)
blocked = 1
break
if(!blocked && !istype(below, /turf/simulated/wall))
var/obj/multiz/ladder/X = new /obj/multiz/ladder(below)
S.amount = S.amount - 2
if(S.amount == 0) qdel(S)
X.icon_state = "ladderup"
connect()
user << "You finish the ladder."
else
user << "The area below is blocked."
if(!found)
user << "You cant build a ladder down there."
return
else if (icon_state == "ladderdown" && d_state == 0 && istype(C, /obj/item/weapon/wrench))
user << "<span class='notice'>You start loosening the anchoring bolts which secure the ladder to the frame.</span>"
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
sleep(30)
if(!user || !C) return
src.d_state = 1
if(target)
var/obj/item/stack/rods/R = PoolOrNew(/obj/item/stack/rods, target.loc)
R.amount = 2
qdel(Target)
user << "<span class='notice'>You remove the bolts anchoring the ladder.</span>"
return
else if (icon_state == "ladderdown" && d_state == 1 && istype(C, /obj/item/weapon/weldingtool) )
var/obj/item/weapon/weldingtool/WT = C
if( WT.remove_fuel(0,user) )
user << "<span class='notice'>You begin to remove the ladder.</span>"
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
sleep(60)
if(!user || !WT || !WT.isOn()) return
var/obj/item/stack/material/steel/S = new /obj/item/stack/material/steel( src )
S.amount = 2
user << "<span class='notice'>You remove the ladder and close the hole.</span>"
qdel(src)
else
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
else
src.attack_hand(user)
return*/
src.attack_hand(user)
return
attack_hand(var/mob/M)
if(!target || !istype(target.loc, /turf))
M << "The ladder is incomplete and can't be climbed."
else
var/turf/T = target.loc
var/blocked = 0
for(var/atom/A in T.contents)
if(A.density)
blocked = 1
break
if(blocked || istype(T, /turf/simulated/wall))
M << "Something is blocking the ladder."
else
M.visible_message("\blue \The [M] climbs [src.icon_state == "ladderup" ? "up" : "down"] \the [src]!", "You climb [src.icon_state == "ladderup" ? "up" : "down"] \the [src]!", "You hear some grunting, and clanging of a metal ladder being used.")
M.Move(target.loc)
/* hatch
icon_state = "hatchdown"
name = "hatch"
desc = "A hatch. You climb down it, and it will automatically seal against pressure loss behind you."
top_icon_state = "hatchdown"
var/top_icon_state_open = "hatchdown-open"
var/top_icon_state_close = "hatchdown-close"
bottom_icon_state = "ladderup"
var/image/green_overlay
var/image/red_overlay
var/active = 0
New()
. = ..()
red_overlay = image(icon, "red-ladderlight")
green_overlay = image(icon, "green-ladderlight")
attack_hand(var/mob/M)
if(!target || !istype(target.loc, /turf))
qdel(src)
if(active)
M << "That [src] is being used."
return // It is a tiny airlock, only one at a time.
active = 1
var/obj/multiz/ladder/hatch/top_hatch = target
var/obj/multiz/ladder/hatch/bottom_hatch = src
if(icon_state == top_icon_state)
top_hatch = src
bottom_hatch = target
flick(top_icon_state_open, top_hatch)
bottom_hatch.overlays += green_overlay
spawn(7)
if(!target || !istype(target.loc, /turf))
qdel(src)
if(M.z == z && get_dist(src,M) <= 1)
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
M.visible_message("\blue \The [M] scurries [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You scramble [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You hear some grunting, and a hatch sealing.")
M.Move(target.loc)
flick(top_icon_state_close,top_hatch)
bottom_hatch.overlays -= green_overlay
bottom_hatch.overlays += red_overlay
spawn(7)
top_hatch.icon_state = top_icon_state
bottom_hatch.overlays -= red_overlay
active = 0*/
/obj/multiz/stairs
name = "Stairs"
desc = "Stairs. You walk up and down them."
icon_state = "rampbottom"
var/obj/multiz/stairs/connected
var/turf/target
var/turf/target2
var/suggest_dir // try this dir first when finding stairs; this is the direction to walk *down* the stairs
New()
..()
var/turf/cl= locate(1, 1, src.z)
for(var/obj/effect/landmark/zcontroller/c in cl)
if(c.up)
var/turf/O = locate(src.x, src.y, c.up_target)
if(istype(O, /turf/space))
O.ChangeTurf(/turf/simulated/floor/open)
spawn(1)
var/turf/T
if(suggest_dir)
T = get_step(src.loc,suggest_dir)
find_stair_connection(T, suggest_dir, 1)
if(!target)
for(var/dir in cardinal)
T = get_step(src.loc,dir)
find_stair_connection(T, dir)
if(target)
break
Bumped(var/atom/movable/M)
if(connected && target && istype(src, /obj/multiz/stairs) && locate(/obj/multiz/stairs) in M.loc)
var/obj/multiz/stairs/Con = locate(/obj/multiz/stairs) in M.loc
if(Con == src.connected) //make sure the atom enters from the approriate lower stairs tile
M.Move(target)
return
proc/find_stair_connection(var/turf/T, var/dir, var/suggested=0)
for(var/obj/multiz/stairs/S in T)
if(S && S.icon_state == "rampbottom" && !S.connected)
if(!S.suggest_dir || S.suggest_dir == dir) // it doesn't have a suggested direction, or it's the same direction as we're trying, so we connect to it
initialise_stair_connection(src, S, dir)
else if(!suggested) // we're trying directions, so it could be a reverse stair (i.e. we're the bottom stair rather than the top)
var/inv_dir = 0
switch(dir)
if(1)
inv_dir = 2
if(2)
inv_dir = 1
if(4)
inv_dir = 8
if(8)
inv_dir = 4
if(S.suggest_dir == inv_dir)
initialise_stair_connection(S, src, inv_dir)
proc/initialise_stair_connection(var/obj/multiz/stairs/top, var/obj/multiz/stairs/bottom, var/dir)
top.set_dir(dir)
bottom.set_dir(dir)
top.connected = bottom
bottom.connected = top
top.icon_state = "ramptop"
top.density = 1
var/turf/controllerlocation = locate(1, 1, top.z)
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
if(controller.up)
var/turf/above = locate(top.x, top.y, controller.up_target)
if(istype(above,/turf/space) || istype(above,/turf/simulated/floor/open))
top.target = above
var/turf/above2 = locate(bottom.x, bottom.y, controller.up_target)
if(istype(above2, /turf/space) || istype(above,/turf/simulated/floor/open))
top.target2 = above2
return
-11
View File
@@ -1,11 +0,0 @@
/obj/multiz/stairs/north_up
suggest_dir = SOUTH
/obj/multiz/stairs/south_up
suggest_dir = NORTH
/obj/multiz/stairs/east_up
suggest_dir = WEST
/obj/multiz/stairs/west_up
suggest_dir = EAST
-130
View File
@@ -1,130 +0,0 @@
/turf/simulated/floor/open
name = "open space"
intact = 0
density = 0
icon_state = "black"
pathweight = 100000 //Seriously, don't try and path over this one numbnuts
var/icon/darkoverlays = null
var/turf/floorbelow
var/list/overlay_references
New()
..()
getbelow()
return
Enter(var/atom/movable/AM)
if (..()) //TODO make this check if gravity is active (future use) - Sukasa
spawn(1)
// only fall down in defined areas (read: areas with artificial gravitiy)
if(!floorbelow) //make sure that there is actually something below
if(!getbelow())
return
if(AM)
var/area/areacheck = get_area(src)
var/blocked = 0
var/soft = 0
for(var/atom/A in floorbelow.contents)
if(A.density)
if(istype(A, /obj/structure/window))
var/obj/structure/window/W = A
blocked = W.is_fulltile()
if(blocked)
break
else
blocked = 1
break
if(istype(A, /obj/machinery/atmospherics/pipe/zpipe/up) && istype(AM,/obj/item/pipe))
blocked = 1
break
if(istype(A, /obj/structure/disposalpipe/up) && istype(AM,/obj/item/pipe))
blocked = 1
break
if(istype(A, /obj/multiz/stairs))
soft = 1
//dont break here, since we still need to be sure that it isnt blocked
if (soft || (!blocked && !(areacheck.name == "Space")))
AM.Move(floorbelow)
if (!soft && istype(AM, /mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
var/damage = 5
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "head")
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "chest")
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "l_leg")
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "r_leg")
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "l_arm")
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "r_arm")
H:weakened = max(H:weakened,2)
H:updatehealth()
return ..()
/turf/proc/hasbelow()
var/turf/controllerlocation = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
if(controller.down)
return 1
return 0
/turf/simulated/floor/open/proc/getbelow()
var/turf/controllerlocation = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
// check if there is something to draw below
if(!controller.down)
src.ChangeTurf(/turf/space)
return 0
else
floorbelow = locate(src.x, src.y, controller.down_target)
return 1
return 1
// override to make sure nothing is hidden
/turf/simulated/floor/open/levelupdate()
for(var/obj/O in src)
if(O.level == 1)
O.hide(0)
//overwrite the attackby of space to transform it to openspace if necessary
/turf/space/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/stack/cable_coil) && src.hasbelow())
var/turf/simulated/floor/open/W = src.ChangeTurf(/turf/simulated/floor/open)
W.attackby(C, user)
return
..()
/turf/simulated/floor/open/ex_act(severity)
// cant destroy empty space with an ordinary bomb
return
/turf/simulated/floor/open/attackby(obj/item/C as obj, mob/user as mob)
(..)
if (istype(C, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/cable = C
cable.turf_place(src, user)
return
if (istype(C, /obj/item/stack/rods))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
return
var/obj/item/stack/rods/R = C
if (R.use(1))
user << "\blue Constructing support lattice ..."
playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
ReplaceWithLattice()
return
if (istype(C, /obj/item/stack/tile/steel))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
var/obj/item/stack/tile/steel/S = C
if (S.get_amount() < 1)
return
qdel(L)
playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
S.build(src)
S.use(1)
return
else
user << "\red The plating is going to need some support."
return
-253
View File
@@ -1,253 +0,0 @@
/obj/effect/landmark/zcontroller
name = "Z-Level Controller"
var/initialized = 0 // when set to 1, turfs will report to the controller
var/up = 0 // 1 allows up movement
var/up_target = 0 // the Z-level that is above the current one
var/down = 0 // 1 allows down movement
var/down_target = 0 // the Z-level that is below the current one
var/list/slow = list()
var/list/normal = list()
var/list/fast = list()
var/slow_time
var/normal_time
var/fast_time
/obj/effect/landmark/zcontroller/New()
..()
for (var/turf/T in world)
if (T.z == z)
fast += T
slow_time = world.time + 3000
normal_time = world.time + 600
fast_time = world.time + 10
processing_objects.Add(src)
initialized = 1
return 1
/obj/effect/landmark/zcontroller/Destroy()
processing_objects.Remove(src)
return ..()
/obj/effect/landmark/zcontroller/process()
if (world.time > fast_time)
calc(fast)
fast_time = world.time + 10
if (world.time > normal_time)
calc(normal)
normal_time = world.time + 600
/* if (world.time > slow_time)
calc(slow)
slow_time = world.time + 3000 */
return
/obj/effect/landmark/zcontroller/proc/add(var/list/L, var/I, var/transfer)
while (L.len)
var/turf/T = pick(L)
L -= T
slow -= T
normal -= T
fast -= T
if(!T || !istype(T, /turf))
continue
switch (I)
if(1) slow += T
if(2) normal += T
if(3) fast += T
if(transfer > 0)
if(up)
var/turf/controller_up = locate(1, 1, up_target)
for(var/obj/effect/landmark/zcontroller/c_up in controller_up)
var/list/temp = list()
temp += locate(T.x, T.y, up_target)
c_up.add(temp, I, transfer-1)
if(down)
var/turf/controller_down = locate(1, 1, down_target)
for(var/obj/effect/landmark/zcontroller/c_down in controller_down)
var/list/temp = list()
temp += locate(T.x, T.y, down_target)
c_down.add(temp, I, transfer-1)
return
/turf
var/list/z_overlays = list()
/turf/New()
..()
var/turf/controller = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroller/c in controller)
if(c.initialized)
var/list/turf = list()
turf += src
c.add(turf,3,1)
atom/movable/Move() //Hackish
. = ..()
var/turf/controllerlocation = locate(1, 1, src.z)
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
if(controller.up || controller.down)
var/list/temp = list()
temp += locate(src.x, src.y, src.z)
controller.add(temp,3,1)
/obj/effect/landmark/zcontroller/proc/calc(var/list/L)
var/list/slowholder = list()
var/list/normalholder = list()
var/list/fastholder = list()
var/new_list
while(L.len)
var/turf/T = pick(L)
new_list = 0
if(!T || !istype(T, /turf))
L -= T
continue
T.overlays -= T.z_overlays
T.z_overlays -= T.z_overlays
if(down && (istype(T, /turf/space) || istype(T, /turf/simulated/floor/open)))
var/turf/below = locate(T.x, T.y, down_target)
if(below)
if(!(istype(below, /turf/space) || istype(below, /turf/simulated/floor/open)))
var/image/t_img = list()
new_list = 1
var/image/temp = image(below, dir=below.dir, layer = TURF_LAYER + 0.04)
temp.color = rgb(127,127,127)
temp.overlays += below.overlays
t_img += temp
T.overlays += t_img
T.z_overlays += t_img
// get objects
var/image/o_img = list()
for(var/obj/o in below)
// ingore objects that have any form of invisibility
if(o.invisibility) continue
new_list = 2
var/image/temp2 = image(o, dir=o.dir, layer = TURF_LAYER+0.05*o.layer)
temp2.color = rgb(127,127,127)
temp2.overlays += o.overlays
o_img += temp2
// you need to add a list to .overlays or it will not display any because space
T.overlays += o_img
T.z_overlays += o_img
// get mobs
var/image/m_img = list()
for(var/mob/m in below)
// ingore mobs that have any form of invisibility
if(m.invisibility) continue
// only add this tile to fastprocessing if there is a living mob, not a dead one
if(istype(m, /mob/living)) new_list = 3
var/image/temp2 = image(m, dir=m.dir, layer = TURF_LAYER+0.05*m.layer)
temp2.color = rgb(127,127,127)
temp2.overlays += m.overlays
m_img += temp2
// you need to add a list to .overlays or it will not display any because space
T.overlays += m_img
T.z_overlays += m_img
T.overlays -= below.z_overlays
T.z_overlays -= below.z_overlays
// this is sadly impossible to use right now
// the overlay is always opaque to mouseclicks and thus prevents interactions with everything except the turf
/*if(up)
var/turf/above = locate(T.x, T.y, up_target)
if(above)
var/eligeable = 0
for(var/d in cardinal)
var/turf/mT = get_step(above,d)
if(istype(mT, /turf/space) || istype(mT, /turf/simulated/floor/open))
eligeable = 1
/*if(mT.opacity == 0)
for(var/f in cardinal)
var/turf/nT = get_step(mT,f)
if(istype(nT, /turf/space) || istype(nT, /turf/simulated/floor/open))
eligeable = 1*/
if(istype(above, /turf/space) || istype(above, /turf/simulated/floor/open)) eligeable = 1
if(eligeable == 1)
if(!(istype(above, /turf/space) || istype(above, /turf/simulated/floor/open)))
var/image/t_img = list()
if(new_list < 1) new_list = 1
above.overlays -= above.z_overlays
var/image/temp = image(above, dir=above.dir, layer = 5 + 0.04)
above.overlays += above.z_overlays
temp.alpha = 100
temp.overlays += above.overlays
temp.overlays -= above.z_overlays
t_img += temp
T.overlays += t_img
T.z_overlays += t_img
// get objects
var/image/o_img = list()
for(var/obj/o in above)
// ingore objects that have any form of invisibility
if(o.invisibility) continue
if(new_list < 2) new_list = 2
var/image/temp2 = image(o, dir=o.dir, layer = 5+0.05*o.layer)
temp2.alpha = 100
temp2.overlays += o.overlays
o_img += temp2
// you need to add a list to .overlays or it will not display any because space
T.overlays += o_img
T.z_overlays += o_img
// get mobs
var/image/m_img = list()
for(var/mob/m in above)
// ingore mobs that have any form of invisibility
if(m.invisibility) continue
// only add this tile to fastprocessing if there is a living mob, not a dead one
if(istype(m, /mob/living) && new_list < 3) new_list = 3
var/image/temp2 = image(m, dir=m.dir, layer = 5+0.05*m.layer)
temp2.alpha = 100
temp2.overlays += m.overlays
m_img += temp2
// you need to add a list to .overlays or it will not display any because space
T.overlays += m_img
T.z_overlays += m_img
T.overlays -= above.z_overlays
T.z_overlays -= above.z_overlays*/
L -= T
if(new_list == 1)
slowholder += T
if(new_list == 2)
normalholder += T
if(new_list == 3)
fastholder += T
for(var/d in cardinal)
var/turf/mT = get_step(T,d)
if(!(mT in fastholder))
fastholder += mT
for(var/f in cardinal)
var/turf/nT = get_step(mT,f)
if(!(nT in fastholder))
fastholder += nT
add(slowholder,1, 0)
add(normalholder, 2, 0)
add(fastholder, 3, 0)
return
-37
View File
@@ -1,37 +0,0 @@
/obj/effect/landmark/zcontroller/level_1_bottom
up = 1
up_target = 2
/obj/effect/landmark/zcontroller/level_2_mid
up = 1
up_target = 3
down = 1
down_target = 1
/obj/effect/landmark/zcontroller/level_3_mid
up = 1
up_target = 4
down = 1
down_target = 2
/obj/effect/landmark/zcontroller/level_4_mid
up = 1
up_target = 5
down = 1
down_target = 3
/obj/effect/landmark/zcontroller/level_2_top
down = 1
down_target = 1
/obj/effect/landmark/zcontroller/level_3_top
down = 1
down_target = 2
/obj/effect/landmark/zcontroller/level_4_top
down = 1
down_target = 3
/obj/effect/landmark/zcontroller/level_5_top
down = 1
down_target = 4
+31 -26
View File
@@ -11,6 +11,9 @@ mob/proc/airflow_stun()
if(!(status_flags & CANSTUN) && !(status_flags & CANWEAKEN))
src << "<span class='notice'>You stay upright as the air rushes past you.</span>"
return 0
if(buckled)
src << "<span class='notice'>Air suddenly rushes past you!</span>"
return 0
if(!lying)
src << "<span class='warning'>The sudden rush of air knocks you over!</span>"
Weaken(5)
@@ -24,7 +27,7 @@ mob/living/carbon/slime/airflow_stun()
mob/living/carbon/human/airflow_stun()
if(shoes)
if(shoes.flags & NOSLIP) return 0
if(shoes.item_flags & NOSLIP) return 0
..()
atom/movable/proc/check_airflow_movable(n)
@@ -62,6 +65,19 @@ obj/item/check_airflow_movable(n)
/atom/movable/var/tmp/airflow_time = 0
/atom/movable/var/tmp/last_airflow = 0
/atom/movable/proc/AirflowCanMove(n)
return 1
/mob/AirflowCanMove(n)
if(status_flags & GODMODE)
return 0
if(buckled)
return 0
var/obj/item/shoes = get_equipped_item(slot_shoes)
if(istype(shoes) && (shoes.item_flags & NOSLIP))
return 0
return 1
/atom/movable/proc/GotoAirflowDest(n)
if(!airflow_dest) return
if(airflow_speed < 0) return
@@ -69,18 +85,13 @@ obj/item/check_airflow_movable(n)
if(airflow_speed)
airflow_speed = n/max(get_dist(src,airflow_dest),1)
return
last_airflow = world.time
if(airflow_dest == loc)
step_away(src,loc)
if(!src.AirflowCanMove(n))
return
if(ismob(src))
if(src:status_flags & GODMODE)
return
if(istype(src, /mob/living/carbon/human))
if(src:buckled)
return
if(src:shoes && src:shoes.flags & NOSLIP)
return
src << "\red You are sucked away by airflow!"
src << "<span class='danger'>You are sucked away by airflow!</span>"
last_airflow = world.time
var/airflow_falloff = 9 - sqrt((x - airflow_dest.x) ** 2 + (y - airflow_dest.y) ** 2)
if(airflow_falloff < 1)
airflow_dest = null
@@ -116,8 +127,9 @@ obj/item/check_airflow_movable(n)
if(!istype(loc, /turf))
break
step_towards(src, src.airflow_dest)
if(ismob(src) && src:client)
src:client:move_delay = world.time + vsc.airflow_mob_slowdown
var/mob/M = src
if(istype(M) && M.client)
M.setMoveCooldown(vsc.airflow_mob_slowdown)
airflow_dest = null
airflow_speed = 0
airflow_time = 0
@@ -134,18 +146,11 @@ obj/item/check_airflow_movable(n)
return
if(airflow_dest == loc)
step_away(src,loc)
if(!src.AirflowCanMove(n))
return
if(ismob(src))
if(src:status_flags & GODMODE)
return
if(istype(src, /mob/living/carbon/human))
if(src:buckled)
return
if(src:shoes)
if(istype(src:shoes, /obj/item/clothing/shoes/magboots))
if(src:shoes.flags & NOSLIP)
return
src << "\red You are pushed away by airflow!"
last_airflow = world.time
src << "<span clas='danger'>You are pushed away by airflow!</span>"
last_airflow = world.time
var/airflow_falloff = 9 - sqrt((x - airflow_dest.x) ** 2 + (y - airflow_dest.y) ** 2)
if(airflow_falloff < 1)
airflow_dest = null
@@ -197,7 +202,7 @@ atom/movable/proc/airflow_hit(atom/A)
mob/airflow_hit(atom/A)
for(var/mob/M in hearers(src))
M.show_message("\red <B>\The [src] slams into \a [A]!</B>",1,"\red You hear a loud slam!",2)
M.show_message("<span class='danger'>\The [src] slams into \a [A]!</span>",1,"<span class='danger'>You hear a loud slam!</span>",2)
playsound(src.loc, "smash.ogg", 25, 1, -1)
var/weak_amt = istype(A,/obj/item) ? A:w_class : rand(1,5) //Heheheh
Weaken(weak_amt)
@@ -205,7 +210,7 @@ mob/airflow_hit(atom/A)
obj/airflow_hit(atom/A)
for(var/mob/M in hearers(src))
M.show_message("\red <B>\The [src] slams into \a [A]!</B>",1,"\red You hear a loud slam!",2)
M.show_message("<span class='danger'>\The [src] slams into \a [A]!</span>",1,"<span class='danger'>You hear a loud slam!</span>",2)
playsound(src.loc, "smash.ogg", 25, 1, -1)
. = ..()
@@ -215,7 +220,7 @@ obj/item/airflow_hit(atom/A)
mob/living/carbon/human/airflow_hit(atom/A)
// for(var/mob/M in hearers(src))
// M.show_message("\red <B>[src] slams into [A]!</B>",1,"\red You hear a loud slam!",2)
// M.show_message("<span class='danger'>[src] slams into [A]!</span>",1,"<span class='danger'>You hear a loud slam!</span>",2)
playsound(src.loc, "punch", 25, 1, -1)
if (prob(33))
loc:add_blood(src)
+2 -5
View File
@@ -1,7 +1,4 @@
/atom/var/pressure_resistance = ONE_ATMOSPHERE
/atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
//Purpose: Determines if the object (or airflow) can pass this atom.
//Called by: Movement, airflow.
@@ -64,9 +61,9 @@ turf/c_airblock(turf/other)
#ifdef ZLEVELS
if(other.z != src.z)
if(other.z < src.z)
if(!istype(src, /turf/simulated/floor/open)) return BLOCKED
if(!istype(src, /turf/simulated/open)) return BLOCKED
else
if(!istype(other, /turf/simulated/floor/open)) return BLOCKED
if(!istype(other, /turf/simulated/open)) return BLOCKED
#endif
var/result = 0
+4 -4
View File
@@ -109,13 +109,13 @@ Class Procs:
simulated_turf_count++
S.update_air_properties()
admin_notice({"<span class='danger'>Geometry initialized in [round(0.1*(world.timeofday-start_time),0.1)] seconds.</b></span>
admin_notice({"<span class='danger'>Geometry initialized in [round(0.1*(world.timeofday-start_time),0.1)] seconds.</span>
<span class='info'>
Total Simulated Turfs: [simulated_turf_count]
Total Zones: [zones.len]
Total Edges: [edges.len]
Total Active Edges: [active_edges.len ? "<span class='danger'>[active_edges.len]</span>" : "None"]
Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_count]</font>
Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_count]
</span>"}, R_DEBUG)
@@ -187,7 +187,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
#ifdef ZASDBG
if(updated != updating.len)
tick_progress = "[updating.len - updated] tiles left unupdated."
world << "\red [tick_progress]"
world << "<span class='danger'>[tick_progress]</span>"
. = 0
#endif
@@ -372,4 +372,4 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
/datum/controller/air_system/proc/remove_edge(connection_edge/E)
edges.Remove(E)
if(!E.sleeping) active_edges.Remove(E)
if(!E.sleeping) active_edges.Remove(E)
+1 -148
View File
@@ -84,154 +84,7 @@ client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf)
else
mob << "both turfs can merge."
/*zone/proc/DebugDisplay(client/client)
if(!istype(client))
return
if(!dbg_output)
dbg_output = 1 //Don't want to be spammed when someone investigates a zone...
if(!client.zone_debug_images)
client.zone_debug_images = list()
var/list/current_zone_images = list()
for(var/turf/T in contents)
current_zone_images += image('icons/misc/debug_group.dmi', T, null, TURF_LAYER)
for(var/turf/space/S in unsimulated_tiles)
current_zone_images += image('icons/misc/debug_space.dmi', S, null, TURF_LAYER)
client << "<u>Zone Air Contents</u>"
client << "Oxygen: [air.oxygen]"
client << "Nitrogen: [air.nitrogen]"
client << "Phoron: [air.phoron]"
client << "Carbon Dioxide: [air.carbon_dioxide]"
client << "Temperature: [air.temperature] K"
client << "Heat Energy: [air.temperature * air.heat_capacity()] J"
client << "Pressure: [air.return_pressure()] KPa"
client << ""
client << "Space Tiles: [length(unsimulated_tiles)]"
client << "Movable Objects: [length(movables())]"
client << "<u>Connections: [length(connections)]</u>"
for(var/connection/C in connections)
client << "\ref[C] [C.A] --> [C.B] [(C.indirect?"Open":"Closed")]"
current_zone_images += image('icons/misc/debug_connect.dmi', C.A, null, TURF_LAYER)
current_zone_images += image('icons/misc/debug_connect.dmi', C.B, null, TURF_LAYER)
client << "Connected Zones:"
for(var/zone/zone in connected_zones)
client << "\ref[zone] [zone] - [connected_zones[zone]] (Connected)"
for(var/zone/zone in closed_connection_zones)
client << "\ref[zone] [zone] - [closed_connection_zones[zone]] (Unconnected)"
for(var/C in connections)
if(!istype(C,/connection))
client << "[C] (Not Connection!)"
if(!client.zone_debug_images)
client.zone_debug_images = list()
client.zone_debug_images[src] = current_zone_images
client.images += client.zone_debug_images[src]
else
dbg_output = 0
client.images -= client.zone_debug_images[src]
client.zone_debug_images.Remove(src)
if(air_master)
for(var/zone/Z in air_master.zones)
if(Z.air == air && Z != src)
var/turf/zloc = pick(Z.contents)
client << "\red Illegal air datum shared by: [zloc.loc.name]"*/
/*client/proc/TestZASRebuild()
set category = "Debug"
// var/turf/turf = get_turf(mob)
var/zone/current_zone = mob.loc:zone
if(!current_zone)
src << "There is no zone there!"
return
var/list/current_adjacents = list()
var/list/overlays = list()
var/adjacent_id
var/lowest_id
var/list/identical_ids = list()
var/list/turfs = current_zone.contents.Copy()
var/current_identifier = 1
for(var/turf/simulated/current in turfs)
lowest_id = null
current_adjacents = list()
for(var/direction in cardinal)
var/turf/simulated/adjacent = get_step(current, direction)
if(!current.ZCanPass(adjacent))
continue
if(turfs.Find(adjacent))
current_adjacents += adjacent
adjacent_id = turfs[adjacent]
if(adjacent_id && (!lowest_id || adjacent_id < lowest_id))
lowest_id = adjacent_id
if(!lowest_id)
lowest_id = current_identifier++
identical_ids += lowest_id
overlays += image('icons/misc/debug_rebuild.dmi',, "[lowest_id]")
for(var/turf/simulated/adjacent in current_adjacents)
adjacent_id = turfs[adjacent]
if(adjacent_id != lowest_id)
if(adjacent_id)
adjacent.overlays -= overlays[adjacent_id]
identical_ids[adjacent_id] = lowest_id
turfs[adjacent] = lowest_id
adjacent.overlays += overlays[lowest_id]
sleep(5)
if(turfs[current])
current.overlays -= overlays[turfs[current]]
turfs[current] = lowest_id
current.overlays += overlays[lowest_id]
sleep(5)
var/list/final_arrangement = list()
for(var/turf/simulated/current in turfs)
current_identifier = identical_ids[turfs[current]]
current.overlays -= overlays[turfs[current]]
current.overlays += overlays[current_identifier]
sleep(5)
if( current_identifier > final_arrangement.len )
final_arrangement.len = current_identifier
final_arrangement[current_identifier] = list(current)
else
final_arrangement[current_identifier] += current
//lazy but fast
final_arrangement.Remove(null)
src << "There are [final_arrangement.len] unique segments."
for(var/turf/current in turfs)
current.overlays -= overlays
return final_arrangement*/
client/proc/ZASSettings()
set category = "Debug"
vsc.SetDefault(mob)
vsc.SetDefault(mob)
+29 -24
View File
@@ -88,7 +88,7 @@ obj/var/contaminated = 0
if(vsc.plc.SKIN_BURNS)
if(!pl_head_protected() || !pl_suit_protected())
burn_skin(0.75)
if(prob(20)) src << "\red Your skin burns!"
if(prob(20)) src << "<span class='danger'>Your skin burns!</span>"
updatehealth()
//Burn eyes if exposed.
@@ -97,37 +97,37 @@ obj/var/contaminated = 0
if(!wear_mask)
burn_eyes()
else
if(!(wear_mask.flags & MASKCOVERSEYES))
if(!(wear_mask.body_parts_covered & EYES))
burn_eyes()
else
if(!(head.flags & HEADCOVERSEYES))
if(!(head.body_parts_covered & EYES))
if(!wear_mask)
burn_eyes()
else
if(!(wear_mask.flags & MASKCOVERSEYES))
if(!(wear_mask.body_parts_covered & EYES))
burn_eyes()
//Genetic Corruption
if(vsc.plc.GENETIC_CORRUPTION)
if(rand(1,10000) < vsc.plc.GENETIC_CORRUPTION)
randmutb(src)
src << "\red High levels of toxins cause you to spontaneously mutate."
src << "<span class='danger'>High levels of toxins cause you to spontaneously mutate!</span>"
domutcheck(src,null)
/mob/living/carbon/human/proc/burn_eyes()
//The proc that handles eye burning.
if(!species.has_organ["eyes"] || get_species() == "Vaurca")
return
//The proc that handles eye burning.
if(!species.has_organ["eyes"] || get_species() == "Vaurca")
return
var/obj/item/organ/eyes/E = internal_organs_by_name["eyes"]
if(E)
if(prob(20)) src << "\red Your eyes burn!"
E.damage += 2.5
eye_blurry = min(eye_blurry+1.5,50)
if (prob(max(0,E.damage - 15) + 1) &&!eye_blind)
src << "\red You are blinded!"
eye_blind += 20
var/obj/item/organ/eyes/E = internal_organs_by_name["eyes"]
if(E)
if(prob(20)) src << "<span class='danger'>Your eyes burn!</span>"
E.damage += 2.5
eye_blurry = min(eye_blurry+1.5,50)
if (prob(max(0,E.damage - 15) + 1) &&!eye_blind)
src << "<span class='danger'>You are blinded!</span>"
eye_blind += 20
/mob/living/carbon/human/proc/pl_head_protected()
//Checks if the head is adequately sealed.
@@ -135,19 +135,24 @@ obj/var/contaminated = 0
if(vsc.plc.PHORONGUARD_ONLY)
if(head.flags & PHORONGUARD)
return 1
else if(head.flags & HEADCOVERSEYES)
else if(head.body_parts_covered & EYES)
return 1
return 0
/mob/living/carbon/human/proc/pl_suit_protected()
//Checks if the suit is adequately sealed.
if(wear_suit)
if(vsc.plc.PHORONGUARD_ONLY)
if(wear_suit.flags & PHORONGUARD) return 1
else
if(wear_suit.flags_inv & HIDEJUMPSUIT) return 1
//should check HIDETAIL as well, but for the moment tails are not a part that can be damaged separately
return 0
var/coverage = 0
for(var/obj/item/protection in list(wear_suit, gloves, shoes))
if(!protection)
continue
if(vsc.plc.PHORONGUARD_ONLY && !(protection.flags & PHORONGUARD))
return 0
coverage |= protection.body_parts_covered
if(vsc.plc.PHORONGUARD_ONLY)
return 1
return BIT_TEST_ALL(coverage, UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS)
/mob/living/carbon/human/proc/suit_contamination()
//Runs over the things that can be contaminated and does so.
+2 -2
View File
@@ -169,7 +169,7 @@ var/global/vs_control/vsc = new
vars[ch] = vw
if(how == "Toggle")
newvar = (newvar?"ON":"OFF")
world << "\blue <b>[key_name(user)] changed the setting [display_description] to [newvar].</b>"
world << "<span class='notice'><b>[key_name(user)] changed the setting [display_description] to [newvar].</b></span>"
if(ch in plc.settings)
ChangeSettingsDialog(user,plc.settings)
else
@@ -322,7 +322,7 @@ var/global/vs_control/vsc = new
plc.N2O_HALLUCINATION = initial(plc.N2O_HALLUCINATION)
world << "\blue <b>[key_name(user)] changed the global phoron/ZAS settings to \"[def]\"</b>"
world << "<span class='notice'><b>[key_name(user)] changed the global phoron/ZAS settings to \"[def]\"</b></span>"
/pl_control/var/list/settings = list()
+2
View File
@@ -0,0 +1,2 @@
#define BACKGROUND_ENABLED 0 // The default value for all uses of set background. Set background can cause gradual lag and is recommended you only turn this on if necessary.
// 1 will enable set background. 0 will disable set background.
+42
View File
@@ -0,0 +1,42 @@
// A set of constants used to determine which type of mute an admin wishes to apply.
// Please read and understand the muting/automuting stuff before changing these. MUTE_IC_AUTO, etc. = (MUTE_IC << 1)
// Therefore there needs to be a gap between the flags for the automute flags.
#define MUTE_IC 0x1
#define MUTE_OOC 0x2
#define MUTE_PRAY 0x4
#define MUTE_ADMINHELP 0x8
#define MUTE_DEADCHAT 0x10
#define MUTE_ALL 0xFFFF
// Number of identical messages required to get the spam-prevention auto-mute thing to trigger warnings and automutes.
#define SPAM_TRIGGER_WARNING 5
#define SPAM_TRIGGER_AUTOMUTE 10
// Some constants for DB_Ban
#define BANTYPE_PERMA 1
#define BANTYPE_TEMP 2
#define BANTYPE_JOB_PERMA 3
#define BANTYPE_JOB_TEMP 4
#define BANTYPE_ANY_FULLBAN 5 // Used to locate stuff to unban.
#define ROUNDSTART_LOGOUT_REPORT_TIME 6000 // Amount of time (in deciseconds) after the rounds starts, that the player disconnect report is issued.
// Admin permissions.
#define R_BUILDMODE 0x1
#define R_ADMIN 0x2
#define R_BAN 0x4
#define R_FUN 0x8
#define R_SERVER 0x10
#define R_DEBUG 0x20
#define R_POSSESS 0x40
#define R_PERMISSIONS 0x80
#define R_STEALTH 0x100
#define R_REJUVINATE 0x200
#define R_VAREDIT 0x400
#define R_SOUNDS 0x800
#define R_SPAWN 0x1000
#define R_MOD 0x2000
#define R_MENTOR 0x4000
#define R_HOST 0x8000 //higher than this will overflow
#define R_MAXPERMISSION 0x8000 // This holds the maximum value for a permission. It is used in iteration, so keep it updated.
+96
View File
@@ -0,0 +1,96 @@
#define CELL_VOLUME 2500 // Liters in a cell.
#define MOLES_CELLSTANDARD (ONE_ATMOSPHERE*CELL_VOLUME/(T20C*R_IDEAL_GAS_EQUATION)) // Moles in a 2.5 m^3 cell at 101.325 kPa and 20 C.
#define O2STANDARD 0.21 // Percentage.
#define N2STANDARD 0.79
#define MOLES_PHORON_VISIBLE 0.7 // Moles in a standard cell after which phoron is visible.
#define MOLES_O2STANDARD (MOLES_CELLSTANDARD * O2STANDARD) // O2 standard value (21%)
#define MOLES_N2STANDARD (MOLES_CELLSTANDARD * N2STANDARD) // N2 standard value (79%)
#define MOLES_O2ATMOS (MOLES_O2STANDARD*50)
#define MOLES_N2ATMOS (MOLES_N2STANDARD*50)
// These are for when a mob breathes poisonous air.
#define MIN_TOXIN_DAMAGE 1
#define MAX_TOXIN_DAMAGE 10
#define BREATH_VOLUME 0.5 // Liters in a normal breath.
#define BREATH_MOLES (ONE_ATMOSPHERE * BREATH_VOLUME / (T20C * R_IDEAL_GAS_EQUATION)) // Amount of air to take a from a tile
#define BREATH_PERCENTAGE (BREATH_VOLUME / CELL_VOLUME) // Amount of air needed before pass out/suffocation commences.
#define HUMAN_NEEDED_OXYGEN (MOLES_CELLSTANDARD * BREATH_PERCENTAGE * 0.16)
#define HUMAN_HEAT_CAPACITY 280000 //J/K For 80kg person
#define SOUND_MINIMUM_PRESSURE 10
#define PRESSURE_DAMAGE_COEFFICIENT 4 // The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE.
#define MAX_HIGH_PRESSURE_DAMAGE 4 // This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :(
#define LOW_PRESSURE_DAMAGE 2 // The amount of damage someone takes when in a low pressure area. (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value).
#define MINIMUM_AIR_RATIO_TO_SUSPEND 0.05 // Minimum ratio of air that must move to/from a tile to suspend group processing
#define MINIMUM_AIR_TO_SUSPEND (MOLES_CELLSTANDARD * MINIMUM_AIR_RATIO_TO_SUSPEND) // Minimum amount of air that has to move before a group processing can be suspended
#define MINIMUM_MOLES_DELTA_TO_MOVE (MOLES_CELLSTANDARD * MINIMUM_AIR_RATIO_TO_SUSPEND) // Either this must be active
#define MINIMUM_TEMPERATURE_TO_MOVE (T20C + 100) // or this (or both, obviously)
#define MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND 0.012 // Minimum temperature difference before group processing is suspended.
#define MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND 4
#define MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER 0.5 // Minimum temperature difference before the gas temperatures are just set to be equal.
#define MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION (T20C + 10)
#define MINIMUM_TEMPERATURE_START_SUPERCONDUCTION (T20C + 200)
// Must be between 0 and 1. Values closer to 1 equalize temperature faster. Should not exceed 0.4, else strange heat flow occurs.
#define FLOOR_HEAT_TRANSFER_COEFFICIENT 0.4
#define WALL_HEAT_TRANSFER_COEFFICIENT 0.0
#define DOOR_HEAT_TRANSFER_COEFFICIENT 0.0
#define SPACE_HEAT_TRANSFER_COEFFICIENT 0.2 // A hack to partly simulate radiative heat.
#define OPEN_HEAT_TRANSFER_COEFFICIENT 0.4
#define WINDOW_HEAT_TRANSFER_COEFFICIENT 0.1 // A hack for now.
// Fire damage.
#define CARBON_LIFEFORM_FIRE_RESISTANCE (T0C + 200)
#define CARBON_LIFEFORM_FIRE_DAMAGE 4
// Phoron fire properties.
#define PHORON_MINIMUM_BURN_TEMPERATURE (T0C + 126) //400 K - autoignite temperature in tanks and canisters - enclosed environments I guess
#define PHORON_FLASHPOINT (T0C + 246) //519 K - autoignite temperature in air if that ever gets implemented.
//These control the mole ratio of oxidizer and fuel used in the combustion reaction
#define FIRE_REACTION_OXIDIZER_AMOUNT 3 //should be greater than the fuel amount if fires are going to spread much
#define FIRE_REACTION_FUEL_AMOUNT 2
//These control the speed at which fire burns
#define FIRE_GAS_BURNRATE_MULT 1
#define FIRE_LIQUID_BURNRATE_MULT 0.225
//If the fire is burning slower than this rate then the reaction is going too slow to be self sustaining and the fire burns itself out.
//This ensures that fires don't grind to a near-halt while still remaining active forever.
#define FIRE_GAS_MIN_BURNRATE 0.01
#define FIRE_LIQUD_MIN_BURNRATE 0.0025
//How many moles of fuel are contained within one solid/liquid fuel volume unit
#define LIQUIDFUEL_AMOUNT_TO_MOL 0.45 //mol/volume unit
// XGM gas flags.
#define XGM_GAS_FUEL 1
#define XGM_GAS_OXIDIZER 2
#define XGM_GAS_CONTAMINANT 4
#define TANK_LEAK_PRESSURE (30.*ONE_ATMOSPHERE) // Tank starts leaking.
#define TANK_RUPTURE_PRESSURE (40.*ONE_ATMOSPHERE) // Tank spills all contents into atmosphere.
#define TANK_FRAGMENT_PRESSURE (50.*ONE_ATMOSPHERE) // Boom 3x3 base explosion.
#define TANK_FRAGMENT_SCALE (10.*ONE_ATMOSPHERE) // +1 for each SCALE kPa above threshold. Was 2 atm.
#define NORMPIPERATE 30 // Pipe-insulation rate divisor.
#define HEATPIPERATE 8 // Heat-exchange pipe insulation.
#define FLOWFRAC 0.99 // Fraction of gas transfered per process.
//Flags for zone sleeping
#define ZONE_ACTIVE 1
#define ZONE_SLEEPING 0
// Defines how much of certain gas do the Atmospherics tanks start with. Values are in kpa per tile (assuming 20C)
#define ATMOSTANK_NITROGEN 90000 // A lot of N2 is needed to produce air mix, that's why we keep 90MPa of it
#define ATMOSTANK_OXYGEN 40000 // O2 is also important for airmix, but not as much as N2 as it's only 21% of it.
#define ATMOSTANK_CO2 25000 // CO2 and PH are not critically important for station, only for toxins and alternative coolants, no need to store a lot of those.
#define ATMOSTANK_PHORON 25000
#define ATMOSTANK_NITROUSOXIDE 10000 // N2O doesn't have a real useful use, i guess it's on station just to allow refilling of sec's riot control canisters?
+40
View File
@@ -0,0 +1,40 @@
#define HUNGER_FACTOR 0.05 // Factor of how fast mob nutrition decreases
#define REM 0.2 // Means 'Reagent Effect Multiplier'. This is how many units of reagent are consumed per tick
#define CHEM_TOUCH 1
#define CHEM_INGEST 2
#define CHEM_BLOOD 3
#define MINIMUM_CHEMICAL_VOLUME 0.01
#define SOLID 1
#define LIQUID 2
#define GAS 3
#define REAGENTS_OVERDOSE 30
#define CHEM_SYNTH_ENERGY 500 // How much energy does it take to synthesize 1 unit of chemical, in Joules.
// Some on_mob_life() procs check for alien races.
#define IS_DIONA 1
#define IS_VOX 2
#define IS_SKRELL 3
#define IS_UNATHI 4
#define IS_TAJARA 5
#define IS_XENOS 6
#define IS_MACHINE 7
#define CE_STABLE "stable" // Inaprovaline
#define CE_ANTIBIOTIC "antibiotic" // Spaceacilin
#define CE_BLOODRESTORE "bloodrestore" // Iron/nutriment
#define CE_PAINKILLER "painkiller"
#define CE_ALCOHOL "alcohol" // Liver filtering
#define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage
#define CE_SPEEDBOOST "gofast" // Hyperzine
// Chemistry lists.
var/list/tachycardics = list("coffee", "inaprovaline", "hyperzine", "nitroglycerin", "thirteenloko", "nicotine") // Increase heart rate.
var/list/bradycardics = list("neurotoxin", "cryoxadone", "clonexadone", "space_drugs", "stoxin") // Decrease heart rate.
var/list/heartstopper = list("potassium_phorochloride", "zombie_powder") // This stops the heart.
var/list/cheartstopper = list("potassium_chloride") // This stops the heart when overdose is met. -- c = conditional
+50
View File
@@ -0,0 +1,50 @@
// Damage things. TODO: Merge these down to reduce on defines.
// Way to waste perfectly good damage-type names (BRUTE) on this... If you were really worried about case sensitivity, you could have just used lowertext(damagetype) in the proc.
#define BRUTE "brute"
#define BURN "fire"
#define TOX "tox"
#define OXY "oxy"
#define CLONE "clone"
#define HALLOSS "halloss"
#define CUT "cut"
#define BRUISE "bruise"
#define STUN "stun"
#define WEAKEN "weaken"
#define PARALYZE "paralize"
#define IRRADIATE "irradiate"
#define AGONY "agony" // Added in PAIN!
#define SLUR "slur"
#define STUTTER "stutter"
#define EYE_BLUR "eye_blur"
#define DROWSY "drowsy"
#define FIRE_DAMAGE_MODIFIER 0.0215 // Higher values result in more external fire damage to the skin. (default 0.0215)
#define AIR_DAMAGE_MODIFIER 2.025 // More means less damage from hot air scalding lungs, less = more damage. (default 2.025)
// Organ defines.
#define ORGAN_CUT_AWAY (1<<0)
#define ORGAN_BLEEDING (1<<1)
#define ORGAN_BROKEN (1<<2)
#define ORGAN_DESTROYED (1<<3)
#define ORGAN_ROBOT (1<<4)
#define ORGAN_SPLINTED (1<<5)
#define ORGAN_DEAD (1<<6)
#define ORGAN_MUTATED (1<<7)
#define ORGAN_ASSISTED (1<<8)
#define DROPLIMB_EDGE 0
#define DROPLIMB_BLUNT 1
#define DROPLIMB_BURN 2
// Damage above this value must be repaired with surgery.
#define ROBOLIMB_SELF_REPAIR_CAP 30
//Germs and infections.
#define GERM_LEVEL_AMBIENT 110 // Maximum germ level you can reach by standing still.
#define GERM_LEVEL_MOVE_CAP 200 // Maximum germ level you can reach by running around.
#define INFECTION_LEVEL_ONE 100
#define INFECTION_LEVEL_TWO 500
#define INFECTION_LEVEL_THREE 1000
+76
View File
@@ -0,0 +1,76 @@
// Bitflags for mutations.
#define STRUCDNASIZE 27
#define UNIDNASIZE 13
// Generic mutations:
#define TK 1
#define COLD_RESISTANCE 2
#define XRAY 3
#define HULK 4
#define CLUMSY 5
#define FAT 6
#define HUSK 7
#define NOCLONE 8
#define LASER 9 // Harm intent - click anywhere to shoot lasers from eyes.
#define HEAL 10 // Healing people with hands.
#define SKELETON 29
#define PLANT 30
// Other Mutations:
#define mNobreath 100 // No need to breathe.
#define mRemote 101 // Remote viewing.
#define mRegen 102 // Health regeneration.
#define mRun 103 // No slowdown.
#define mRemotetalk 104 // Remote talking.
#define mMorph 105 // Hanging appearance.
#define mBlend 106 // Nothing. (seriously nothing)
#define mHallucination 107 // Hallucinations.
#define mFingerprints 108 // No fingerprints.
#define mShock 109 // Insulated hands.
#define mSmallsize 110 // Table climbing.
// disabilities
#define NEARSIGHTED 0x1
#define EPILEPSY 0x2
#define COUGHING 0x4
#define TOURETTES 0x8
#define NERVOUS 0x10
// sdisabilities
#define BLIND 0x1
#define MUTE 0x2
#define DEAF 0x4
// The way blocks are handled badly needs a rewrite, this is horrible.
// Too much of a project to handle at the moment, TODO for later.
var/BLINDBLOCK = 0
var/DEAFBLOCK = 0
var/HULKBLOCK = 0
var/TELEBLOCK = 0
var/FIREBLOCK = 0
var/XRAYBLOCK = 0
var/CLUMSYBLOCK = 0
var/FAKEBLOCK = 0
var/COUGHBLOCK = 0
var/GLASSESBLOCK = 0
var/EPILEPSYBLOCK = 0
var/TWITCHBLOCK = 0
var/NERVOUSBLOCK = 0
var/MONKEYBLOCK = STRUCDNASIZE
var/BLOCKADD = 0
var/DIFFMUT = 0
var/HEADACHEBLOCK = 0
var/NOBREATHBLOCK = 0
var/REMOTEVIEWBLOCK = 0
var/REGENERATEBLOCK = 0
var/INCREASERUNBLOCK = 0
var/REMOTETALKBLOCK = 0
var/MORPHBLOCK = 0
var/BLENDBLOCK = 0
var/HALLUCINATIONBLOCK = 0
var/NOPRINTSBLOCK = 0
var/SHOCKIMMUNITYBLOCK = 0
var/SMALLSIZEBLOCK = 0
+90
View File
@@ -0,0 +1,90 @@
#define GAME_STATE_PREGAME 1
#define GAME_STATE_SETTING_UP 2
#define GAME_STATE_PLAYING 3
#define GAME_STATE_FINISHED 4
// Security levels.
#define SEC_LEVEL_GREEN 0
#define SEC_LEVEL_BLUE 1
#define SEC_LEVEL_RED 2
#define SEC_LEVEL_DELTA 3
#define BE_PLANT "BE_PLANT"
#define BE_SYNTH "BE_SYNTH"
#define BE_PAI "BE_PAI"
// Antagonist datum flags.
#define ANTAG_OVERRIDE_JOB 0x1 // Assigned job is set to MODE when spawning.
#define ANTAG_OVERRIDE_MOB 0x2 // Mob is recreated from datum mob_type var when spawning.
#define ANTAG_CLEAR_EQUIPMENT 0x4 // All preexisting equipment is purged.
#define ANTAG_CHOOSE_NAME 0x8 // Antagonists are prompted to enter a name.
#define ANTAG_IMPLANT_IMMUNE 0x10 // Cannot be loyalty implanted.
#define ANTAG_SUSPICIOUS 0x20 // Shows up on roundstart report.
#define ANTAG_HAS_LEADER 0x40 // Generates a leader antagonist.
#define ANTAG_HAS_NUKE 0x80 // Will spawn a nuke at supplied location.
#define ANTAG_RANDSPAWN 0x100 // Potentially randomly spawns due to events.
#define ANTAG_VOTABLE 0x200 // Can be voted as an additional antagonist before roundstart.
#define ANTAG_SET_APPEARANCE 0x400 // Causes antagonists to use an appearance modifier on spawn.
// Mode/antag template macros.
#define MODE_BORER "borer"
#define MODE_XENOMORPH "xeno"
#define MODE_LOYALIST "loyalist"
#define MODE_MUTINEER "mutineer"
#define MODE_COMMANDO "commando"
#define MODE_DEATHSQUAD "deathsquad"
#define MODE_ERT "ert"
#define MODE_ACTOR "actor"
#define MODE_MERCENARY "mercenary"
#define MODE_NINJA "ninja"
#define MODE_RAIDER "raider"
#define MODE_WIZARD "wizard"
#define MODE_CHANGELING "changeling"
#define MODE_CULTIST "cultist"
#define MODE_HIGHLANDER "highlander"
#define MODE_MONKEY "monkey"
#define MODE_RENEGADE "renegade"
#define MODE_REVOLUTIONARY "revolutionary"
#define MODE_LOYALIST "loyalist"
#define MODE_MALFUNCTION "malf"
#define MODE_TRAITOR "traitor"
#define DEFAULT_TELECRYSTAL_AMOUNT 25
/////////////////
////WIZARD //////
/////////////////
/* WIZARD SPELL FLAGS */
#define GHOSTCAST 0x1 //can a ghost cast it?
#define NEEDSCLOTHES 0x2 //does it need the wizard garb to cast? Nonwizard spells should not have this
#define NEEDSHUMAN 0x4 //does it require the caster to be human?
#define Z2NOCAST 0x8 //if this is added, the spell can't be cast at centcomm
#define STATALLOWED 0x10 //if set, the user doesn't have to be conscious to cast. Required for ghost spells
#define IGNOREPREV 0x20 //if set, each new target does not overlap with the previous one
//The following flags only affect different types of spell, and therefore overlap
//Targeted spells
#define INCLUDEUSER 0x40 //does the spell include the caster in its target selection?
#define SELECTABLE 0x80 //can you select each target for the spell?
//AOE spells
#define IGNOREDENSE 0x40 //are dense turfs ignored in selection?
#define IGNORESPACE 0x80 //are space turfs ignored in selection?
//End split flags
#define CONSTRUCT_CHECK 0x100 //used by construct spells - checks for nullrods
#define NO_BUTTON 0x200 //spell won't show up in the HUD with this
//invocation
#define SpI_SHOUT "shout"
#define SpI_WHISPER "whisper"
#define SpI_EMOTE "emote"
#define SpI_NONE "none"
//upgrading
#define Sp_SPEED "speed"
#define Sp_POWER "power"
#define Sp_TOTAL "total"
//casting costs
#define Sp_RECHARGE "recharge"
#define Sp_CHARGES "charges"
#define Sp_HOLDVAR "holdervar"
+179
View File
@@ -0,0 +1,179 @@
#define HUMAN_STRIP_DELAY 40 // Takes 40ds = 4s to strip someone.
#define SHOES_SLOWDOWN -1.0 // How much shoes slow you down by default. Negative values speed you up.
#define CANDLE_LUM 3 // For how bright candles are.
// Item inventory slot bitmasks.
#define SLOT_OCLOTHING 0x1
#define SLOT_ICLOTHING 0x2
#define SLOT_GLOVES 0x4
#define SLOT_EYES 0x8
#define SLOT_EARS 0x10
#define SLOT_MASK 0x20
#define SLOT_HEAD 0x40
#define SLOT_FEET 0x80
#define SLOT_ID 0x100
#define SLOT_BELT 0x200
#define SLOT_BACK 0x400
#define SLOT_POCKET 0x800 // This is to allow items with a w_class of 3 or 4 to fit in pockets.
#define SLOT_DENYPOCKET 0x1000 // This is to deny items with a w_class of 2 or 1 from fitting in pockets.
#define SLOT_TWOEARS 0x2000
#define SLOT_TIE 0x4000
#define SLOT_HOLSTER 0x8000 //16th bit - higher than this will overflow
// Flags bitmasks.
#define NOBLUDGEON 0x1 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler.
#define CONDUCT 0x2 // Conducts electricity. (metal etc.)
#define ON_BORDER 0x4 // Item has priority to check when entering or leaving.
#define NOBLOODY 0x8 // Used for items if they don't want to get a blood overlay.
#define OPENCONTAINER 0x10 // Is an open container for chemistry purposes.
#define PHORONGUARD 0x20 // Does not get contaminated by phoron.
#define NOREACT 0x40 // Reagents don't react inside this container.
#define PROXMOVE 0x80 // Does this object require proximity checking in Enter()?
//Flags for items (equipment)
#define THICKMATERIAL 0x1 // Prevents syringes, parapens and hyposprays if equiped to slot_suit or slot_head.
#define STOPPRESSUREDAMAGE 0x2 // Counts towards pressure protection. Note that like temperature protection, body_parts_covered is considered here as well.
#define AIRTIGHT 0x4 // Functions with internals.
#define NOSLIP 0x8 // Prevents from slipping on wet floors, in space, etc.
#define BLOCK_GAS_SMOKE_EFFECT 0x10 // Blocks the effect that chemical clouds would have on a mob -- glasses, mask and helmets ONLY! (NOTE: flag shared with ONESIZEFITSALL)
#define FLEXIBLEMATERIAL 0x20 // At the moment, masks with this flag will not prevent eating even if they are covering your face.
// Flags for pass_flags.
#define PASSTABLE 0x1
#define PASSGLASS 0x2
#define PASSGRILLE 0x4
// Bitmasks for the flags_inv variable. These determine when a piece of clothing hides another, i.e. a helmet hiding glasses.
// WARNING: The following flags apply only to the external suit!
#define HIDEGLOVES 0x1
#define HIDESUITSTORAGE 0x2
#define HIDEJUMPSUIT 0x4
#define HIDESHOES 0x8
#define HIDETAIL 0x10
// WARNING: The following flags apply only to the helmets and masks!
#define HIDEMASK 0x1
#define HIDEEARS 0x2 // Headsets and such.
#define HIDEEYES 0x4 // Glasses.
#define HIDEFACE 0x8 // Dictates whether we appear as "Unknown".
#define BLOCKHEADHAIR 0x20 // Hides the user's hair overlay. Leaves facial hair.
#define BLOCKHAIR 0x40 // Hides the user's hair, facial and otherwise.
// Slots.
#define slot_back 1
#define slot_wear_mask 2
#define slot_handcuffed 3
#define slot_l_hand 4
#define slot_r_hand 5
#define slot_belt 6
#define slot_wear_id 7
#define slot_l_ear 8
#define slot_glasses 9
#define slot_gloves 10
#define slot_head 11
#define slot_shoes 12
#define slot_wear_suit 13
#define slot_w_uniform 14
#define slot_l_store 15
#define slot_r_store 16
#define slot_s_store 17
#define slot_in_backpack 18
#define slot_legcuffed 19
#define slot_r_ear 20
#define slot_legs 21
#define slot_tie 22
// Inventory slot strings.
// since numbers cannot be used as associative list keys.
//icon_back, icon_l_hand, etc would be much better names for these...
#define slot_back_str "slot_back"
#define slot_l_hand_str "slot_l_hand"
#define slot_r_hand_str "slot_r_hand"
#define slot_w_uniform_str "slot_w_uniform"
#define slot_head_str "slot_head"
#define slot_wear_suit_str "slot_suit"
// Bitflags for clothing parts.
#define HEAD 0x1
#define FACE 0x2
#define EYES 0x4
#define UPPER_TORSO 0x8
#define LOWER_TORSO 0x10
#define LEG_LEFT 0x20
#define LEG_RIGHT 0x40
#define LEGS 0x60 // LEG_LEFT | LEG_RIGHT
#define FOOT_LEFT 0x80
#define FOOT_RIGHT 0x100
#define FEET 0x180 // FOOT_LEFT | FOOT_RIGHT
#define ARM_LEFT 0x200
#define ARM_RIGHT 0x400
#define ARMS 0x600 // ARM_LEFT | ARM_RIGHT
#define HAND_LEFT 0x800
#define HAND_RIGHT 0x1000
#define HANDS 0x1800 // HAND_LEFT | HAND_RIGHT
#define FULL_BODY 0xFFFF
// Bitflags for the percentual amount of protection a piece of clothing which covers the body part offers.
// Used with human/proc/get_heat_protection() and human/proc/get_cold_protection().
// The values here should add up to 1, e.g., the head has 30% protection.
#define THERMAL_PROTECTION_HEAD 0.3
#define THERMAL_PROTECTION_UPPER_TORSO 0.15
#define THERMAL_PROTECTION_LOWER_TORSO 0.15
#define THERMAL_PROTECTION_LEG_LEFT 0.075
#define THERMAL_PROTECTION_LEG_RIGHT 0.075
#define THERMAL_PROTECTION_FOOT_LEFT 0.025
#define THERMAL_PROTECTION_FOOT_RIGHT 0.025
#define THERMAL_PROTECTION_ARM_LEFT 0.075
#define THERMAL_PROTECTION_ARM_RIGHT 0.075
#define THERMAL_PROTECTION_HAND_LEFT 0.025
#define THERMAL_PROTECTION_HAND_RIGHT 0.025
// Pressure limits.
#define HAZARD_HIGH_PRESSURE 550 // This determines at what pressure the ultra-high pressure red icon is displayed. (This one is set as a constant)
#define WARNING_HIGH_PRESSURE 325 // This determines when the orange pressure icon is displayed (it is 0.7 * HAZARD_HIGH_PRESSURE)
#define WARNING_LOW_PRESSURE 50 // This is when the gray low pressure icon is displayed. (it is 2.5 * HAZARD_LOW_PRESSURE)
#define HAZARD_LOW_PRESSURE 20 // This is when the black ultra-low pressure icon is displayed. (This one is set as a constant)
#define TEMPERATURE_DAMAGE_COEFFICIENT 1.5 // This is used in handle_temperature_damage() for humans, and in reagents that affect body temperature. Temperature damage is multiplied by this amount.
#define BODYTEMP_AUTORECOVERY_DIVISOR 12 // This is the divisor which handles how much of the temperature difference between the current body temperature and 310.15K (optimal temperature) humans auto-regenerate each tick. The higher the number, the slower the recovery. This is applied each tick, so long as the mob is alive.
#define BODYTEMP_AUTORECOVERY_MINIMUM 1 // Minimum amount of kelvin moved toward 310.15K per tick. So long as abs(310.15 - bodytemp) is more than 50.
#define BODYTEMP_COLD_DIVISOR 6 // Similar to the BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is lower than their body temperature. Make it lower to lose bodytemp faster.
#define BODYTEMP_HEAT_DIVISOR 6 // Similar to the BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is higher than their body temperature. Make it lower to gain bodytemp faster.
#define BODYTEMP_COOLING_MAX -30 // The maximum number of degrees that your body can cool down in 1 tick, when in a cold area.
#define BODYTEMP_HEATING_MAX 30 // The maximum number of degrees that your body can heat up in 1 tick, when in a hot area.
#define BODYTEMP_HEAT_DAMAGE_LIMIT 360.15 // The limit the human body can take before it starts taking damage from heat.
#define BODYTEMP_COLD_DAMAGE_LIMIT 260.15 // The limit the human body can take before it starts taking damage from coldness.
#define SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE 2.0 // What min_cold_protection_temperature is set to for space-helmet quality headwear. MUST NOT BE 0.
#define SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE 2.0 // What min_cold_protection_temperature is set to for space-suit quality jumpsuits or suits. MUST NOT BE 0.
#define HELMET_MIN_COLD_PROTECTION_TEMPERATURE 160 // For normal helmets.
#define ARMOR_MIN_COLD_PROTECTION_TEMPERATURE 160 // For armor.
#define GLOVES_MIN_COLD_PROTECTION_TEMPERATURE 2.0 // For some gloves.
#define SHOE_MIN_COLD_PROTECTION_TEMPERATURE 2.0 // For shoes.
#define SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE 5000 // These need better heat protect, but not as good heat protect as firesuits.
#define FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE 30000 // What max_heat_protection_temperature is set to for firesuit quality headwear. MUST NOT BE 0.
#define FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE 30000 // For fire-helmet quality items. (Red and white hardhats)
#define HELMET_MAX_HEAT_PROTECTION_TEMPERATURE 600 // For normal helmets.
#define ARMOR_MAX_HEAT_PROTECTION_TEMPERATURE 600 // For armor.
#define GLOVES_MAX_HEAT_PROTECTION_TEMPERATURE 1500 // For some gloves.
#define SHOE_MAX_HEAT_PROTECTION_TEMPERATURE 1500 // For shoes.
// Fire.
#define FIRE_MIN_STACKS -20
#define FIRE_MAX_STACKS 25
#define FIRE_MAX_FIRESUIT_STACKS 20 // If the number of stacks goes above this firesuits won't protect you anymore. If not, you can walk around while on fire like a badass.
#define THROWFORCE_SPEED_DIVISOR 5 // The throwing speed value at which the throwforce multiplier is exactly 1.
#define THROWNOBJ_KNOCKBACK_SPEED 15 // The minumum speed of a w_class 2 thrown object that will cause living mobs it hits to be knocked back. Heavier objects can cause knockback at lower speeds.
#define THROWNOBJ_KNOCKBACK_DIVISOR 2 // Affects how much speed the mob is knocked back with.
// Suit sensor levels
#define SUIT_SENSOR_OFF 0
#define SUIT_SENSOR_BINARY 1
#define SUIT_SENSOR_VITAL 2
#define SUIT_SENSOR_TRACKING 3
+6
View File
@@ -0,0 +1,6 @@
#define FOR_DVIEW(type, range, center, invis_flags) \
dview_mob.loc = center; \
dview_mob.see_invisible = invis_flags; \
for(type in view(range, dview_mob))
#define END_FOR_DVIEW dview_mob.loc = null
+97
View File
@@ -0,0 +1,97 @@
var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called manually after an event.
#define CELLRATE 0.002 // Multiplier for watts per tick <> cell storage (e.g., 0.02 means if there is a load of 1000 watts, 20 units will be taken from a cell per second)
// It's a conversion constant. power_used*CELLRATE = charge_provided, or charge_used/CELLRATE = power_provided
// Doors!
#define DOOR_CRUSH_DAMAGE 20
#define ALIEN_SELECT_AFK_BUFFER 1 // How many minutes that a person can be AFK before not being allowed to be an alien.
// Channel numbers for power.
#define EQUIP 1
#define LIGHT 2
#define ENVIRON 3
#define TOTAL 4 // For total power used only.
// Bitflags for machine stat variable.
#define BROKEN 0x1
#define NOPOWER 0x2
#define POWEROFF 0x4 // TBD.
#define MAINT 0x8 // Under maintenance.
#define EMPED 0x10 // Temporary broken by EMP pulse.
// Used by firelocks
#define FIREDOOR_OPEN 1
#define FIREDOOR_CLOSED 2
#define AI_CAMERA_LUMINOSITY 6
// Camera networks
#define NETWORK_CRESCENT "Crescent"
#define NETWORK_CIVILIAN_EAST "Civilian East"
#define NETWORK_CIVILIAN_WEST "Civilian West"
#define NETWORK_COMMAND "Command"
#define NETWORK_ENGINE "Engine"
#define NETWORK_ENGINEERING "Engineering"
#define NETWORK_ENGINEERING_OUTPOST "Engineering Outpost"
#define NETWORK_ERT "ZeEmergencyResponseTeam"
#define NETWORK_EXODUS "Exodus"
#define NETWORK_MEDICAL "Medical"
#define NETWORK_MERCENARY "MercurialNet"
#define NETWORK_MINE "MINE"
#define NETWORK_RESEARCH "Research"
#define NETWORK_RESEARCH_OUTPOST "Research Outpost"
#define NETWORK_ROBOTS "Robots"
#define NETWORK_PRISON "Prison"
#define NETWORK_SECURITY "Security"
#define NETWORK_TELECOM "Tcomsat"
#define NETWORK_THUNDER "Thunderdome"
// Those networks can only be accessed by pre-existing terminals. AIs and new terminals can't use them.
var/list/restricted_camera_networks = list(NETWORK_ERT,NETWORK_MERCENARY,"Secret")
//singularity defines
#define STAGE_ONE 1
#define STAGE_TWO 3
#define STAGE_THREE 5
#define STAGE_FOUR 7
#define STAGE_FIVE 9
#define STAGE_SUPER 11
// computer3 error codes, move lower in the file when it passes dev -Sayu
#define PROG_CRASH 0x1 // Generic crash.
#define MISSING_PERIPHERAL 0x2 // Missing hardware.
#define BUSTED_ASS_COMPUTER 0x4 // Self-perpetuating error. BAC will continue to crash forever.
#define MISSING_PROGRAM 0x8 // Some files try to automatically launch a program. This is that failing.
#define FILE_DRM 0x10 // Some files want to not be copied/moved. This is them complaining that you tried.
#define NETWORK_FAILURE 0x20
// NanoUI flags
#define STATUS_INTERACTIVE 2 // GREEN Visability
#define STATUS_UPDATE 1 // ORANGE Visability
#define STATUS_DISABLED 0 // RED Visability
#define STATUS_CLOSE -1 // Close the interface
/*
* Atmospherics Machinery.
*/
#define MAX_SIPHON_FLOWRATE 2500 // L/s. This can be used to balance how fast a room is siphoned. Anything higher than CELL_VOLUME has no effect.
#define MAX_SCRUBBER_FLOWRATE 200 // L/s. Max flow rate when scrubbing from a turf.
// These balance how easy or hard it is to create huge pressure gradients with pumps and filters.
// Lower values means it takes longer to create large pressures differences.
// Has no effect on pumping gasses from high pressure to low, only from low to high.
#define ATMOS_PUMP_EFFICIENCY 2.5
#define ATMOS_FILTER_EFFICIENCY 2.5
// Will not bother pumping or filtering if the gas source as fewer than this amount of moles, to help with performance.
#define MINIMUM_MOLES_TO_PUMP 0.01
#define MINIMUM_MOLES_TO_FILTER 0.04
// The flow rate/effectiveness of various atmos devices is limited by their internal volume,
// so for many atmos devices these will control maximum flow rates in L/s.
#define ATMOS_DEFAULT_VOLUME_PUMP 200 // Liters.
#define ATMOS_DEFAULT_VOLUME_FILTER 200 // L.
#define ATMOS_DEFAULT_VOLUME_MIXER 200 // L.
#define ATMOS_DEFAULT_VOLUME_PIPE 70 // L.
+28
View File
@@ -0,0 +1,28 @@
// Math constants.
#define M_PI 3.14159265
#define R_IDEAL_GAS_EQUATION 8.31 // kPa*L/(K*mol).
#define ONE_ATMOSPHERE 101.325 // kPa.
#define IDEAL_GAS_ENTROPY_CONSTANT 1164 // (mol^3 * s^3) / (kg^3 * L).
// Radiation constants.
#define STEFAN_BOLTZMANN_CONSTANT 5.6704e-8 // W/(m^2*K^4).
#define COSMIC_RADIATION_TEMPERATURE 3.15 // K.
#define AVERAGE_SOLAR_RADIATION 200 // W/m^2. Kind of arbitrary. Really this should depend on the sun position much like solars.
#define RADIATOR_OPTIMUM_PRESSURE 3771 // kPa at 20 C. This should be higher as gases aren't great conductors until they are dense. Used the critical pressure for air.
#define GAS_CRITICAL_TEMPERATURE 132.65 // K. The critical point temperature for air.
#define RADIATOR_EXPOSED_SURFACE_AREA_RATIO 0.04 // (3 cm + 100 cm * sin(3deg))/(2*(3+100 cm)). Unitless ratio.
#define HUMAN_EXPOSED_SURFACE_AREA 5.2 //m^2, surface area of 1.7m (H) x 0.46m (D) cylinder
#define T0C 273.15 // 0.0 degrees celcius
#define T20C 293.15 // 20.0 degrees celcius
#define TCMB 2.7 // -270.3 degrees celcius
#define CLAMP01(x) max(0, min(1, x))
#define QUANTIZE(variable) (round(variable,0.0001))
#define INFINITY 1.#INF
#define TICKS_IN_DAY 24*60*60*10
#define TICKS_IN_SECOND 10
+211
View File
@@ -0,0 +1,211 @@
#define DEBUG
// Turf-only flags.
#define NOJAUNT 1 // This is used in literally one place, turf.dm, to block ethereal jaunt.
#define TRANSITIONEDGE 7 // Distance from edge to move to another z-level.
// Invisibility constants.
#define INVISIBILITY_LIGHTING 20
#define INVISIBILITY_LEVEL_ONE 35
#define INVISIBILITY_LEVEL_TWO 45
#define INVISIBILITY_OBSERVER 60
#define INVISIBILITY_EYE 61
#define SEE_INVISIBLE_LIVING 25
#define SEE_INVISIBLE_NOLIGHTING 15
#define SEE_INVISIBLE_LEVEL_ONE 35
#define SEE_INVISIBLE_LEVEL_TWO 45
#define SEE_INVISIBLE_CULT 60
#define SEE_INVISIBLE_OBSERVER 61
#define SEE_INVISIBLE_MINIMUM 5
#define INVISIBILITY_MAXIMUM 100
// Some arbitrary defines to be used by self-pruning global lists. (see master_controller)
#define PROCESS_KILL 26 // Used to trigger removal from a processing list.
// Age limits on a character.
#define AGE_MIN 17
#define AGE_MAX 85
#define MAX_GEAR_COST 5 // Used in chargen for accessory loadout limit.
// Preference toggles.
#define SOUND_ADMINHELP 0x1
#define SOUND_MIDI 0x2
#define SOUND_AMBIENCE 0x4
#define SOUND_LOBBY 0x8
#define CHAT_OOC 0x10
#define CHAT_DEAD 0x20
#define CHAT_GHOSTEARS 0x40
#define CHAT_GHOSTSIGHT 0x80
#define CHAT_PRAYER 0x100
#define CHAT_RADIO 0x200
#define CHAT_ATTACKLOGS 0x400
#define CHAT_DEBUGLOGS 0x800
#define CHAT_LOOC 0x1000
#define CHAT_GHOSTRADIO 0x2000
#define SHOW_TYPING 0x4000
#define CHAT_NOICONS 0x8000
#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_ATTACKLOGS|CHAT_LOOC)
// For secHUDs and medHUDs and variants. The number is the location of the image on the list hud_list of humans.
#define HEALTH_HUD 1 // A simple line rounding the mob's number health.
#define STATUS_HUD 2 // Alive, dead, diseased, etc.
#define ID_HUD 3 // The job asigned to your ID.
#define WANTED_HUD 4 // Wanted, released, paroled, security status.
#define IMPLOYAL_HUD 5 // Loyality implant.
#define IMPCHEM_HUD 6 // Chemical implant.
#define IMPTRACK_HUD 7 // Tracking implant.
#define SPECIALROLE_HUD 8 // AntagHUD image.
#define STATUS_HUD_OOC 9 // STATUS_HUD without virus DB check for someone being ill.
#define LIFE_HUD 10 // STATUS_HUD that only reports dead or alive
//some colors
#define COLOR_WHITE "#ffffff"
#define COLOR_SILVER "#c0c0c0"
#define COLOR_GRAY "#808080"
#define COLOR_BLACK "#000000"
#define COLOR_RED "#ff0000"
#define COLOR_RED_LIGHT "#ff3333"
#define COLOR_MAROON "#800000"
#define COLOR_YELLOW "#ffff00"
#define COLOR_OLIVE "#808000"
#define COLOR_LIME "#00ff00"
#define COLOR_GREEN "#008000"
#define COLOR_CYAN "#00ffff"
#define COLOR_TEAL "#008080"
#define COLOR_BLUE "#0000ff"
#define COLOR_BLUE_LIGHT "#33ccff"
#define COLOR_NAVY "#000080"
#define COLOR_PINK "#ff00ff"
#define COLOR_PURPLE "#800080"
#define COLOR_ORANGE "#ff9900"
#define COLOR_LUMINOL "#66ffff"
#define COLOR_BEIGE "#ceb689"
#define COLOR_BLUE_GRAY "#6a97b0"
#define COLOR_BROWN "#b19664"
#define COLOR_DARK_BROWN "#917448"
#define COLOR_DARK_ORANGE "#b95a00"
#define COLOR_GREEN_GRAY "#8daf6a"
#define COLOR_RED_GRAY "#aa5f61"
#define COLOR_PALE_BLUE_GRAY "#8bbbd5"
#define COLOR_PALE_GREEN_GRAY "#aed18b"
#define COLOR_PALE_RED_GRAY "#cc9090"
#define COLOR_PALE_PURPLE_GRAY "#bda2ba"
#define COLOR_PURPLE_GRAY "#a2819e"
#define COLOR_SUN "#ec8b2f"
// Shuttles.
// These define the time taken for the shuttle to get to the space station, and the time before it leaves again.
#define SHUTTLE_PREPTIME 300 // 5 minutes = 300 seconds - after this time, the shuttle departs centcom and cannot be recalled.
#define SHUTTLE_LEAVETIME 180 // 3 minutes = 180 seconds - the duration for which the shuttle will wait at the station after arriving.
#define SHUTTLE_TRANSIT_DURATION 300 // 5 minutes = 300 seconds - how long it takes for the shuttle to get to the station.
#define SHUTTLE_TRANSIT_DURATION_RETURN 120 // 2 minutes = 120 seconds - for some reason it takes less time to come back, go figure.
// Shuttle moving status.
#define SHUTTLE_IDLE 0
#define SHUTTLE_WARMUP 1
#define SHUTTLE_INTRANSIT 2
// Ferry shuttle processing status.
#define IDLE_STATE 0
#define WAIT_LAUNCH 1
#define FORCE_LAUNCH 2
#define WAIT_ARRIVE 3
#define WAIT_FINISH 4
// Setting this much higher than 1024 could allow spammers to DOS the server easily.
#define MAX_MESSAGE_LEN 1024
#define MAX_PAPER_MESSAGE_LEN 3072
#define MAX_BOOK_MESSAGE_LEN 9216
#define MAX_LNAME_LEN 64
#define MAX_NAME_LEN 26
// Event defines.
#define EVENT_LEVEL_MUNDANE 1
#define EVENT_LEVEL_MODERATE 2
#define EVENT_LEVEL_MAJOR 3
//General-purpose life speed define for plants.
#define HYDRO_SPEED_MULTIPLIER 1
#define DEFAULT_JOB_TYPE /datum/job/assistant
//Area flags, possibly more to come
#define RAD_SHIELDED 1 //shielded from radiation, clearly
// Custom layer definitions, supplementing the default TURF_LAYER, MOB_LAYER, etc.
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed
#define LIGHTING_LAYER 11
#define HUD_LAYER 20 //Above lighting, but below obfuscation. For in-game HUD effects (whereas SCREEN_LAYER is for abstract/OOC things like inventory slots)
#define OBFUSCATION_LAYER 21 //Where images covering the view for eyes are put
#define SCREEN_LAYER 22 //Mob HUD/effects layer
// Convoluted setup so defines can be supplied by Bay12 main server compile script.
// Should still work fine for people jamming the icons into their repo.
#ifndef CUSTOM_ITEM_OBJ
#define CUSTOM_ITEM_OBJ 'icons/obj/custom_items_obj.dmi'
#endif
#ifndef CUSTOM_ITEM_MOB
#define CUSTOM_ITEM_MOB 'icons/mob/custom_items_mob.dmi'
#endif
#ifndef CUSTOM_ITEM_SYNTH
#define CUSTOM_ITEM_SYNTH 'icons/mob/custom_synthetic.dmi'
#endif
#define WALL_CAN_OPEN 1
#define WALL_OPENING 2
#define DEFAULT_TABLE_MATERIAL "plastic"
#define DEFAULT_WALL_MATERIAL "steel"
#define SHARD_SHARD "shard"
#define SHARD_SHRAPNEL "shrapnel"
#define SHARD_STONE_PIECE "piece"
#define SHARD_SPLINTER "splinters"
#define SHARD_NONE ""
#define MATERIAL_UNMELTABLE 0x1
#define MATERIAL_BRITTLE 0x2
#define MATERIAL_PADDING 0x4
#define TABLE_BRITTLE_MATERIAL_MULTIPLIER 4 // Amount table damage is multiplied by if it is made of a brittle material (e.g. glass)
#define BOMBCAP_DVSTN_RADIUS (max_explosion_range/4)
#define BOMBCAP_HEAVY_RADIUS (max_explosion_range/2)
#define BOMBCAP_LIGHT_RADIUS max_explosion_range
#define BOMBCAP_FLASH_RADIUS (max_explosion_range*1.5)
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
#define NTNET_COMMUNICATION 3 // Communication (messaging)
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
// NTNet transfer speeds, used when downloading/uploading a file/program.
#define NTNETSPEED_LOWSIGNAL 0.025 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
#define NTNETSPEED_HIGHSIGNAL 0.1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
#define NTNETSPEED_ETHERNET 0.5 // GQ/s transfer speed when the device is using wired connection
// Program bitflags
#define PROGRAM_ALL 7
#define PROGRAM_CONSOLE 1
#define PROGRAM_LAPTOP 2
#define PROGRAM_TABLET 4
// Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
#define MAX_NTNET_LOGS 500
#define MIN_NTNET_LOGS 10
// Special return values from bullet_act(). Positive return values are already used to indicate the blocked level of the projectile.
#define PROJECTILE_CONTINUE -1 //if the projectile should continue flying after calling bullet_act()
#define PROJECTILE_FORCE_MISS -2 //if the projectile should treat the attack as a miss (suppresses attack and admin logs) - only applies to mobs.
//Camera capture modes
#define CAPTURE_MODE_REGULAR 0 //Regular polaroid camera mode
#define CAPTURE_MODE_ALL 1 //Admin camera mode
#define CAPTURE_MODE_PARTIAL 3 //Simular to regular mode, but does not do dummy check
+153
View File
@@ -0,0 +1,153 @@
// /mob/var/stat things.
#define CONSCIOUS 0
#define UNCONSCIOUS 1
#define DEAD 2
// Bitflags defining which status effects could be or are inflicted on a mob.
#define CANSTUN 0x1
#define CANWEAKEN 0x2
#define CANPARALYSE 0x4
#define CANPUSH 0x8
#define LEAPING 0x10
#define PASSEMOTES 0x32 // Mob has a cortical borer or holders inside of it that need to see emotes.
#define GODMODE 0x1000
#define FAKEDEATH 0x2000 // Replaces stuff like changeling.changeling_fakedeath.
#define DISFIGURED 0x4000 // Set but never checked. Remove this sometime and replace occurences with the appropriate organ code
#define XENO_HOST 0x8000 // Tracks whether we're gonna be a baby alien's mummy.
// Grab levels.
#define GRAB_PASSIVE 1
#define GRAB_AGGRESSIVE 2
#define GRAB_NECK 3
#define GRAB_UPGRADING 4
#define GRAB_KILL 5
#define BORGMESON 0x1
#define BORGTHERM 0x2
#define BORGXRAY 0x4
#define BORGMATERIAL 8
#define HOSTILE_STANCE_IDLE 1
#define HOSTILE_STANCE_ALERT 2
#define HOSTILE_STANCE_ATTACK 3
#define HOSTILE_STANCE_ATTACKING 4
#define HOSTILE_STANCE_TIRED 5
#define LEFT 1
#define RIGHT 2
// Pulse levels, very simplified.
#define PULSE_NONE 0 // So !M.pulse checks would be possible.
#define PULSE_SLOW 1 // <60 bpm
#define PULSE_NORM 2 // 60-90 bpm
#define PULSE_FAST 3 // 90-120 bpm
#define PULSE_2FAST 4 // >120 bpm
#define PULSE_THREADY 5 // Occurs during hypovolemic shock
#define GETPULSE_HAND 0 // Less accurate. (hand)
#define GETPULSE_TOOL 1 // More accurate. (med scanner, sleeper, etc.)
//intent flags, why wasn't this done the first time?
#define I_HELP "help"
#define I_DISARM "disarm"
#define I_GRAB "grab"
#define I_HURT "harm"
//These are used Bump() code for living mobs, in the mob_bump_flag, mob_swap_flags, and mob_push_flags vars to determine whom can bump/swap with whom.
#define HUMAN 1
#define MONKEY 2
#define ALIEN 4
#define ROBOT 8
#define SLIME 16
#define SIMPLE_ANIMAL 32
#define HEAVY 64
#define ALLMOBS (HUMAN|MONKEY|ALIEN|ROBOT|SLIME|SIMPLE_ANIMAL|HEAVY)
// Robot AI notifications
#define ROBOT_NOTIFICATION_NEW_UNIT 1
#define ROBOT_NOTIFICATION_NEW_NAME 2
#define ROBOT_NOTIFICATION_NEW_MODULE 3
#define ROBOT_NOTIFICATION_MODULE_RESET 4
// Appearance change flags
#define APPEARANCE_UPDATE_DNA 0x1
#define APPEARANCE_RACE (0x2|APPEARANCE_UPDATE_DNA)
#define APPEARANCE_GENDER (0x4|APPEARANCE_UPDATE_DNA)
#define APPEARANCE_SKIN 0x8
#define APPEARANCE_HAIR 0x10
#define APPEARANCE_HAIR_COLOR 0x20
#define APPEARANCE_FACIAL_HAIR 0x40
#define APPEARANCE_FACIAL_HAIR_COLOR 0x80
#define APPEARANCE_EYE_COLOR 0x100
#define APPEARANCE_ALL_HAIR (APPEARANCE_HAIR|APPEARANCE_HAIR_COLOR|APPEARANCE_FACIAL_HAIR|APPEARANCE_FACIAL_HAIR_COLOR)
#define APPEARANCE_ALL 0xFFFF
// Click cooldown
#define DEFAULT_ATTACK_COOLDOWN 8 //Default timeout for aggressive actions
#define DEFAULT_QUICK_COOLDOWN 4
#define MIN_SUPPLIED_LAW_NUMBER 15
#define MAX_SUPPLIED_LAW_NUMBER 50
//default item on-mob icons
#define INV_HEAD_DEF_ICON 'icons/mob/head.dmi'
#define INV_BACK_DEF_ICON 'icons/mob/back.dmi'
#define INV_L_HAND_DEF_ICON 'icons/mob/items/lefthand.dmi'
#define INV_R_HAND_DEF_ICON 'icons/mob/items/righthand.dmi'
#define INV_W_UNIFORM_DEF_ICON 'icons/mob/uniform.dmi'
#define INV_ACCESSORIES_DEF_ICON 'icons/mob/ties.dmi'
#define INV_SUIT_DEF_ICON 'icons/mob/ties.dmi'
#define INV_SUIT_DEF_ICON 'icons/mob/suit.dmi'
#define MAX_SUPPLIED_LAW_NUMBER 50
// NT's alignment towards the character
#define COMPANY_LOYAL "Loyal"
#define COMPANY_SUPPORTATIVE "Supportive"
#define COMPANY_NEUTRAL "Neutral"
#define COMPANY_SKEPTICAL "Skeptical"
#define COMPANY_OPPOSED "Opposed"
#define COMPANY_ALIGNMENTS list(COMPANY_LOYAL,COMPANY_SUPPORTATIVE,COMPANY_NEUTRAL,COMPANY_SKEPTICAL,COMPANY_OPPOSED)
// Defines mob sizes, used by lockers and to determine what is considered a small sized mob, etc.
#define MOB_LARGE 40
#define MOB_MEDIUM 20
#define MOB_SMALL 10
#define MOB_TINY 5
#define MOB_MINISCULE 1
// Gluttony levels.
#define GLUT_TINY 1 // Eat anything tiny and smaller
#define GLUT_SMALLER 2 // Eat anything smaller than we are
#define GLUT_ANYTHING 3 // Eat anything, ever
#define TINT_NONE 0
#define TINT_MODERATE 1
#define TINT_HEAVY 2
#define TINT_BLIND 3
#define FLASH_PROTECTION_REDUCED -1
#define FLASH_PROTECTION_NONE 0
#define FLASH_PROTECTION_MODERATE 1
#define FLASH_PROTECTION_MAJOR 2
#define ANIMAL_SPAWN_DELAY round(config.respawn_delay / 6)
#define DRONE_SPAWN_DELAY round(config.respawn_delay / 3)
#define ANIMAL_SPAWN_DELAY round(config.respawn_delay / 6)
#define DRONE_SPAWN_DELAY round(config.respawn_delay / 3)
// Incapacitation flags, used by the mob/proc/incapacitated() proc
#define INCAPACITATION_RESTRAINED 1
#define INCAPACITATION_BUCKLED_PARTIALLY 2
#define INCAPACITATION_BUCKLED_FULLY 4
#define INCAPACITATION_DISABLED 8
#define INCAPACITATION_DEFAULT (INCAPACITATION_RESTRAINED|INCAPACITATION_BUCKLED_FULLY|INCAPACITATION_DISABLED)
#define INCAPACITATION_ALL (INCAPACITATION_RESTRAINED|INCAPACITATION_BUCKLED_PARTIALLY|INCAPACITATION_BUCKLED_FULLY|INCAPACITATION_DISABLED)
#define MOB_PULL_NONE 0
#define MOB_PULL_SMALLER 1
#define MOB_PULL_SAME 2
#define MOB_PULL_LARGER 3
-19
View File
@@ -1,19 +0,0 @@
// Process status defines
#define PROCESS_STATUS_IDLE 1
#define PROCESS_STATUS_QUEUED 2
#define PROCESS_STATUS_RUNNING 3
#define PROCESS_STATUS_MAYBE_HUNG 4
#define PROCESS_STATUS_PROBABLY_HUNG 5
#define PROCESS_STATUS_HUNG 6
// Process time thresholds
#define PROCESS_DEFAULT_HANG_WARNING_TIME 900 // 90 seconds
#define PROCESS_DEFAULT_HANG_ALERT_TIME 1800 // 180 seconds
#define PROCESS_DEFAULT_HANG_RESTART_TIME 2400 // 240 seconds
#define PROCESS_DEFAULT_SCHEDULE_INTERVAL 50 // 50 ticks
#define PROCESS_DEFAULT_TICK_ALLOWANCE 20 // 20% of one tick
// SCHECK macros
// This references src directly to work around a weird bug with try/catch
#define SCHECK_EVERY(this_many_calls) if(++src.calls_since_last_scheck >= this_many_calls) sleepCheck()
#define SCHECK SCHECK_EVERY(50)
+18
View File
@@ -0,0 +1,18 @@
#define SHEET_MATERIAL_AMOUNT 2000
#define TECH_MATERIAL "materials"
#define TECH_ENGINEERING "engineering"
#define TECH_PHORON "phorontech"
#define TECH_POWER "powerstorage"
#define TECH_BLUESPACE "bluespace"
#define TECH_BIO "biotech"
#define TECH_COMBAT "combat"
#define TECH_MAGNET "magnets"
#define TECH_DATA "programming"
#define TECH_ILLEGAL "syndicate"
#define TECH_ARCANE "arcane"
#define IMPRINTER 0x1 //For circuits. Uses glass/chemicals.
#define PROTOLATHE 0x2 //New stuff. Uses glass/metal/chemicals
#define MECHFAB 0x4 //Mechfab
#define CHASSIS 0x8 //For protolathe, but differently
+46
View File
@@ -0,0 +1,46 @@
// Species flags.
#define NO_BLOOD 0x1 // Vessel var is not filled with blood, cannot bleed out.
#define NO_BREATHE 0x2 // Cannot suffocate or take oxygen loss.
#define NO_SCAN 0x4 // Cannot be scanned in a DNA machine/genome-stolen.
#define NO_PAIN 0x8 // Cannot suffer halloss/recieves deceptive health indicator.
#define NO_SLIP 0x10 // Cannot fall over.
#define NO_POISON 0x20 // Cannot not suffer toxloss.
#define IS_PLANT 0x40 // Is a treeperson.
#define NO_MINOR_CUT 0x80 // Can step on broken glass with no ill-effects. Either thick skin (diona/vox), cut resistant (slimes) or incorporeal (shadows)
// unused: 0x8000 - higher than this will overflow
// Species spawn flags
#define IS_WHITELISTED 0x1 // Must be whitelisted to play.
#define CAN_JOIN 0x2 // Species is selectable in chargen.
#define IS_RESTRICTED 0x4 // Is not a core/normally playable species. (castes, mutantraces)
// Species appearance flags
#define HAS_SKIN_TONE 0x1 // Skin tone selectable in chargen. (0-255)
#define HAS_SKIN_COLOR 0x2 // Skin colour selectable in chargen. (RGB)
#define HAS_LIPS 0x4 // Lips are drawn onto the mob icon. (lipstick)
#define HAS_UNDERWEAR 0x8 // Underwear is drawn onto the mob icon.
#define HAS_EYE_COLOR 0x10 // Eye colour selectable in chargen. (RGB)
#define HAS_HAIR_COLOR 0x20 // Hair colour selectable in chargen. (RGB)
// Languages.
#define LANGUAGE_EAL "Encoded Audio Language"
#define LANGUAGE_SOL_COMMON "Sol Common"
#define LANGUAGE_UNATHI "Sinta'unathi"
#define LANGUAGE_SIIK_MAAS "Siik'maas"
#define LANGUAGE_SIIK_TAJR "Siik'tajr"
#define LANGUAGE_SKRELLIAN "Skrellian"
#define LANGUAGE_RESOMI "Resomi"
#define LANGUAGE_ROOTSPEAK "Rootspeak"
#define LANGUAGE_TRADEBAND "Tradeband"
#define LANGUAGE_GUTTER "Gutter"
// Language flags.
#define WHITELISTED 1 // Language is available if the speaker is whitelisted.
#define RESTRICTED 2 // Language can only be acquired by spawning or an admin.
#define NONVERBAL 4 // Language has a significant non-verbal component. Speech is garbled without line-of-sight.
#define SIGNLANG 8 // Language is completely non-verbal. Speech is displayed through emotes for those who can understand.
#define HIVEMIND 16 // Broadcast to all mobs with this language.
#define NONGLOBAL 32 // Do not add to general languages list.
#define INNATE 64 // All mobs can be assumed to speak and understand this language. (audible emotes)
#define NO_TALK_MSG 128 // Do not show the "\The [speaker] talks into \the [radio]" message
#define NO_STUTTER 256 // No stuttering, slurring, or other speech problems
+4
View File
@@ -0,0 +1,4 @@
#define TARGET_CAN_MOVE 1
#define TARGET_CAN_RUN 2
#define TARGET_CAN_CLICK 4
#define TARGET_CAN_RADIO 8
+10
View File
@@ -0,0 +1,10 @@
#define TURF_REMOVE_CROWBAR 1
#define TURF_REMOVE_SCREWDRIVER 2
#define TURF_REMOVE_SHOVEL 4
#define TURF_REMOVE_WRENCH 8
#define TURF_CAN_BREAK 16
#define TURF_CAN_BURN 32
#define TURF_HAS_EDGES 64
#define TURF_HAS_CORNERS 128
#define TURF_IS_FRAGILE 256
#define TURF_ACID_IMMUNE 512
+10
View File
@@ -0,0 +1,10 @@
/*
*
* This file is used by Travis to indicate that Unit Tests are to be ran.
* Do not add anything but the UNIT_TEST definition here as it will be overwritten by Travis when running tests.
*
*
* Should you wish to edit set UNIT_TEST to 1 like so:
* #define UNIT_TEST 1
*/
#define UNIT_TEST 0
-7
View File
@@ -1,7 +0,0 @@
#define CE_STABLE "stable" // Inaprovaline
#define CE_ANTIBIOTIC "antibiotic" // Spaceacilin
#define CE_BLOODRESTORE "bloodrestore" // Iron/nutriment
#define CE_PAINKILLER "painkiller"
#define CE_ALCOHOL "alcohol" // Liver filtering
#define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage
#define CE_SPEEDBOOST "gofast" // Hyperzine
+21
View File
@@ -0,0 +1,21 @@
//Takes: Area type as text string or as typepath OR an instance of the area.
//Returns: A list of all turfs in areas of that type in the world.
/proc/get_area_turfs(var/areatype, var/list/predicates)
if(!areatype) return null
if(istext(areatype)) areatype = text2path(areatype)
if(isarea(areatype))
var/area/areatemp = areatype
areatype = areatemp.type
var/list/turfs = new/list()
for(var/areapath in typesof(areatype))
var/area/A = locate(areapath)
for(var/turf/T in A.contents)
if(!predicates || all_predicates_true(list(T), predicates))
turfs += T
return turfs
/proc/pick_area_turf(var/areatype, var/list/predicates)
var/list/turfs = get_area_turfs(areatype, predicates)
if(turfs && turfs.len)
return pick(turfs)
+47
View File
@@ -0,0 +1,47 @@
/obj/proc/analyze_gases(var/obj/A, var/mob/user)
if(src != A)
user.visible_message("<span class='notice'>\The [user] has used \an [src] on \the [A]</span>")
A.add_fingerprint(user)
var/list/result = A.atmosanalyze(user)
if(result && result.len)
user << "<span class='notice'>Results of the analysis[src == A ? "" : " of \the [A]"]</span>"
for(var/line in result)
user << "<span class='notice'>[line]</span>"
return 1
user << "<span class='warning'>Your [src] flashes a red light as it fails to analyze \the [A].</span>"
return 0
/proc/atmosanalyzer_scan(var/obj/target, var/datum/gas_mixture/mixture, var/mob/user)
var/pressure = mixture.return_pressure()
var/total_moles = mixture.total_moles
var/list/results = list()
if (total_moles>0)
results += "<span class='notice'>Pressure: [round(pressure,0.1)] kPa</span>"
for(var/mix in mixture.gas)
results += "<span class='notice'>[gas_data.name[mix]]: [round((mixture.gas[mix] / total_moles) * 100)]%</span>"
results += "<span class='notice'>Temperature: [round(mixture.temperature-T0C)]&deg;C</span>"
else
results += "<span class='notice'>\The [target] is empty!</span>"
return results
/obj/proc/atmosanalyze(var/mob/user)
return
/obj/item/weapon/tank/atmosanalyze(var/mob/user)
return atmosanalyzer_scan(src, src.air_contents, user)
/obj/machinery/portable_atmospherics/atmosanalyze(var/mob/user)
return atmosanalyzer_scan(src, src.air_contents, user)
/obj/machinery/atmospherics/pipe/atmosanalyze(var/mob/user)
return atmosanalyzer_scan(src, src.parent.air, user)
/obj/machinery/power/rad_collector/atmosanalyze(var/mob/user)
if(P) return atmosanalyzer_scan(src, src.P.air_contents, user)
/obj/item/weapon/flamethrower/atmosanalyze(var/mob/user)
if(ptank) return atmosanalyzer_scan(src, ptank.air_contents, user)
@@ -94,17 +94,32 @@ var/global/list/GlobalPool = list()
loc = args
..()
/datum/proc/ResetVars(var/list/exlude = list())
var/list/excluded = list("animate_movement", "loc", "locs", "parent_type", "vars", "verbs", "type") + exlude
var/list/excluded_vars = list("animate_movement", "contents", "loc", "locs", "parent_type", "vars", "verbs", "type")
var/list/pooledvariables = list()
//thanks to clusterfack @ /vg/station for these two procs
/datum/proc/createVariables(var/list/excluded)
pooledvariables[type] = new/list()
var/list/all_excluded = excluded_vars + excluded
for(var/V in vars)
if(V in excluded)
for(var/key in vars)
if(key in all_excluded)
continue
pooledvariables[type][key] = initial(vars[key])
vars[V] = initial(vars[V])
/datum/proc/ResetVars(var/list/excluded = list())
if(!pooledvariables[type])
createVariables(excluded)
for(var/key in pooledvariables[type])
vars[key] = pooledvariables[type][key]
/atom/movable/ResetVars()
..()
vars["loc"] = null
loc = null
contents = initial(contents) //something is really wrong if this object still has stuff in it by this point
/image/ResetVars()
..()
loc = null
#undef ATOM_POOL_COUNT
+24
View File
@@ -0,0 +1,24 @@
/proc/all_predicates_true(var/list/input, var/list/predicates)
functional_sanity(input, predicates)
for(var/i = 1 to predicates.len)
if(!call(predicates[i])(arglist(input)))
return FALSE
return TRUE
/proc/any_predicate_true(var/list/input, var/list/predicates)
functional_sanity(input, predicates)
if(!predicates.len)
return TRUE
for(var/i = 1 to predicates.len)
if(call(predicates[i])(arglist(input)))
return TRUE
return FALSE
/proc/functional_sanity(var/list/input, var/list/predicates)
if(!istype(input))
CRASH("Expected list input. Was [input ? "[input.type]" : "null"]")
if(!istype(predicates))
CRASH("Expected predicate list. Was [predicates ? "[predicates.type]" : "null"]")
@@ -156,37 +156,35 @@
// It will keep doing this until it checks every content possible. This will fix any problems with mobs, that are inside objects,
// being unable to hear people due to being in a box within a bag.
/proc/recursive_mob_check(var/atom/O, var/list/L = list(), var/recursion_limit = 3, var/client_check = 1, var/sight_check = 1, var/include_radio = 1)
/proc/recursive_content_check(var/atom/O, var/list/L = list(), var/recursion_limit = 3, var/client_check = 1, var/sight_check = 1, var/include_mobs = 1, var/include_objects = 1)
//debug_mob += O.contents.len
if(!recursion_limit)
return L
for(var/atom/A in O.contents)
if(ismob(A))
var/mob/M = A
if(client_check && !M.client)
L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
continue
if(sight_check && !isInSight(A, O))
continue
L |= M
//world.log << "[recursion_limit] = [M] - [get_turf(M)] - ([M.x], [M.y], [M.z])"
for(var/I in O.contents)
else if(include_radio && istype(A, /obj/item/device/radio))
if(sight_check && !isInSight(A, O))
continue
L |= A
if(ismob(I))
if(!sight_check || isInSight(I, O))
L |= recursive_content_check(I, L, recursion_limit - 1, client_check, sight_check, include_mobs, include_objects)
if(include_mobs)
if(client_check)
var/mob/M = I
if(M.client)
L |= M
else
L |= I
else if(istype(I,/obj/))
if(!sight_check || isInSight(I, O))
L |= recursive_content_check(I, L, recursion_limit - 1, client_check, sight_check, include_mobs, include_objects)
if(include_objects)
L |= I
if(isobj(A) || ismob(A))
L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
return L
// The old system would loop through lists for a total of 5000 per function call, in an empty server.
// This new system will loop at around 1000 in an empty server.
// Returns a list of mobs and/or objects in range of R from source. Used in radio and say code.
/proc/get_mobs_in_view(var/R, var/atom/source)
// Returns a list of mobs in range of R from source. Used in radio and say code.
/proc/get_mobs_or_objects_in_view(var/R, var/atom/source, var/include_mobs = 1, var/include_objects = 1)
var/turf/T = get_turf(source)
var/list/hear = list()
@@ -196,17 +194,17 @@
var/list/range = hear(R, T)
for(var/atom/A in range)
if(ismob(A))
var/mob/M = A
if(M.client)
hear += M
//world.log << "Start = [M] - [get_turf(M)] - ([M.x], [M.y], [M.z])"
else if(istype(A, /obj/item/device/radio))
hear += A
if(isobj(A) || ismob(A))
hear |= recursive_mob_check(A, hear, 3, 1, 0, 1)
for(var/I in range)
if(ismob(I))
hear |= recursive_content_check(I, hear, 3, 1, 0, include_mobs, include_objects)
if(include_mobs)
var/mob/M = I
if(M.client)
hear += M
else if(istype(I,/obj/))
hear |= recursive_content_check(I, hear, 3, 1, 0, include_mobs, include_objects)
if(include_objects)
hear += I
return hear
@@ -332,12 +330,11 @@ proc/isInSight(var/atom/A, var/atom/B)
// Same as above but for alien candidates.
/proc/get_alien_candidates()
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
var/i = 0
while(candidates.len <= 0 && i < 5)
for(var/mob/dead/observer/G in player_list)
if(G.client.prefs.be_special & BE_ALIEN)
if(MODE_XENOMORPH in G.client.prefs.be_special_role)
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
@@ -362,6 +359,13 @@ proc/isInSight(var/atom/A, var/atom/B)
for(var/client/C in group)
C.screen -= O
/proc/flick_overlay(image/I, list/show_to, duration)
for(var/client/C in show_to)
C.images += I
spawn(duration)
for(var/client/C in show_to)
C.images -= I
datum/projectile_data
var/src_x
var/src_y
@@ -524,3 +528,6 @@ datum/projectile_data
/proc/SecondsToTicks(var/seconds)
return seconds * 10
/proc/round_is_spooky(var/spookiness_threshold = config.cult_ghostwriter_req_cultists)
return (cult.current_antagonists.len > spookiness_threshold)
@@ -64,6 +64,8 @@ var/global/list/rune_list = new()
var/global/list/escape_list = list()
var/global/list/endgame_exits = list()
var/global/list/endgame_safespawns = list()
var/global/list/syndicate_access = list(access_maint_tunnels, access_syndicate, access_external_airlocks)
//////////////////////////
/////Initial Building/////
//////////////////////////
@@ -118,9 +120,7 @@ var/global/list/endgame_safespawns = list()
for (var/language_name in all_languages)
var/datum/language/L = all_languages[language_name]
if(!(L.flags & NONGLOBAL))
language_keys[":[lowertext(L.key)]"] = L
language_keys[".[lowertext(L.key)]"] = L
language_keys["#[lowertext(L.key)]"] = L
language_keys[lowertext(L.key)] = L
var/rkey = 0
paths = typesof(/datum/species)-/datum/species
@@ -130,9 +130,9 @@ var/global/list/endgame_safespawns = list()
S.race_key = rkey //Used in mob icon caching.
all_species[S.name] = S
if(!(S.flags & IS_RESTRICTED))
if(!(S.spawn_flags & IS_RESTRICTED))
playable_species += S.name
if(S.flags & IS_WHITELISTED)
if(S.spawn_flags & IS_WHITELISTED)
whitelisted_species += S.name
//Posters
@@ -635,7 +635,7 @@ The _flatIcons list is a cache for generated icon files.
*/
proc // Creates a single icon from a given /atom or /image. Only the first argument is required.
getFlatIcon(image/A, defdir=2, deficon=null, defstate="", defblend=BLEND_DEFAULT)
getFlatIcon(image/A, defdir=2, deficon=null, defstate="", defblend=BLEND_DEFAULT, always_use_defdir = 0)
// We start with a blank canvas, otherwise some icon procs crash silently
var/icon/flat = icon('icons/effects/effects.dmi', "icon_state"="nothing") // Final flattened icon
if(!A)
@@ -666,7 +666,7 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu
noIcon = TRUE // Do not render this object.
var/curdir
if(A.dir != 2)
if(A.dir != 2 && !always_use_defdir)
curdir = A.dir
else
curdir = defdir
@@ -760,7 +760,11 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu
// Pull the default direction.
add = icon(I:icon, I:icon_state)
else // 'I' is an appearance object.
add = getFlatIcon(new/image(I), curdir, curicon, curstate, curblend)
if(istype(A,/obj/machinery/atmospherics) && I in A.underlays)
var/image/Im = I
add = getFlatIcon(new/image(I), Im.dir, curicon, curstate, curblend, 1)
else
add = getFlatIcon(new/image(I), curdir, curicon, curstate, curblend, always_use_defdir)
// Find the new dimensions of the flat icon to fit the added overlay
addX1 = min(flatX1, I:pixel_x+1)
@@ -773,9 +777,15 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu
flat.Crop(addX1-flatX1+1, addY1-flatY1+1, addX2-flatX1+1, addY2-flatY1+1)
flatX1=addX1;flatX2=addX2
flatY1=addY1;flatY2=addY2
var/iconmode
if(I in A.overlays)
iconmode = ICON_OVERLAY
else if(I in A.underlays)
iconmode = ICON_UNDERLAY
else
iconmode = blendMode2iconMode(curblend)
// Blend the overlay into the flattened icon
flat.Blend(add, blendMode2iconMode(curblend), I:pixel_x + 2 - flatX1, I:pixel_y + 2 - flatY1)
flat.Blend(add, iconmode, I:pixel_x + 2 - flatX1, I:pixel_y + 2 - flatY1)
if(A.color)
flat.Blend(A.color, ICON_MULTIPLY)
@@ -853,3 +863,53 @@ proc/sort_atoms_by_layer(var/list/atoms)
result.Swap(i, gap + i)
swapped = 1
return result
/*
generate_image function generates image of specified range and location
arguments tx, ty, tz are target coordinates (requred), range defines render distance to opposite corner (requred)
cap_mode is capturing mode (optional), user is capturing mob (requred only wehen cap_mode = CAPTURE_MODE_REGULAR),
lighting determines lighting capturing (optional), suppress_errors suppreses errors and continues to capture (optional).
*/
proc/generate_image(var/tx as num, var/ty as num, var/tz as num, var/range as num, var/cap_mode = CAPTURE_MODE_PARTIAL, var/mob/living/user, var/lighting = 1, var/suppress_errors = 1)
var/list/turfstocapture = list()
//Lines below determine what tiles will be rendered
for(var/xoff = 0 to range)
for(var/yoff = 0 to range)
var/turf/T = locate(tx + xoff,ty + yoff,tz)
if(T)
if(cap_mode == CAPTURE_MODE_REGULAR)
if(user.can_capture_turf(T))
turfstocapture.Add(T)
continue
else
turfstocapture.Add(T)
else
//Capture includes non-existan turfs
if(!suppress_errors)
return
//Lines below determine what objects will be rendered
var/list/atoms = list()
for(var/turf/T in turfstocapture)
atoms.Add(T)
for(var/atom/A in T)
if(istype(A, /atom/movable/lighting_overlay) && lighting) //Special case for lighting
atoms.Add(A)
continue
if(A.invisibility) continue
atoms.Add(A)
//Lines below actually render all colected data
atoms = sort_atoms_by_layer(atoms)
var/icon/cap = icon('icons/effects/96x96.dmi', "")
cap.Scale(range*32, range*32)
cap.Blend("#000", ICON_OVERLAY)
for(var/atom/A in atoms)
if(A)
var/icon/img = getFlatIcon(A)
if(istype(img, /icon))
if(istype(A, /mob/living) && A:lying)
img.BecomeLying()
var/xoff = (A.x - tx) * 32
var/yoff = (A.y - ty) * 32
cap.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff)
return cap
@@ -598,7 +598,7 @@ proc/dd_sortedTextList(list/incoming)
return dd_sortedtextlist(incoming, case_sensitive)
datum/proc/dd_SortValue()
/datum/proc/dd_SortValue()
return "[src]"
/obj/machinery/dd_SortValue()
@@ -620,3 +620,5 @@ datum/proc/dd_SortValue()
for(var/path in subtypesof(prototype))
L += new path()
return L
#define listequal(A, B) (A.len == B.len && !length(A^B))
@@ -90,6 +90,9 @@
/proc/log_misc(text)
game_log("MISC", text)
/proc/log_unit_test(text)
world.log << "## UNIT_TEST ##: [text]"
//pretty print a direction bitflag, can be useful for debugging.
/proc/print_dir(var/dir)
var/list/comps = list()
@@ -122,3 +122,9 @@
/proc/norm(x, y)
return sqrt(squaredNorm(x, y))
/proc/IsPowerOfTwo(var/val)
return (val & (val-1)) == 0
/proc/RoundUpToPowerOfTwo(var/val)
return 2 ** -round(-log(2,val))
+17
View File
@@ -0,0 +1,17 @@
/matrix/proc/TurnTo(old_angle, new_angle)
. = new_angle - old_angle
Turn(.) //BYOND handles cases such as -270, 360, 540 etc. DOES NOT HANDLE 180 TURNS WELL, THEY TWEEN AND LOOK LIKE SHIT
/atom/proc/SpinAnimation(speed = 10, loops = -1)
var/matrix/m120 = matrix(transform)
m120.Turn(120)
var/matrix/m240 = matrix(transform)
m240.Turn(240)
var/matrix/m360 = matrix(transform)
speed /= 3 //Gives us 3 equal time segments for our three turns.
//Why not one turn? Because byond will see that the start and finish are the same place and do nothing
//Why not two turns? Because byond will do a flip instead of a turn
animate(src, transform = m120, time = speed, loops)
animate(transform = m240, time = speed)
animate(transform = m360, time = speed)
@@ -1,3 +1,28 @@
/atom/movable/proc/get_mob()
return
/obj/machinery/bot/mulebot/get_mob()
if(load && istype(load,/mob/living))
return load
/obj/mecha/get_mob()
return occupant
/obj/vehicle/train/get_mob()
return buckled_mob
/mob/get_mob()
return src
/proc/mobs_in_view(var/range, var/source)
var/list/mobs = list()
for(var/atom/movable/AM in view(range, source))
var/M = AM.get_mob()
if(M)
mobs += M
return mobs
proc/random_hair_style(gender, species = "Human")
var/h_style = "Bald"
@@ -37,13 +62,20 @@ proc/random_facial_hair_style(gender, species = "Human")
return f_style
proc/sanitize_name(name, species = "Human")
var/datum/species/current_species
if(species)
current_species = all_species[species]
return current_species ? current_species.sanitize_name(name) : sanitizeName(name)
proc/random_name(gender, species = "Human")
var/datum/species/current_species
if(species)
current_species = all_species[species]
if(!current_species || current_species.name == "Human")
if(!current_species || current_species.name_language == null)
if(gender==FEMALE)
return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
else
@@ -137,7 +169,7 @@ Proc for attack log creation, because really why not
/proc/get_exposed_defense_zone(var/atom/movable/target)
var/obj/item/weapon/grab/G = locate() in target
if (G && G.state >= GRAB_NECK)
if(G && G.state >= GRAB_NECK) //works because mobs are currently not allowed to upgrade to NECK if they are grabbing two people.
return pick("head", "l_hand", "r_hand", "l_foot", "r_foot", "l_arm", "r_arm", "l_leg", "r_leg")
else
return pick("chest", "groin")
@@ -20,7 +20,7 @@ var/command_name = null
if (command_name)
return command_name
var/name = "Central Command"
var/name = "[boss_name]"
command_name = name
return name
@@ -165,7 +165,7 @@ var/syndicate_code_response//Code response for traitors.
Obviously, some people will be better at this than others but in theory, everyone should be able to do it and it only enhances roleplay.
Can probably be done through "{ }" but I don't really see the practical benefit.
One example of an earlier system is commented below.
/N
-N
*/
/proc/generate_code_phrase()//Proc is used for phrase and response in master_controller.dm
+86
View File
@@ -0,0 +1,86 @@
//-------------------------------
/*
Spawn sync helper
Helps syncronize spawn()ing multiple processes in loops.
Example for using this:
//Create new spawn_sync datum
var/datum/spawn_sync/sync = new()
for(var/obj/O in list)
//Call start_worker(), passing it first the object, then a string of the name of the proc you want called, then
// any and all arguments you want passed to the proc.
sync.start_worker(O, "do_something", arg1, arg2)
//Finally call wait_until_done()
sync.wait_until_done()
//Once all the workers have completed, or the failsafe has triggered, the code will continue. By default the
// failsafe is roughly 10 seconds (100 checks).
*/
//-------------------------------
/datum/spawn_sync
var/count = 1
var/failsafe = 100 //how many checks before the failsafe triggers and the helper stops waiting
//Opens a thread counter
/datum/spawn_sync/proc/open()
count++
//Closes a thread counter
/datum/spawn_sync/proc/close()
count--
//Finalizes the spawn sync by removing the original starting count
/datum/spawn_sync/proc/finalize()
close()
//Resets the counter if you want to utilize the same datum multiple times
// Optional: pass the number of checks you want for the failsafe
/datum/spawn_sync/proc/reset(var/safety = 100)
count = 1
failsafe = safety
//Check if all threads have returned
// Returns 0 if not all threads have completed
// Returns 1 if all threads have completed
/datum/spawn_sync/proc/check()
safety_check()
return count > 0 ? 1 : 0
//Failsafe in case something breaks horribly
/datum/spawn_sync/proc/safety_check()
failsafe--
if(failsafe < 1)
count = 0
//Set failsafe check count in case you need more time for the workers to return
/datum/spawn_sync/proc/set_failsafe(var/safety)
failsafe = safety
/datum/spawn_sync/proc/start_worker()
//Extract the thread run proc and it's arguments from the variadic args list.
ASSERT(args.len > 0)
var/obj = args[1]
var/thread_proc = args[2]
//dispatch a new thread
open()
spawn()
//Utilise try/catch keywords here so the code continues even if an error occurs.
try
call(obj, thread_proc)(arglist(args.Copy(3)))
catch(var/exception/e)
error("[e] on [e.file]:[e.line]")
close()
/datum/spawn_sync/proc/wait_until_done()
finalize()
//Create a while loop to check if the sync is complete yet, it will return once all the spawn threads have
// completed, or the failsafe has expired.
while(check())
//Add a sleep call to delay each check.
sleep(1)
@@ -34,7 +34,8 @@
input = replace_characters(input, list("\n"=" ","\t"=" "))
if(encode)
//In addition to processing html, html_encode removes byond formatting codes like "\red", "\i" and other.
// The below \ escapes have a space inserted to attempt to enable Travis auto-checking of span class usage. Please do not remove the space.
//In addition to processing html, html_encode removes byond formatting codes like "\ red", "\ i" and other.
//It is important to avoid double-encode text, it can "break" quotes and some other characters.
//Also, keep in mind that escaped characters don't work in the interface (window titles, lower left corner of the main window, etc.)
input = html_encode(input)
@@ -115,7 +116,7 @@
if(last_char_group == 1)
output = copytext(output,1,length(output)) //removes the last character (in this case a space)
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai")) //prevents these common metagamey names
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai","plating")) //prevents these common metagamey names
if(cmptext(output,bad_name)) return //(not case sensitive)
return output
@@ -365,3 +366,19 @@ proc/TextPreview(var/string,var/len=40)
//Converts New Lines to html <br>
/proc/nl2br(var/text)
return replacetextEx(text,"\n","<br>")
/proc/contains_az09(var/input)
for(var/i=1, i<=length(input), i++)
var/ascii_char = text2ascii(input,i)
switch(ascii_char)
// A .. Z
if(65 to 90) //Uppercase Letters
return 1
// a .. z
if(97 to 122) //Lowercase Letters
return 1
// 0 .. 9
if(48 to 57) //Numbers
return 1
return 0
@@ -6,9 +6,9 @@
var/roundstart_hour = 0
//Returns the world time in english
proc/worldtime2text(time = world.time)
proc/worldtime2text(time = world.time, timeshift = 1)
if(!roundstart_hour) roundstart_hour = pick(2,7,12,17)
return "[(round(time / 36000)+roundstart_hour) % 24]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]"
return timeshift ? time2text(time+(36000*roundstart_hour), "hh:mm") : time2text(time, "hh:mm")
proc/worlddate2text()
return num2text((text2num(time2text(world.timeofday, "YYYY"))+544)) + "-" + time2text(world.timeofday, "MM-DD")
@@ -32,3 +32,12 @@
if(!available_turfs.len)
available_turfs = start_turfs
return pick(available_turfs)
/proc/turf_contains_dense_objects(var/turf/T)
return T.contains_dense_objects()
/proc/not_turf_contains_dense_objects(var/turf/T)
return !turf_contains_dense_objects(T)
/proc/is_station_turf(var/turf/T)
return T && isStationLevel(T.z)
@@ -36,35 +36,19 @@
return num
// 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
/proc/num2hex(num, padlength)
var/global/list/hexdigits = list("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
if (!isnum(num))
return
. = ""
while(num > 0)
var/hexdigit = hexdigits[(num & 0xF) + 1]
. = "[hexdigit][.]"
num >>= 4 //go to the next half-byte
// 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 = digits - length(hex)
//pad with zeroes
var/left = padlength - length(.)
while (left-- > 0)
hex = text("0[]", hex)
return hex
. = "0[.]"
// Concatenates a list of strings into a single string. A seperator may optionally be provided.
/proc/list2text(list/ls, sep)
@@ -292,13 +276,6 @@ proc/tg_list2text(list/list, glue=",")
if (rights & R_CCIAA) . += "[seperator]+CCIAA"
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'
// 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))
@@ -4,6 +4,9 @@
* A large number of misc global procs.
*/
//Checks if all high bits in req_mask are set in bitfield
#define BIT_TEST_ALL(bitfield, req_mask) ((~(bitfield) & (req_mask)) == 0)
//Inverts the colour of an HTML string
/proc/invertHTML(HTMLstring)
@@ -223,6 +226,33 @@ Turf and target are seperate in case you want to teleport some distance from a t
line+=locate(px,py,M.z)
return line
#define LOCATE_COORDS(X, Y, Z) locate(between(1, X, world.maxx), between(1, Y, world.maxy), Z)
/proc/getcircle(turf/center, var/radius) //Uses a fast Bresenham rasterization algorithm to return the turfs in a thin circle.
if(!radius) return list(center)
var/x = 0
var/y = radius
var/p = 3 - 2 * radius
. = list()
while(y >= x) // only formulate 1/8 of circle
. += LOCATE_COORDS(center.x - x, center.y - y, center.z) //upper left left
. += LOCATE_COORDS(center.x - y, center.y - x, center.z) //upper upper left
. += LOCATE_COORDS(center.x + y, center.y - x, center.z) //upper upper right
. += LOCATE_COORDS(center.x + x, center.y - y, center.z) //upper right right
. += LOCATE_COORDS(center.x - x, center.y + y, center.z) //lower left left
. += LOCATE_COORDS(center.x - y, center.y + x, center.z) //lower lower left
. += LOCATE_COORDS(center.x + y, center.y + x, center.z) //lower lower right
. += LOCATE_COORDS(center.x + x, center.y + y, center.z) //lower right right
if(p < 0)
p += 4*x++ + 6;
else
p += 4*(x++ - y--) + 10;
#undef LOCATE_COORDS
//Returns whether or not a player is a guest using their ckey as an input
/proc/IsGuestKey(key)
if (findtext(key, "Guest-", 1, 7) != 1) //was findtextEx
@@ -240,10 +270,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
return 1
//Ensure the frequency is within bounds of what it should be sending/recieving at
/proc/sanitize_frequency(var/f)
/proc/sanitize_frequency(var/f, var/low = PUBLIC_LOW_FREQ, var/high = PUBLIC_HIGH_FREQ)
f = round(f)
f = max(1441, f) // 144.1
f = min(1489, f) // 148.9
f = max(low, f)
f = min(high, f)
if ((f % 2) == 0) //Ensure the last digit is an odd number
f += 1
return f
@@ -472,16 +502,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
// mob_list.Add(M)
return moblist
//E = MC^2
/proc/convert2energy(var/M)
var/E = M*(SPEED_OF_LIGHT_SQ)
return E
//M = E/C^2
/proc/convert2mass(var/E)
var/M = E/(SPEED_OF_LIGHT_SQ)
return M
//Forces a variable to be posative
/proc/modulus(var/M)
if(M >= 0)
@@ -572,11 +592,14 @@ proc/GaussRandRound(var/sigma,var/roundto)
return toReturn
//Step-towards method of determining whether one atom can see another. Similar to viewers()
/proc/can_see(var/atom/source, var/atom/target, var/length=5) // I couldnt be arsed to do actual raycasting :I This is horribly inaccurate.
/proc/can_see(var/atom/source, var/atom/target, var/length=5) // I couldn't be arsed to do actual raycasting :I This is horribly inaccurate.
var/turf/current = get_turf(source)
var/turf/target_turf = get_turf(target)
var/steps = 0
if(!current || !target_turf)
return 0
while(current != target_turf)
if(steps > length) return 0
if(current.opacity) return 0
@@ -695,21 +718,6 @@ proc/GaussRandRound(var/sigma,var/roundto)
if(istype(N, areatype)) areas += N
return areas
//Takes: Area type as text string or as typepath OR an instance of the area.
//Returns: A list of all turfs in areas of that type of that type in the world.
/proc/get_area_turfs(var/areatype)
if(!areatype) return null
if(istext(areatype)) areatype = text2path(areatype)
if(isarea(areatype))
var/area/areatemp = areatype
areatype = areatemp.type
var/list/turfs = new/list()
for(var/area/N in world)
if(istype(N, areatype))
for(var/turf/T in N) turfs += T
return turfs
//Takes: Area type as text string or as typepath OR an instance of the area.
//Returns: A list of all atoms (objs, turfs, mobs) in areas of that type of that type in the world.
/proc/get_area_all_atoms(var/areatype)
@@ -784,11 +792,15 @@ proc/GaussRandRound(var/sigma,var/roundto)
var/old_dir1 = T.dir
var/old_icon_state1 = T.icon_state
var/old_icon1 = T.icon
var/old_overlays = T.overlays.Copy()
var/old_underlays = T.underlays.Copy()
var/turf/X = B.ChangeTurf(T.type)
X.set_dir(old_dir1)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
X.overlays = old_overlays
X.underlays = old_underlays
var/turf/simulated/ST = T
if(istype(ST) && ST.zone)
@@ -848,7 +860,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
if(turftoleave)
fromupdate += T.ChangeTurf(turftoleave)
else
T.ChangeTurf(/turf/space)
T.ChangeTurf(get_base_turf_by_area(T))
refined_src -= T
refined_trg -= B
@@ -931,9 +943,11 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
var/old_dir1 = T.dir
var/old_icon_state1 = T.icon_state
var/old_icon1 = T.icon
var/old_overlays = T.overlays.Copy()
var/old_underlays = T.underlays.Copy()
if(platingRequired)
if(istype(B, /turf/space))
if(istype(B, get_base_turf_by_area(B)))
continue moving
var/turf/X = B
@@ -941,7 +955,8 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
X.set_dir(old_dir1)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
X.overlays = old_overlays
X.underlays = old_underlays
var/list/objs = new/list()
var/list/newobjs = new/list()
@@ -1050,12 +1065,10 @@ proc/get_mob_with_client_list()
//gets the turf the atom is located in (or itself, if it is a turf).
//returns null if the atom is not in a turf.
/proc/get_turf(atom/location)
while(location)
if(isturf(location))
return location
location = location.loc
return null
/proc/get_turf(atom/A)
if(!istype(A)) return
for(A, A && !isturf(A), A=A.loc);
return A
/proc/get(atom/loc, type)
while(loc)
@@ -1306,8 +1319,10 @@ var/mob/dview/dview_mob = new
see_in_dark = 1e6
/mob/dview/New()
// do nothing. we don't want to be in any mob lists; we're a dummy not a mob.
/atom/proc/get_light_and_color(var/atom/origin)
if(origin)
color = origin.color
set_light(origin.light_range, origin.light_power, origin.light_color)
//This is just so you can stop an orbit.
//orbit() can run without it (swap orbiting for A)
@@ -1367,6 +1382,15 @@ var/mob/dview/dview_mob = new
/atom/movable/proc/stop_orbit()
orbiting = null
/mob/dview/New()
..()
// We don't want to be in any mob lists; we're a dummy not a mob.
mob_list -= src
if(stat == DEAD)
dead_mob_list -= src
else
living_mob_list -= src
// call to generate a stack trace and print to runtime logs
/proc/crash_with(msg)
CRASH(msg)
+40
View File
@@ -0,0 +1,40 @@
#define Clamp(x, y, z) (x <= y ? y : (x >= z ? z : x))
#define CLAMP01(x) (Clamp(x, 0, 1))
#define isAI(A) istype(A, /mob/living/silicon/ai)
#define isalien(A) istype(A, /mob/living/carbon/alien)
#define isanimal(A) istype(A, /mob/living/simple_animal)
#define isairlock(A) istype(A, /obj/machinery/door/airlock)
#define isbrain(A) istype(A, /mob/living/carbon/brain)
#define iscarbon(A) istype(A, /mob/living/carbon)
#define iscorgi(A) istype(A, /mob/living/simple_animal/corgi)
#define isEye(A) istype(A, /mob/eye)
#define ishuman(A) istype(A, /mob/living/carbon/human)
#define isliving(A) istype(A, /mob/living)
#define ismouse(A) istype(A, /mob/living/simple_animal/mouse)
#define isnewplayer(A) istype(A, /mob/new_player)
#define isobj(A) istype(A, /obj)
#define isobserver(A) istype(A, /mob/dead/observer)
#define isorgan(A) istype(A, /obj/item/organ/external)
#define ispAI(A) istype(A, /mob/living/silicon/pai)
#define isrobot(A) istype(A, /mob/living/silicon/robot)
#define issilicon(A) istype(A, /mob/living/silicon)
#define isslime(A) istype(A, /mob/living/carbon/slime)
+49 -30
View File
@@ -15,7 +15,6 @@
return
if(control_disabled || stat) return
next_move = world.time + 9
if(ismob(A))
ai_actual_track(A)
@@ -32,7 +31,7 @@
build_click(src, client.buildmode, params, A)
return
if(control_disabled || stat)
if(stat)
return
var/list/modifiers = params2list(params)
@@ -52,9 +51,15 @@
CtrlClickOn(A)
return
if(world.time <= next_move)
if(control_disabled || !canClick())
return
next_move = world.time + 9
if(multitool_mode && isobj(A))
var/obj/O = A
var/datum/expansion/multitool/MT = O.expansions[/datum/expansion/multitool]
if(MT)
MT.interact(aiMulti, src)
return
if(aiCamera.in_camera_mode)
aiCamera.camera_mode_off()
@@ -91,13 +96,24 @@
*/
/mob/living/silicon/ai/ShiftClickOn(var/atom/A)
A.AIShiftClick(src)
if(!control_disabled && A.AIShiftClick(src))
return
..()
/mob/living/silicon/ai/CtrlClickOn(var/atom/A)
A.AICtrlClick(src)
if(!control_disabled && A.AICtrlClick(src))
return
..()
/mob/living/silicon/ai/AltClickOn(var/atom/A)
A.AIAltClick(src)
if(!control_disabled && A.AIAltClick(src))
return
..()
/mob/living/silicon/ai/MiddleClickOn(var/atom/A)
A.AIMiddleClick(src)
if(!control_disabled && A.AIMiddleClick(src))
return
..()
/*
The following criminally helpful code is just the previous code cleaned up;
@@ -107,60 +123,63 @@
/atom/proc/AICtrlShiftClick()
return
/obj/machinery/door/airlock/AICtrlShiftClick()
if(emagged)
return
return
/atom/proc/AIShiftClick()
return
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(density)
Topic(src, list("src"= "\ref[src]", "command"="open", "activate" = "1"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="open", "activate" = "1"))
else
Topic(src, list("src"= "\ref[src]", "command"="open", "activate" = "0"), 1)
return
Topic(src, list("command"="open", "activate" = "0"))
return 1
/atom/proc/AICtrlClick()
return
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(locked)
Topic(src, list("src"= "\ref[src]", "command"="bolts", "activate" = "0"), 1)// 1 meaning no window (consistency!)
Topic(src, list("command"="bolts", "activate" = "0"))
else
Topic(src, list("src"= "\ref[src]", "command"="bolts", "activate" = "1"), 1)
Topic(src, list("command"="bolts", "activate" = "1"))
return 1
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
Topic(src, list("src"= "\ref[src]", "breaker"="1"), 1) // 1 meaning no window (consistency!)
Topic(src, list("breaker"="1"))
return 1
/obj/machinery/turretid/AICtrlClick() //turns off/on Turrets
Topic(src, list("src"= "\ref[src]", "command"="enable", "value"="[!enabled]"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="enable", "value"="[!enabled]"))
return 1
/atom/proc/AIAltClick(var/atom/A)
AltClick(A)
return AltClick(A)
/obj/machinery/door/airlock/AIAltClick() // Electrifies doors.
if(!electrified_until)
// permanent shock
Topic(src, list("src"= "\ref[src]", "command"="electrify_permanently", "activate" = "1"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="electrify_permanently", "activate" = "1"))
else
// disable/6 is not in Topic; disable/5 disables both temporary and permanent shock
Topic(src, list("src"= "\ref[src]", "command"="electrify_permanently", "activate" = "0"), 1)
return
Topic(src, list("command"="electrify_permanently", "activate" = "0"))
return 1
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
Topic(src, list("src"= "\ref[src]", "command"="lethal", "value"="[!lethal]"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="lethal", "value"="[!lethal]"))
return 1
/atom/proc/AIMiddleClick()
return
/atom/proc/AIMiddleClick(var/mob/living/silicon/user)
return 0
/obj/machinery/door/airlock/AIMiddleClick() // Toggles door bolt lights.
if(..())
return
if(!src.lights)
Topic(src, list("src"= "\ref[src]", "command"="lights", "activate" = "1"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="lights", "activate" = "1"))
else
Topic(src, list("src"= "\ref[src]", "command"="lights", "activate" = "0"), 1)
return
Topic(src, list("command"="lights", "activate" = "0"))
return 1
//
// Override AdjacentQuick for AltClicking
+58 -79
View File
@@ -4,7 +4,7 @@
*/
// 1 decisecond click delay (above and beyond mob/next_move)
/mob/var/next_click = 0
/mob/var/next_click = 0
/*
Before anything else, defer these calls to a per-mobtype handler. This allows us to
@@ -15,12 +15,14 @@
Note that this proc can be overridden, and is in the case of screen objects.
*/
/atom/Click(location,control,params)
/atom/Click(var/location, var/control, var/params) // This is their reaction to being clicked on (standard proc)
if(src)
usr.ClickOn(src, params)
/atom/DblClick(location,control,params)
/atom/DblClick(var/location, var/control, var/params)
if(src)
usr.DblClickOn(src,params)
usr.DblClickOn(src, params)
/*
Standard mob ClickOn()
@@ -35,9 +37,11 @@
* item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/
/mob/proc/ClickOn( var/atom/A, var/params )
if(world.time <= next_click)
/mob/proc/ClickOn(var/atom/A, var/params)
if(world.time <= next_click) // Hard check, before anything else, to avoid crashing
return
next_click = world.time + 1
if(client.buildmode)
@@ -47,117 +51,111 @@
var/list/modifiers = params2list(params)
if(modifiers["shift"] && modifiers["ctrl"])
CtrlShiftClickOn(A)
return
return 1
if(modifiers["middle"])
MiddleClickOn(A)
return
return 1
if(modifiers["shift"])
ShiftClickOn(A)
return
return 0
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
return 1
if(modifiers["ctrl"])
CtrlClickOn(A)
return
return 1
if(stat || paralysis || stunned || weakened)
return
face_atom(A) // change direction to face what you clicked on
if(next_move > world.time) // in the year 2000...
if(!canClick()) // in the year 2000...
return
if(istype(loc,/obj/mecha))
if(!locate(/turf) in list(A,A.loc)) // Prevents inventory from being drilled
if(istype(loc, /obj/mecha))
if(!locate(/turf) in list(A, A.loc)) // Prevents inventory from being drilled
return
var/obj/mecha/M = loc
return M.click_action(A,src)
return M.click_action(A, src)
if(restrained())
setClickCooldown(10)
RestrainedClickOn(A)
return
return 1
if(in_throw_mode)
if(isturf(A) || isturf(A.loc))
throw_item(A)
return
return 1
throw_mode_off()
if(!istype(A,/obj/item/weapon/gun) && !isturf(A) && !istype(A,/obj/screen))
last_target_click = world.time
var/obj/item/W = get_active_hand()
if(W == A)
next_move = world.time + 6
if(W.flags&USEDELAY)
next_move += 5
if(W == A) // Handle attack_self
W.attack_self(src)
if(hand)
update_inv_l_hand(0)
else
update_inv_r_hand(0)
return 1
return
// operate two STORAGE levels deep here (item in backpack in src; NOT item in box in backpack in src)
//Atoms on your person
// A is your location but is not a turf; or is on you (backpack); or is on something on you (box in backpack); sdepth is needed here because contents depth does not equate inventory storage depth.
var/sdepth = A.storage_depth(src)
if(A == loc || (A in loc) || (sdepth != -1 && sdepth <= 1))
if((!isturf(A) && A == loc) || (sdepth != -1 && sdepth <= 1))
// faster access to objects already on you
if(A in contents)
next_move = world.time + 6 // on your person
else
next_move = world.time + 8 // in a box/bag or in your square
if(A.loc != src)
setMoveCooldown(10) //getting something out of a backpack
// No adjacency needed
if(W)
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W,src)
var/resolved = W.resolve_attackby(A, src)
if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1 indicates adjacency
W.afterattack(A, src, 1, params) // 1 indicates adjacency
else
if(ismob(A)) // No instant mob attacking
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
UnarmedAttack(A, 1)
return
return 1
if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
return
// Allows you to click on a box's contents, if that box is on the ground, but no deeper than that
//Atoms on turfs (not on your person)
// A is a turf or is on a turf, or in something on a turf (pen in a box); but not something in something on a turf (pen in a box in a backpack)
sdepth = A.storage_depth_turf()
if(isturf(A) || isturf(A.loc) || (sdepth != -1 && sdepth <= 1))
next_move = world.time + 10
if(A.Adjacent(src)) // see adjacent.dm
if(W)
if(W.flags&USEDELAY)
next_move += 5
setMoveCooldown(5)
if(W)
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = A.attackby(W,src)
var/resolved = W.resolve_attackby(A,src)
if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1: clicking something Adjacent
W.afterattack(A, src, 1, params) // 1: clicking something Adjacent
else
if(ismob(A)) // No instant mob attacking
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
UnarmedAttack(A, 1)
return
else // non-adjacent click
if(W)
W.afterattack(A,src,0,params) // 0: not Adjacent
W.afterattack(A, src, 0, params) // 0: not Adjacent
else
RangedAttack(A, params)
return 1
return
/mob/proc/setClickCooldown(var/timeout)
next_move = max(world.time + timeout, next_move)
/mob/proc/changeNext_move(num)
next_move = world.time + num
/mob/proc/canClick()
if(config.no_click_cooldown || next_move <= world.time)
return 1
return 0
// Default behavior: ignore double clicks, consider them normal clicks instead
// Default behavior: ignore double clicks, the second click that makes the doubleclick call already calls for a normal click
/mob/proc/DblClickOn(var/atom/A, var/params)
ClickOn(A,params)
return
/*
Translates into attack_hand, etc.
@@ -178,10 +176,6 @@
src << "You cannot attack people before the game has started."
return 0
if (istype(get_area(src), /area/start))
src << "No attacking people at spawn, you jackass."
return 0
if(stat)
return 0
@@ -201,14 +195,12 @@
LaserEyes(A) // moved into a proc below
else if(TK in mutations)
switch(get_dist(src,A))
if(0)
;
if(1 to 5) // not adjacent may mean blocked by window
next_move += 2
setMoveCooldown(2)
if(5 to 7)
next_move += 5
setMoveCooldown(5)
if(8 to tk_maxrange)
next_move += 10
setMoveCooldown(10)
else
return
A.attack_tk(src)
@@ -226,23 +218,9 @@
Only used for swapping hands
*/
/mob/proc/MiddleClickOn(var/atom/A)
swap_hand()
return
/mob/living/carbon/MiddleClickOn(var/atom/A)
swap_hand()
/mob/living/carbon/human/MiddleClickOn(var/atom/A)
if(back)
var/obj/item/weapon/rig/rig = back
if(istype(rig) && rig.selected_module)
if(world.time <= next_move) return
next_move = world.time + 8
rig.selected_module.engage(A)
return
swap_hand()
// In case of use break glass
/*
/atom/proc/MiddleClick(var/mob/M as mob)
@@ -292,7 +270,7 @@
else
user.listed_turf = T
user.client.statpanel = "Turf"
return
return 1
/mob/proc/TurfAdjacent(var/turf/T)
return T.AdjacentQuick(src)
@@ -318,6 +296,7 @@
return
/mob/living/LaserEyes(atom/A)
setClickCooldown(4)
var/turf/T = get_turf(src)
var/obj/item/projectile/beam/LE = new (T)
+1 -11
View File
@@ -35,7 +35,7 @@
if(stat || lockcharge || weakened || stunned || paralysis)
return
if(next_move >= world.time)
if(!canClick())
return
face_atom(A) // change direction to face what you clicked on
@@ -68,9 +68,6 @@
return
if(W == A)
next_move = world.time + 8
if(W.flags&USEDELAY)
next_move += 5
W.attack_self(src)
return
@@ -78,9 +75,6 @@
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
if(A == loc || (A in loc) || (A in contents))
// No adjacency checks
next_move = world.time + 8
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W,src)
if(!resolved && A && W)
@@ -93,16 +87,12 @@
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm
next_move = world.time + 10
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W, src)
if(!resolved && A && W)
W.afterattack(A, src, 1, params)
return
else
next_move = world.time + 10
W.afterattack(A, src, 0, params)
return
return
+73 -97
View File
@@ -13,136 +13,112 @@
Therefore, the top right corner (except during admin shenanigans) is at "15,15"
*/
//Upper left action buttons, displayed when you pick up an item that has this enabled.
#define ui_action_slot1 "1:6,14:26"
#define ui_action_slot2 "2:8,14:26"
#define ui_action_slot3 "3:10,14:26"
#define ui_action_slot4 "4:12,14:26"
#define ui_action_slot5 "5:14,14:26"
#define ui_entire_screen "WEST,SOUTH to EAST,NORTH"
//Lower left, persistant menu
#define ui_inventory "1:6,1:5"
#define ui_inventory "WEST:6,SOUTH:5"
//Lower center, persistant menu
#define ui_sstore1 "3:10,1:5"
#define ui_id "4:12,1:5"
#define ui_belt "5:14,1:5"
#define ui_back "6:14,1:5"
#define ui_rhand "7:16,1:5"
#define ui_lhand "8:16,1:5"
#define ui_equip "7:16,2:5"
#define ui_swaphand1 "7:16,2:5"
#define ui_swaphand2 "8:16,2:5"
#define ui_storage1 "9:18,1:5"
#define ui_storage2 "10:20,1:5"
#define ui_sstore1 "WEST+2:10,SOUTH:5"
#define ui_id "WEST+3:12,SOUTH:5"
#define ui_belt "WEST+4:14,SOUTH:5"
#define ui_back "CENTER-2:14,SOUTH:5"
#define ui_rhand "CENTER-1:16,SOUTH:5"
#define ui_lhand "CENTER:16,SOUTH:5"
#define ui_equip "CENTER-1:16,SOUTH+1:5"
#define ui_swaphand1 "CENTER-1:16,SOUTH+1:5"
#define ui_swaphand2 "CENTER:16,SOUTH+1:5"
#define ui_storage1 "CENTER+1:16,SOUTH:5"
#define ui_storage2 "CENTER+2:16,SOUTH:5"
#define ui_alien_head "4:12,1:5" //aliens
#define ui_alien_oclothing "5:14,1:5" //aliens
#define ui_alien_head "CENTER-3:12,SOUTH:5" //aliens
#define ui_alien_oclothing "CENTER-2:14,SOUTH:5"//aliens
#define ui_inv1 "7,1:5" //borgs
#define ui_inv2 "8,1:5" //borgs
#define ui_inv3 "9,1:5" //borgs
#define ui_borg_store "10,1:5" //borgs
#define ui_borg_inventory "6,1:5"//borgs
#define ui_inv1 "CENTER-1,SOUTH:5" //borgs
#define ui_inv2 "CENTER,SOUTH:5" //borgs
#define ui_inv3 "CENTER+1,SOUTH:5" //borgs
#define ui_borg_store "CENTER+2,SOUTH:5" //borgs
#define ui_borg_inventory "CENTER-2,SOUTH:5"//borgs
#define ui_monkey_mask "5:14,1:5" //monkey
#define ui_monkey_back "6:14,1:5" //monkey
#define ui_monkey_mask "WEST+4:14,SOUTH:5" //monkey
#define ui_monkey_back "WEST+5:14,SOUTH:5" //monkey
#define ui_construct_health "15:00,7:15" //same height as humans, hugging the right border
#define ui_construct_purge "15:00,6:15"
#define ui_construct_fire "14:16,8:13" //above health, slightly to the left
#define ui_construct_pull "14:28,2:10" //above the zone_sel icon
#define ui_construct_health "EAST:00,CENTER:15" //same height as humans, hugging the right border
#define ui_construct_purge "EAST:00,CENTER-1:15"
#define ui_construct_fire "EAST-1:16,CENTER+1:13" //above health, slightly to the left
#define ui_construct_pull "EAST-1:28,SOUTH+1:10" //above the zone_sel icon
//Lower right, persistant menu
#define ui_dropbutton "11:22,1:5"
#define ui_drop_throw "14:28,2:7"
#define ui_pull_resist "13:26,2:7"
#define ui_acti "13:26,1:5"
#define ui_movi "12:24,1:5"
#define ui_zonesel "14:28,1:5"
#define ui_acti_alt "14:28,1:5" //alternative intent switcher for when the interface is hidden (F12)
#define ui_dropbutton "EAST-4:22,SOUTH:5"
#define ui_drop_throw "EAST-1:28,SOUTH+1:7"
#define ui_pull_resist "EAST-2:26,SOUTH+1:7"
#define ui_acti "EAST-2:26,SOUTH:5"
#define ui_movi "EAST-3:24,SOUTH:5"
#define ui_zonesel "EAST-1:28,SOUTH:5"
#define ui_acti_alt "EAST-1:28,SOUTH:5" //alternative intent switcher for when the interface is hidden (F12)
#define ui_borg_pull "12:24,2:7"
#define ui_borg_module "13:26,2:7"
#define ui_borg_panel "14:28,2:7"
#define ui_borg_pull "EAST-3:24,SOUTH+1:7"
#define ui_borg_module "EAST-2:26,SOUTH+1:7"
#define ui_borg_panel "EAST-1:28,SOUTH+1:7"
//Gun buttons
#define ui_gun1 "13:26,3:7"
#define ui_gun2 "14:28, 4:7"
#define ui_gun3 "13:26,4:7"
#define ui_gun_select "14:28,3:7"
#define ui_gun4 "12:24,3:7"
#define ui_gun1 "EAST-2:26,SOUTH+2:7"
#define ui_gun2 "EAST-1:28, SOUTH+3:7"
#define ui_gun3 "EAST-2:26,SOUTH+3:7"
#define ui_gun_select "EAST-1:28,SOUTH+2:7"
#define ui_gun4 "EAST-3:24,SOUTH+2:7"
//Upper-middle right (damage indicators)
#define ui_toxin "14:28,13:27"
#define ui_fire "14:28,12:25"
#define ui_oxygen "14:28,11:23"
#define ui_pressure "14:28,10:21"
#define ui_toxin "EAST-1:28,NORTH-2:27"
#define ui_fire "EAST-1:28,NORTH-3:25"
#define ui_oxygen "EAST-1:28,NORTH-4:23"
#define ui_pressure "EAST-1:28,NORTH-5:21"
#define ui_alien_toxin "14:28,13:25"
#define ui_alien_fire "14:28,12:25"
#define ui_alien_oxygen "14:28,11:25"
#define ui_alien_toxin "EAST-1:28,NORTH-2:25"
#define ui_alien_fire "EAST-1:28,NORTH-3:25"
#define ui_alien_oxygen "EAST-1:28,NORTH-4:25"
//Middle right (status indicators)
#define ui_nutrition "14:28,5:11"
#define ui_temp "14:28,6:13"
#define ui_health "14:28,7:15"
#define ui_internal "14:28,8:17"
#define ui_nutrition "EAST-1:28,CENTER-2:11"
#define ui_temp "EAST-1:28,CENTER-1:13"
#define ui_health "EAST-1:28,CENTER:15"
#define ui_internal "EAST-1:28,CENTER+1:17"
//borgs
#define ui_borg_health "14:28,6:13" //borgs have the health display where humans have the pressure damage indicator.
#define ui_alien_health "14:28,6:13" //aliens have the health display where humans have the pressure damage indicator.
#define ui_borg_health "EAST-1:28,CENTER-1:13" //borgs have the health display where humans have the pressure damage indicator.
#define ui_alien_health "EAST-1:28,CENTER-1:13" //aliens have the health display where humans have the pressure damage indicator.
//Pop-up inventory
#define ui_shoes "2:8,1:5"
#define ui_shoes "WEST+1:8,SOUTH:5"
#define ui_iclothing "1:6,2:7"
#define ui_oclothing "2:8,2:7"
#define ui_gloves "3:10,2:7"
#define ui_iclothing "WEST:6,SOUTH+1:7"
#define ui_oclothing "WEST+1:8,SOUTH+1:7"
#define ui_gloves "WEST+2:10,SOUTH+1:7"
#define ui_glasses "1:6,3:9"
#define ui_mask "2:8,3:9"
#define ui_l_ear "3:10,3:9"
#define ui_r_ear "3:10,4:11"
#define ui_glasses "WEST:6,SOUTH+2:9"
#define ui_mask "WEST+1:8,SOUTH+2:9"
#define ui_l_ear "WEST+2:10,SOUTH+2:9"
#define ui_r_ear "WEST+2:10,SOUTH+3:11"
#define ui_head "2:8,4:11"
#define ui_head "WEST+1:8,SOUTH+3:11"
//Intent small buttons
#define ui_help_small "12:8,1:1"
#define ui_disarm_small "12:15,1:18"
#define ui_grab_small "12:32,1:18"
#define ui_harm_small "12:39,1:1"
#define ui_help_small "EAST-3:8,SOUTH:1"
#define ui_disarm_small "EAST-3:15,SOUTH:18"
#define ui_grab_small "EAST-3:32,SOUTH:18"
#define ui_harm_small "EAST-3:39,SOUTH:1"
//#define ui_swapbutton "6:-16,1:5" //Unused
//#define ui_headset "SOUTH,8"
#define ui_hand "6:14,1:5"
#define ui_hstore1 "5,5"
#define ui_hand "CENTER-1:14,SOUTH:5"
#define ui_hstore1 "CENTER-2,CENTER-2"
//#define ui_resist "EAST+1,SOUTH-1"
#define ui_sleep "EAST+1, NORTH-13"
#define ui_rest "EAST+1, NORTH-14"
#define ui_iarrowleft "SOUTH-1,11"
#define ui_iarrowright "SOUTH-1,13"
#define ui_iarrowleft "SOUTH-1,EAST-4"
#define ui_iarrowright "SOUTH-1,EAST-2"
#define ui_spell_master "14:16,14:16"
#define ui_genetic_master "14:16,12:16"
// AI
#define ui_ai_camera_list "SOUTH:6+1,WEST+1:16"
#define ui_ai_track_with_camera "SOUTH:6+1,WEST+2:16"
#define ui_ai_camera_light "SOUTH:6+1,WEST+3:16"
#define ui_ai_sensor "SOUTH:6+1,WEST+4:16"
#define ui_ai_core "SOUTH:6,WEST+1:16"
#define ui_ai_crew_monitor "SOUTH:6,WEST+2:16"
#define ui_ai_crew_manifest "SOUTH:6,WEST+3:16"
#define ui_ai_alerts "SOUTH:6,WEST+4:16"
#define ui_ai_announcement "SOUTH:6,WEST+5:16"
#define ui_ai_shuttle "SOUTH:6,WEST+6:16"
#define ui_ai_state_laws "SOUTH:6,WEST+7:16"
#define ui_ai_pda_send "SOUTH:6,WEST+8:16"
#define ui_ai_pda_log "SOUTH:6,WEST+9:16"
#define ui_ai_take_picture "SOUTH:6,WEST+10:16"
#define ui_ai_view_images "SOUTH:6,WEST+11:16"
#define ui_spell_master "EAST-1:16,NORTH-1:16"
#define ui_genetic_master "EAST-1:16,NORTH-3:16"
+223
View File
@@ -0,0 +1,223 @@
#define AB_ITEM 1
#define AB_SPELL 2
#define AB_INNATE 3
#define AB_GENERIC 4
#define AB_CHECK_RESTRAINED 1
#define AB_CHECK_STUNNED 2
#define AB_CHECK_LYING 4
#define AB_CHECK_ALIVE 8
#define AB_CHECK_INSIDE 16
/datum/action
var/name = "Generic Action"
var/action_type = AB_ITEM
var/procname = null
var/atom/movable/target = null
var/check_flags = 0
var/processing = 0
var/active = 0
var/obj/screen/movable/action_button/button = null
var/button_icon = 'icons/mob/actions.dmi'
var/button_icon_state = "default"
var/background_icon_state = "bg_default"
var/mob/living/owner
/datum/action/New(var/Target)
target = Target
/datum/action/Destroy()
if(owner)
Remove(owner)
/datum/action/proc/Grant(mob/living/T)
if(owner)
if(owner == T)
return
Remove(owner)
owner = T
owner.actions.Add(src)
owner.update_action_buttons()
return
/datum/action/proc/Remove(mob/living/T)
if(button)
if(T.client)
T.client.screen -= button
qdel(button)
button = null
T.actions.Remove(src)
T.update_action_buttons()
owner = null
return
/datum/action/proc/Trigger()
if(!Checks())
return
switch(action_type)
if(AB_ITEM)
if(target)
var/obj/item/item = target
item.ui_action_click()
//if(AB_SPELL)
// if(target)
// var/obj/effect/proc_holder/spell = target
// spell.Click()
if(AB_INNATE)
if(!active)
Activate()
else
Deactivate()
if(AB_GENERIC)
if(target && procname)
call(target,procname)(usr)
return
/datum/action/proc/Activate()
return
/datum/action/proc/Deactivate()
return
/datum/action/proc/Process()
return
/datum/action/proc/CheckRemoval(mob/living/user) // 1 if action is no longer valid for this mob and should be removed
return 0
/datum/action/proc/IsAvailable()
return Checks()
/datum/action/proc/Checks()// returns 1 if all checks pass
if(!owner)
return 0
if(check_flags & AB_CHECK_RESTRAINED)
if(owner.restrained())
return 0
if(check_flags & AB_CHECK_STUNNED)
if(owner.stunned)
return 0
if(check_flags & AB_CHECK_LYING)
if(owner.lying)
return 0
if(check_flags & AB_CHECK_ALIVE)
if(owner.stat)
return 0
if(check_flags & AB_CHECK_INSIDE)
if(!(target in owner))
return 0
return 1
/datum/action/proc/UpdateName()
return name
/obj/screen/movable/action_button
var/datum/action/owner
screen_loc = "WEST,NORTH"
/obj/screen/movable/action_button/Click(location,control,params)
var/list/modifiers = params2list(params)
if(modifiers["shift"])
moved = 0
return 1
if(usr.next_move >= world.time) // Is this needed ?
return
owner.Trigger()
return 1
/obj/screen/movable/action_button/proc/UpdateIcon()
if(!owner)
return
icon = owner.button_icon
icon_state = owner.background_icon_state
overlays.Cut()
var/image/img
if(owner.action_type == AB_ITEM && owner.target)
var/obj/item/I = owner.target
img = image(I.icon, src , I.icon_state)
else if(owner.button_icon && owner.button_icon_state)
img = image(owner.button_icon,src,owner.button_icon_state)
img.pixel_x = 0
img.pixel_y = 0
overlays += img
if(!owner.IsAvailable())
color = rgb(128,0,0,128)
else
color = rgb(255,255,255,255)
//Hide/Show Action Buttons ... Button
/obj/screen/movable/action_button/hide_toggle
name = "Hide Buttons"
icon = 'icons/mob/actions.dmi'
icon_state = "bg_default"
var/hidden = 0
/obj/screen/movable/action_button/hide_toggle/Click()
usr.hud_used.action_buttons_hidden = !usr.hud_used.action_buttons_hidden
hidden = usr.hud_used.action_buttons_hidden
if(hidden)
name = "Show Buttons"
else
name = "Hide Buttons"
UpdateIcon()
usr.update_action_buttons()
/obj/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(var/mob/living/user)
if(isalien(user))
icon_state = "bg_alien"
else
icon_state = "bg_default"
UpdateIcon()
return
/obj/screen/movable/action_button/hide_toggle/UpdateIcon()
overlays.Cut()
var/image/img = image(icon,src,hidden?"show":"hide")
overlays += img
return
//This is the proc used to update all the action buttons. Properly defined in /mob/living/
/mob/proc/update_action_buttons()
return
#define AB_WEST_OFFSET 4
#define AB_NORTH_OFFSET 26
#define AB_MAX_COLUMNS 10
/datum/hud/proc/ButtonNumberToScreenCoords(var/number) // TODO : Make this zero-indexed for readabilty
var/row = round((number-1)/AB_MAX_COLUMNS)
var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1
var/coord_col = "+[col-1]"
var/coord_col_offset = AB_WEST_OFFSET+2*col
var/coord_row = "[-1 - row]"
var/coord_row_offset = AB_NORTH_OFFSET
return "WEST[coord_col]:[coord_col_offset],NORTH[coord_row]:[coord_row_offset]"
/datum/hud/proc/SetButtonCoords(var/obj/screen/button,var/number)
var/row = round((number-1)/AB_MAX_COLUMNS)
var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1
var/x_offset = 32*(col-1) + AB_WEST_OFFSET + 2*col
var/y_offset = -32*(row+1) + AB_NORTH_OFFSET
var/matrix/M = matrix()
M.Translate(x_offset,y_offset)
button.transform = M
//Presets for item actions
/datum/action/item_action
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_ALIVE|AB_CHECK_INSIDE
/datum/action/item_action/CheckRemoval(mob/living/user)
return !(target in user)
/datum/action/item_action/hands_free
check_flags = AB_CHECK_ALIVE|AB_CHECK_INSIDE
#undef AB_WEST_OFFSET
#undef AB_NORTH_OFFSET
#undef AB_MAX_COLUMNS
+4 -1
View File
@@ -1,3 +1,6 @@
/mob/living/carbon/alien/instantiate_hud(var/datum/hud/HUD)
HUD.larva_hud()
/datum/hud/proc/larva_hud()
src.adding = list()
@@ -32,7 +35,7 @@
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
mymob.fire = new /obj/screen()
+66
View File
@@ -0,0 +1,66 @@
/obj/screen/gun
name = "gun"
icon = 'icons/mob/screen1.dmi'
master = null
dir = 2
/obj/screen/gun/Click(location, control, params)
if(!usr)
return
return 1
/obj/screen/gun/move
name = "Allow Movement"
icon_state = "no_walk0"
screen_loc = ui_gun2
/obj/screen/gun/move/Click(location, control, params)
if(..())
var/mob/living/user = usr
if(istype(user))
if(!user.aiming) user.aiming = new(user)
user.aiming.toggle_permission(TARGET_CAN_MOVE)
return 1
return 0
/obj/screen/gun/item
name = "Allow Item Use"
icon_state = "no_item0"
screen_loc = ui_gun1
/obj/screen/gun/item/Click(location, control, params)
if(..())
var/mob/living/user = usr
if(istype(user))
if(!user.aiming) user.aiming = new(user)
user.aiming.toggle_permission(TARGET_CAN_CLICK)
return 1
return 0
/obj/screen/gun/mode
name = "Toggle Gun Mode"
icon_state = "gun0"
screen_loc = ui_gun_select
/obj/screen/gun/mode/Click(location, control, params)
if(..())
var/mob/living/user = usr
if(istype(user))
if(!user.aiming) user.aiming = new(user)
user.aiming.toggle_active()
return 1
return 0
/obj/screen/gun/radio
name = "Allow Radio Use"
icon_state = "no_radio0"
screen_loc = ui_gun4
/obj/screen/gun/radio/Click(location, control, params)
if(..())
var/mob/living/user = usr
if(istype(user))
if(!user.aiming) user.aiming = new(user)
user.aiming.toggle_permission(TARGET_CAN_RADIO)
return 1
return 0
+18 -38
View File
@@ -41,14 +41,14 @@ var/list/global_huds = list(
/datum/global_hud/New()
//420erryday psychedellic colours screen overlay for when you are high
druggy = new /obj/screen()
druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
druggy.screen_loc = ui_entire_screen
druggy.icon_state = "druggy"
druggy.layer = 17
druggy.mouse_opacity = 0
//that white blurry effect you get when you eyes are damaged
blurry = new /obj/screen()
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
blurry.screen_loc = ui_entire_screen
blurry.icon_state = "blurry"
blurry.layer = 17
blurry.mouse_opacity = 0
@@ -74,21 +74,21 @@ var/list/global_huds = list(
//welding mask overlay black/dither
darkMask = newlist(/obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen)
O = darkMask[1]
O.screen_loc = "3,3 to 5,13"
O.screen_loc = "WEST+2,SOUTH+2 to WEST+4,NORTH-2"
O = darkMask[2]
O.screen_loc = "5,3 to 10,5"
O.screen_loc = "WEST+4,SOUTH+2 to EAST-5,SOUTH+4"
O = darkMask[3]
O.screen_loc = "6,11 to 10,13"
O.screen_loc = "WEST+5,NORTH-4 to EAST-5,NORTH-2"
O = darkMask[4]
O.screen_loc = "11,3 to 13,13"
O.screen_loc = "EAST-4,SOUTH+2 to EAST-2,NORTH-2"
O = darkMask[5]
O.screen_loc = "1,1 to 15,2"
O.screen_loc = "WEST,SOUTH to EAST,SOUTH+1"
O = darkMask[6]
O.screen_loc = "1,3 to 2,15"
O.screen_loc = "WEST,SOUTH+2 to WEST+1,NORTH"
O = darkMask[7]
O.screen_loc = "14,3 to 15,15"
O.screen_loc = "EAST-1,SOUTH+2 to EAST,NORTH"
O = darkMask[8]
O.screen_loc = "3,14 to 13,15"
O.screen_loc = "WEST+2,NORTH-1 to EAST-2,NORTH"
for(i = 1, i <= 4, i++)
O = vimpaired[i]
@@ -133,7 +133,8 @@ var/list/global_huds = list(
var/list/other
var/list/obj/screen/hotkeybuttons
var/list/obj/screen/item_action/item_action_list = list() //Used for the item action ui buttons.
var/obj/screen/movable/action_button/hide_toggle/hide_actions_toggle
var/action_buttons_hidden = 0
datum/hud/New(mob/owner)
mymob = owner
@@ -156,7 +157,7 @@ datum/hud/New(mob/owner)
adding = null
other = null
hotkeybuttons = null
item_action_list = null
// item_action_list = null // ?
mymob = null
/datum/hud/proc/hidden_inventory_update()
@@ -252,26 +253,9 @@ datum/hud/New(mob/owner)
var/ui_color = mymob.client.prefs.UI_style_color
var/ui_alpha = mymob.client.prefs.UI_style_alpha
if(ishuman(mymob))
human_hud(ui_style, ui_color, ui_alpha, mymob) // Pass the player the UI style chosen in preferences
else if(issmall(mymob))
monkey_hud(ui_style)
else if(isbrain(mymob))
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))
robot_hud()
else if(isobserver(mymob))
ghost_hud()
else
mymob.instantiate_hud(src)
mymob.instantiate_hud(src, ui_style, ui_color, ui_alpha)
/mob/proc/instantiate_hud(var/datum/hud/HUD)
/mob/proc/instantiate_hud(var/datum/hud/HUD, var/ui_style, var/ui_color, var/ui_alpha)
return
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
@@ -280,11 +264,11 @@ datum/hud/New(mob/owner)
set hidden = 1
if(!hud_used)
usr << "\red This mob type does not use a HUD."
usr << "<span class='warning'>This mob type does not use a HUD.</span>"
return
if(!ishuman(src))
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
usr << "<span class='warning'>Inventory hiding is currently only supported for human mobs, sorry.</span>"
return
if(!client) return
@@ -298,8 +282,6 @@ datum/hud/New(mob/owner)
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
@@ -357,8 +339,6 @@ datum/hud/New(mob/owner)
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
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
else
@@ -375,4 +355,4 @@ datum/hud/New(mob/owner)
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
update_action_buttons()
+16 -70
View File
@@ -1,5 +1,7 @@
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255, var/mob/living/carbon/human/target)
/mob/living/carbon/human/instantiate_hud(var/datum/hud/HUD, var/ui_style, var/ui_color, var/ui_alpha)
HUD.human_hud(ui_style, ui_color, ui_alpha, src)
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255, var/mob/living/carbon/human/target)
var/datum/hud_data/hud_data
if(!istype(target))
hud_data = new()
@@ -58,7 +60,6 @@
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_acti
@@ -125,7 +126,6 @@
if(hud_data.has_m_intent)
using = new /obj/screen()
using.name = "mov_intent"
using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
@@ -160,11 +160,10 @@
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.set_dir(WEST)
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
inv_box.icon_state = "r_hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_active"
inv_box.icon_state = "r_hand_active"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
@@ -176,11 +175,10 @@
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.set_dir(EAST)
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
inv_box.icon_state = "l_hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.icon_state = "l_hand_active"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
@@ -191,7 +189,6 @@
using = new /obj/screen/inventory()
using.name = "hand"
using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
@@ -202,7 +199,6 @@
using = new /obj/screen/inventory()
using.name = "hand"
using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
@@ -324,7 +320,7 @@
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
hud_elements |= mymob.flash
@@ -340,30 +336,26 @@
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
//mymob.gun_setting_icon.color = ui_color
mymob.gun_setting_icon.icon = ui_style
mymob.gun_setting_icon.color = ui_color
mymob.gun_setting_icon.alpha = ui_alpha
hud_elements |= mymob.gun_setting_icon
mymob.item_use_icon = new /obj/screen/gun/item(null)
//mymob.item_use_icon.color = ui_color
mymob.item_use_icon.icon = ui_style
mymob.item_use_icon.color = ui_color
mymob.item_use_icon.alpha = ui_alpha
mymob.gun_move_icon = new /obj/screen/gun/move(null)
//mymob.gun_move_icon.color = ui_color
mymob.gun_move_icon.icon = ui_style
mymob.gun_move_icon.color = ui_color
mymob.gun_move_icon.alpha = ui_alpha
mymob.gun_run_icon = new /obj/screen/gun/run(null)
//mymob.gun_run_icon.color = ui_color
mymob.gun_run_icon.alpha = ui_alpha
mymob.radio_use_icon = new /obj/screen/gun/radio(null)
mymob.radio_use_icon.icon = ui_style
mymob.radio_use_icon.color = ui_color
mymob.radio_use_icon.alpha = ui_alpha
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.set_dir(2)
mymob.client.screen = null
mymob.client.screen += hud_elements
@@ -385,52 +377,6 @@
client.screen -= hud_used.hotkeybuttons
hud_used.hotkey_ui_hidden = 1
/mob/living/carbon/human/update_action_buttons()
var/num = 1
if(!hud_used) return
if(!client) return
if(!hud_used.hud_shown) //Hud toggled to minimal
return
client.screen -= hud_used.item_action_list
hud_used.item_action_list = list()
for(var/obj/item/I in src)
if(I.icon_action_button)
var/obj/screen/item_action/A = new(hud_used)
//A.icon = 'icons/mob/screen1_action.dmi'
//A.icon_state = I.icon_action_button
A.icon = ui_style2icon(client.prefs.UI_style)
A.icon_state = "template"
var/image/img = image(I.icon, A, I.icon_state)
img.pixel_x = 0
img.pixel_y = 0
A.overlays += img
if(I.action_button_name)
A.name = I.action_button_name
else
A.name = "Use [I.name]"
A.owner = I
hud_used.item_action_list += A
switch(num)
if(1)
A.screen_loc = ui_action_slot1
if(2)
A.screen_loc = ui_action_slot2
if(3)
A.screen_loc = ui_action_slot3
if(4)
A.screen_loc = ui_action_slot4
if(5)
A.screen_loc = ui_action_slot5
break //5 slots available, so no more can be added.
num++
src.client.screen += src.hud_used.item_action_list
//Used for new human mobs created by cloning/goleming/etc.
/mob/living/carbon/human/proc/set_cloned_appearance()
f_style = "Shaved"
-252
View File
@@ -1,252 +0,0 @@
/datum/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
src.adding = list()
src.other = list()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = mymob.a_intent
using.screen_loc = ui_acti
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 = I_HELP
using.icon = ico
using.screen_loc = ui_acti
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 = I_DISARM
using.icon = ico
using.screen_loc = ui_acti
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 = I_GRAB
using.icon = ico
using.screen_loc = ui_acti
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 = I_HURT
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = ui_style
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.set_dir(WEST)
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.set_dir(EAST)
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen/inventory()
using.name = "hand"
using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.set_dir(NORTH)
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_monkey_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.set_dir(NORTHEAST)
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
src.adding += inv_box
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = ui_style
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.pressure = new /obj/screen()
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
mymob.toxin = new /obj/screen()
mymob.toxin.icon = ui_style
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_toxin
mymob.internals = new /obj/screen()
mymob.internals.icon = ui_style
mymob.internals.icon_state = "internal0"
mymob.internals.name = "internal"
mymob.internals.screen_loc = ui_internal
mymob.fire = new /obj/screen()
mymob.fire.icon = ui_style
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon = ui_style
mymob.bodytemp.icon_state = "temp1"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.healths = new /obj/screen()
mymob.healths.icon = ui_style
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.invisibility = 101
mymob.flash = new /obj/screen()
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = ui_style
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
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.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)
src.adding += mymob.item_use_icon
mymob.radio_use_icon = new /obj/screen/gun/radio(null)
if (mymob.client.target_can_radio)
mymob.radio_use_icon.set_dir(1)
src.adding += mymob.radio_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.set_dir(1)
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.set_dir(1)
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return
+128
View File
@@ -0,0 +1,128 @@
//////////////////////////
//Movable Screen Objects//
// By RemieRichards //
//////////////////////////
//Movable Screen Object
//Not tied to the grid, places it's center where the cursor is
/obj/screen/movable
var/snap2grid = FALSE
var/moved = FALSE
//Snap Screen Object
//Tied to the grid, snaps to the nearest turf
/obj/screen/movable/snap
snap2grid = TRUE
/obj/screen/movable/MouseDrop(over_object, src_location, over_location, src_control, over_control, params)
var/list/PM = params2list(params)
//No screen-loc information? abort.
if(!PM || !PM["screen-loc"])
return
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
var/list/screen_loc_params = text2list(PM["screen-loc"], ",")
//Split X+Pixel_X up into list(X, Pixel_X)
var/list/screen_loc_X = text2list(screen_loc_params[1],":")
screen_loc_X[1] = encode_screen_X(text2num(screen_loc_X[1]))
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
var/list/screen_loc_Y = text2list(screen_loc_params[2],":")
screen_loc_Y[1] = encode_screen_Y(text2num(screen_loc_Y[1]))
if(snap2grid) //Discard Pixel Values
screen_loc = "[screen_loc_X[1]],[screen_loc_Y[1]]"
else //Normalise Pixel Values (So the object drops at the center of the mouse, not 16 pixels off)
var/pix_X = text2num(screen_loc_X[2]) - 16
var/pix_Y = text2num(screen_loc_Y[2]) - 16
screen_loc = "[screen_loc_X[1]]:[pix_X],[screen_loc_Y[1]]:[pix_Y]"
/obj/screen/movable/proc/encode_screen_X(X)
if(X > usr.client.view+1)
. = "EAST-[usr.client.view*2 + 1-X]"
else if(X < usr.client.view+1)
. = "WEST+[X-1]"
else
. = "CENTER"
/obj/screen/movable/proc/decode_screen_X(X)
//Find EAST/WEST implementations
if(findtext(X,"EAST-"))
var/num = text2num(copytext(X,6)) //Trim EAST-
if(!num)
num = 0
. = usr.client.view*2 + 1 - num
else if(findtext(X,"WEST+"))
var/num = text2num(copytext(X,6)) //Trim WEST+
if(!num)
num = 0
. = num+1
else if(findtext(X,"CENTER"))
. = usr.client.view+1
/obj/screen/movable/proc/encode_screen_Y(Y)
if(Y > usr.client.view+1)
. = "NORTH-[usr.client.view*2 + 1-Y]"
else if(Y < usr.client.view+1)
. = "SOUTH+[Y-1]"
else
. = "CENTER"
/obj/screen/movable/proc/decode_screen_Y(Y)
if(findtext(Y,"NORTH-"))
var/num = text2num(copytext(Y,7)) //Trim NORTH-
if(!num)
num = 0
. = usr.client.view*2 + 1 - num
else if(findtext(Y,"SOUTH+"))
var/num = text2num(copytext(Y,7)) //Time SOUTH+
if(!num)
num = 0
. = num+1
else if(findtext(Y,"CENTER"))
. = usr.client.view+1
//Debug procs
/client/proc/test_movable_UI()
set category = "Debug"
set name = "Spawn Movable UI Object"
var/obj/screen/movable/M = new()
M.name = "Movable UI Object"
M.icon_state = "block"
M.maptext = "Movable"
M.maptext_width = 64
var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") as text
if(!screen_l)
return
M.screen_loc = screen_l
screen += M
/client/proc/test_snap_UI()
set category = "Debug"
set name = "Spawn Snap UI Object"
var/obj/screen/movable/snap/S = new()
S.name = "Snap UI Object"
S.icon_state = "block"
S.maptext = "Snap"
S.maptext_width = 64
var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") as text
if(!screen_l)
return
S.screen_loc = screen_l
screen += S
+16 -1
View File
@@ -2,9 +2,15 @@
/datum/hud/proc/unplayer_hud()
return
/mob/dead/observer/instantiate_hud(var/datum/hud/HUD)
HUD.ghost_hud()
/datum/hud/proc/ghost_hud()
return
/mob/living/carbon/brain/instantiate_hud(var/datum/hud/HUD)
HUD.brain_hud()
/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
@@ -13,6 +19,12 @@
mymob.blind.screen_loc = "1,1"
mymob.blind.invisibility = 101
/mob/living/silicon/ai/instantiate_hud(var/datum/hud/HUD)
HUD.ai_hud()
/datum/hud/proc/ai_hud()
return
/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
blobpwrdisplay = new /obj/screen()
@@ -31,6 +43,9 @@
mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay)
/mob/living/carbon/slime/instantiate_hud(var/datum/hud/HUD)
HUD.slime_hud()
/datum/hud/proc/slime_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
src.adding = list()
@@ -118,7 +133,7 @@
mymob.flash.icon = 'icons/mob/screen1.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
if(constructtype)
+7 -23
View File
@@ -1,5 +1,7 @@
var/obj/screen/robot_inventory
/mob/living/silicon/robot/instantiate_hud(var/datum/hud/HUD)
HUD.robot_hud()
/datum/hud/proc/robot_hud()
@@ -143,7 +145,7 @@ var/obj/screen/robot_inventory
mymob.flash.icon = 'icons/mob/screen1_robot.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
@@ -153,31 +155,13 @@ var/obj/screen/robot_inventory
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
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.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)
src.adding += mymob.item_use_icon
mymob.radio_use_icon = new /obj/screen/gun/radio(null)
if (mymob.client.target_can_radio)
mymob.radio_use_icon.set_dir(1)
src.adding += mymob.radio_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.set_dir(1)
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.set_dir(1)
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.item_use_icon = new /obj/screen/gun/item(null)
mymob.gun_move_icon = new /obj/screen/gun/move(null)
mymob.radio_use_icon = new /obj/screen/gun/radio(null)
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon, robot_inventory) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, robot_inventory, mymob.gun_setting_icon)
mymob.client.screen += src.adding + src.other
return
+6 -91
View File
@@ -12,11 +12,10 @@
layer = 20.0
unacidable = 1
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/gun_click_time = -100 //I'm lazy.
/obj/screen/Destroy()
master = null
..()
return ..()
/obj/screen/text
icon = null
@@ -52,9 +51,8 @@
/obj/screen/item_action/Click()
if(!usr || !owner)
return 1
if(usr.next_move >= world.time)
if(!usr.canClick())
return
usr.next_move = world.time + 6
if(usr.stat || usr.restrained() || usr.stunned || usr.lying)
return 1
@@ -65,11 +63,6 @@
owner.ui_action_click()
return 1
//This is the proc used to update all the action buttons. It just returns for all mob types except humans.
/mob/proc/update_action_buttons()
return
/obj/screen/grab
name = "grab"
@@ -89,7 +82,7 @@
name = "storage"
/obj/screen/storage/Click()
if(world.time <= usr.next_move)
if(!usr.canClick())
return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1
@@ -99,41 +92,8 @@
var/obj/item/I = usr.get_active_hand()
if(I)
usr.ClickOn(master)
usr.next_move = world.time+2
return 1
/obj/screen/gun
name = "gun"
icon = 'icons/mob/screen1.dmi'
master = null
dir = 2
move
name = "Allow Walking"
icon_state = "no_walk0"
screen_loc = ui_gun2
run
name = "Allow Running"
icon_state = "no_run0"
screen_loc = ui_gun3
item
name = "Allow Item Use"
icon_state = "no_item0"
screen_loc = ui_gun1
mode
name = "Toggle Gun Mode"
icon_state = "gun0"
screen_loc = ui_gun_select
//dir = 1
radio
name = "Allow Radio Use"
icon_state = "no_radio0"
screen_loc = ui_gun4
/obj/screen/zone_sel
name = "damage zone"
icon_state = "zone_sel"
@@ -208,7 +168,6 @@
/obj/screen/Click(location, control, params)
if(!usr) return 1
switch(name)
if("toggle")
if(usr.hud_used.inventory_shown)
@@ -281,9 +240,9 @@
else
var/no_mask
if(!(C.wear_mask && C.wear_mask.flags & AIRTIGHT))
if(!(C.wear_mask && C.wear_mask.item_flags & AIRTIGHT))
var/mob/living/carbon/human/H = C
if(!(H.head && H.head.flags & AIRTIGHT))
if(!(H.head && H.head.item_flags & AIRTIGHT))
no_mask = 1
if(no_mask)
@@ -438,46 +397,6 @@
if("module3")
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(3)
if("Allow Walking", "Disallow Walking")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetMove()
gun_click_time = world.time
if("Allow Running", "Disallow Running")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetRun()
gun_click_time = world.time
if("Allow Item Use", "Disallow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetClick()
gun_click_time = world.time
if("Toggle Gun Mode")
usr.client.ToggleGunMode()
if("Allow Radio Use", "Disallow Radio Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetRadio()
gun_click_time = world.time
if("AI Core")
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
@@ -554,7 +473,6 @@
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
AI.sensor_mode()
else
return 0
return 1
@@ -562,7 +480,7 @@
/obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
if(world.time <= usr.next_move)
if(!usr.canClick())
return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1
@@ -573,12 +491,10 @@
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.activate_hand("r")
usr.next_move = world.time+2
if("l_hand")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.activate_hand("l")
usr.next_move = world.time+2
if("swap")
usr:swap_hand()
if("hand")
@@ -587,5 +503,4 @@
if(usr.attack_ui(slot_id))
usr.update_inv_l_hand(0)
usr.update_inv_r_hand(0)
usr.next_move = world.time+6
return 1
+33 -20
View File
@@ -23,9 +23,9 @@
spell_holder.client.screen -= src
spell_holder = null
/obj/screen/movable/spell_master/ResetVars()
..("spell_objects", args)
spell_objects = list()
/obj/screen/movable/spell_master/ResetVars(var/list/exclude = list())
exclude += "spell_objects"
..(exclude)
/obj/screen/movable/spell_master/MouseDrop()
if(showing)
@@ -50,25 +50,34 @@
overlays.len = 0
overlays.Add(closed_state)
else if(forced_state != 1)
var/temp_loc = screen_loc
var/x_position = text2num(copytext(temp_loc, 1, findtext(temp_loc, ":")))
var/x_pix = text2num(copytext(temp_loc, findtext(temp_loc, ":") + 1, findtext(temp_loc, ",")))
temp_loc = copytext(temp_loc, findtext(temp_loc, ",") + 1)
var/y_position = text2num(copytext(temp_loc, 1, findtext(temp_loc, ":")))
var/y_pix = text2num(copytext(temp_loc, findtext(temp_loc, ":")+1))
for(var/i = 1; i <= spell_objects.len; i++)
var/obj/screen/spell/S = spell_objects[i]
S.screen_loc = "[x_position + (x_position < 8 ? 1 : -1)*(i%7)]:[x_pix],[y_position + (y_position < 8 ? round(i/7) : -round(i/7))]:[y_pix]"
if(spell_holder && spell_holder.client)
spell_holder.client.screen += S
S.handle_icon_updates = 1
open_spellmaster()
update_spells(1)
showing = 1
overlays.len = 0
overlays.Add(open_state)
/obj/screen/movable/spell_master/proc/open_spellmaster()
var/list/screen_loc_xy = text2list(screen_loc,",")
//Create list of X offsets
var/list/screen_loc_X = text2list(screen_loc_xy[1],":")
var/x_position = decode_screen_X(screen_loc_X[1])
var/x_pix = screen_loc_X[2]
//Create list of Y offsets
var/list/screen_loc_Y = text2list(screen_loc_xy[2],":")
var/y_position = decode_screen_Y(screen_loc_Y[1])
var/y_pix = screen_loc_Y[2]
for(var/i = 1; i <= spell_objects.len; i++)
var/obj/screen/spell/S = spell_objects[i]
var/xpos = x_position + (x_position < 8 ? 1 : -1)*(i%7)
var/ypos = y_position + (y_position < 8 ? round(i/7) : -round(i/7))
S.screen_loc = "[encode_screen_X(xpos)]:[x_pix],[encode_screen_Y(ypos)]:[y_pix]"
if(spell_holder && spell_holder.client)
spell_holder.client.screen += S
S.handle_icon_updates = 1
/obj/screen/movable/spell_master/proc/add_spell(var/spell/spell)
if(!spell) return
@@ -77,13 +86,14 @@
return
else
spell_objects.Add(spell.connected_button)
toggle_open(2)
if(spell_holder.client)
toggle_open(2)
return
if(spell.spell_flags & NO_BUTTON) //no button to add if we don't get one
return
var/obj/screen/spell/newscreen = new /obj/screen/spell
var/obj/screen/spell/newscreen = PoolOrNew(/obj/screen/spell)
newscreen.spellmaster = src
newscreen.spell = spell
@@ -99,7 +109,8 @@
newscreen.name = spell.name
newscreen.update_charge(1)
spell_objects.Add(newscreen)
toggle_open(2) //forces the icons to refresh on screen
if(spell_holder.client)
toggle_open(2) //forces the icons to refresh on screen
/obj/screen/movable/spell_master/proc/remove_spell(var/spell/spell)
qdel(spell.connected_button)
@@ -154,6 +165,8 @@
last_charged_icon = null
if(spellmaster)
spellmaster.spell_objects -= src
if(spellmaster.spell_holder && spellmaster.spell_holder.client)
spellmaster.spell_holder.client.screen -= src
if(spellmaster && !spellmaster.spell_objects.len)
qdel(spellmaster)
spellmaster = null
+53 -70
View File
@@ -1,55 +1,59 @@
/*
=== Item Click Call Sequences ===
These are the default click code call sequences used when clicking on stuff with an item.
Atoms:
mob/ClickOn() calls the item's resolve_attackby() proc.
item/resolve_attackby() calls the target atom's attackby() proc.
Mobs:
mob/living/attackby() after checking for surgery, calls the item's attack() proc.
item/attack() generates attack logs, sets click cooldown and calls the mob's attacked_with_item() proc. If you override this, consider whether you need to set a click cooldown, play attack animations, and generate logs yourself.
mob/attacked_with_item() should then do mob-type specific stuff (like determining hit/miss, handling shields, etc) and then possibly call the item's apply_hit_effect() proc to actually apply the effects of being hit.
Item Hit Effects:
item/apply_hit_effect() can be overriden to do whatever you want. However "standard" physical damage based weapons should make use of the target mob's hit_with_weapon() proc to
avoid code duplication. This includes items that may sometimes act as a standard weapon in addition to having other effects (e.g. stunbatons on harm intent).
*/
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
/obj/item/proc/attack_self(mob/user)
return
//I would prefer to rename this to attack(), but that would involve touching hundreds of files.
/obj/item/proc/resolve_attackby(atom/A, mob/user)
add_fingerprint(user)
return A.attackby(src, user)
// No comment
/atom/proc/attackby(obj/item/W, mob/user)
return
/atom/movable/attackby(obj/item/W, mob/user)
if(!(W.flags&NOBLUDGEON))
if(!(W.flags & NOBLUDGEON))
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")
/mob/living/attackby(obj/item/I, mob/user)
if(istype(I) && ismob(user))
I.attack(src, user)
if(!ismob(user))
return 0
if(can_operate(src) && do_surgery(src,user,I)) //Surgery
return 1
return I.attack(src, user, user.zone_sel.selecting)
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
return
//TODO: refactor mob attack code.
/*
Busy writing something else that I don't want to get mixed up in a general attack code, and I don't want to forget this so leaving a note here.
leave attackby() as handling the general case of "using an item on a mob"
attackby() will decide to call attacked_by() or not.
attacked_by() will be made a living level proc and handle the specific case of "attacking with an item to cause harm"
attacked_by() will then call attack() so that stunbatons and other weapons that have special attack effects can do their thing.
attacked_by() will handle hitting/missing/logging as it does now, and will call attack() to apply the attack effects (damage) instead of the other way around (as it is now).
*/
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if(!istype(M) || (can_operate(M) && do_surgery(M,user,src))) return 0
// Knifing
if(edge)
for(var/obj/item/weapon/grab/G in M.grabbed_by)
if(G.assailant == user && G.state >= GRAB_NECK && world.time >= (G.last_action + 20))
//TODO: better alternative for applying damage multiple times? Nice knifing sound?
M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge)
M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge)
M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge)
M.adjustOxyLoss(60) // Brain lacks oxygen immediately, pass out
flick(G.hud.icon_state, G.hud)
G.last_action = world.time
user.visible_message("<span class='danger'>[user] slit [M]'s throat open with \the [name]!</span>")
user.attack_log += "\[[time_stamp()]\]<font color='red'> Knifed [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Got knifed by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
msg_admin_attack("[key_name(user)] knifed [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)" )
return
//I would prefer to rename this attack_as_weapon(), but that would involve touching hundreds of files.
/obj/item/proc/attack(mob/living/M, mob/living/user, var/target_zone)
if(!force || (flags & NOBLUDGEON))
return 0
if(M == user && user.a_intent != I_HURT)
return 0
/////////////////////////
user.lastattacked = M
@@ -61,43 +65,22 @@ attacked_by() will handle hitting/missing/logging as it does now, and will call
msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)" )
/////////////////////////
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(M)
var/hit_zone = M.resolve_item_attack(src, user, target_zone)
if(hit_zone)
apply_hit_effect(M, user, hit_zone)
return 1
//Called when a weapon is used to make a successful melee attack on a mob. Returns the blocked result
/obj/item/proc/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
if(hitsound)
playsound(loc, hitsound, 50, 1, -1)
var/power = force
if(HULK in user.mutations)
power *= 2
return target.hit_with_weapon(src, user, power, hit_zone)
// TODO: needs to be refactored into a mob/living level attacked_by() proc. ~Z
user.do_attack_animation(M)
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
// Handle striking to cripple.
var/dislocation_str
if(user.a_intent == "disarm")
dislocation_str = H.attack_joint(src, user, def_zone)
if(H.attacked_by(src, user, def_zone) && hitsound)
playsound(loc, hitsound, 50, 1, -1)
spawn(1) //ugh I hate this but I don't want to root through human attack procs to print it after this call resolves.
if(dislocation_str) user.visible_message("<span class='danger'>[dislocation_str]</span>")
return 1
return 0
else
if(attack_verb.len)
user.visible_message("<span class='danger'>[M] has been [pick(attack_verb)] with [src] by [user]!</span>")
else
user.visible_message("<span class='danger'>[M] has been attacked with [src] by [user]!</span>")
if (hitsound)
playsound(loc, hitsound, 50, 1, -1)
switch(damtype)
if("brute")
M.take_organ_damage(power)
if(prob(33)) // Added blood for whacking non-humans too
var/turf/simulated/location = get_turf(M)
if(istype(location)) location.add_blood_floor(M)
if("fire")
if (!(COLD_RESISTANCE in M.mutations))
M.take_organ_damage(0, power)
M << "Aargh it burns!"
M.updatehealth()
add_fingerprint(user)
return 1
+6 -6
View File
@@ -6,9 +6,9 @@
if(!client) return
client.inquisitive_ghost = !client.inquisitive_ghost
if(client.inquisitive_ghost)
src << "\blue You will now examine everything you click on."
src << "<span class='notice'>You will now examine everything you click on.</span>"
else
src << "\blue You will no longer examine things you click on."
src << "<span class='notice'>You will no longer examine things you click on.</span>"
/mob/dead/observer/DblClickOn(var/atom/A, var/params)
if(client.buildmode)
@@ -25,15 +25,15 @@
// Otherwise jump
else
following = null
loc = get_turf(A)
stop_following()
forceMove(get_turf(A))
/mob/dead/observer/ClickOn(var/atom/A, var/params)
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
if(world.time <= next_move) return
next_move = world.time + 8
if(!canClick()) return
setClickCooldown(4)
// You are responsible for checking config.ghost_interaction when you override this function
// Not all of them require checking, see below
A.attack_ghost(src)

Some files were not shown because too many files have changed in this diff Show More